Documentation best practices (dashboards and notebooks)

Allie Hajian
  • Updated

Learn how to make your work on Terra understandable and reproducible - for yourself, your team, and others - with clear and complete documentation. Read on for best practice guidelines - developed by the UX and User Ed teams - to help improve documentation in workspace dashboards and in notebooks. 

Workspace dashboard documentation best practices

Workspace documentation is written in GitHub-flavored Markdown, with a handful of exceptions (the emoji shortcut and linking by id within the page are currently not allowed in Terra). You can edit the dashboard by clicking the pencil icon at the top of the Dashboard tab. 

Why good documentation matters
Your workspace dashboard should include - or clearly reference - any information needed to reproduce the analysis. This makes it easier for everyone, including your colleagues and even yourself (if you return to the workspace after a bit of time, for example). 

Must-have dashboard components

At a minimum, tutorial and template workspace dashboards should include the components below, set apart with h1 or h2 headings in markdown (i.e. # or ##). 

1. Workspace purpose
(i.e. "What am I going to be doing?")

This should be brief and at the top. Remember, the first sentence or two in the workspace dashboard is what will display on the workspace card in the Showcase section of the library.

2. Workspace expectations
(include as sections in Markdown - i.e. #, ## in Markdown)

- How much will it cost?  
- How long will it take?
- What tools will I be using? 
- What is the expected outcome?

3. Separate step-by-step instructions

Your work may require unfamiliar users to follow a detailed set of instructions, but dashboards that include step-by-step instructions (with screenshots) can be hard to process. Instead of making readers scroll through an endless dashboard of instructions, write separate instructions (in PDF or external online format such as GitBook or Zendesk) and Include links to separate instructions in the dashboard. 

Example of separate step-by-step instructions (Zendesk article or pdf)

Overall dashboard recommendations

Dashboards have somewhat limited formatting options, since security considerations require a version of markdown that doesn't support css or anchor tags (useful for making a table of contents, for example). To capture the information you want while making it easier for people to quickly find what they need to know, use these suggestions.   

1. Limit dashboard to high-level content

Keep dashboard documentation to a minimum by focusing on high-level information. A clear dashboard with adequate space in between headers and grouping of relevant blocks is a more effective way to communicate study goals and methods. Use links to reference more information, when needed. 

Click here for an example dashboard.

Expand to see an example dashboard screenshot


2. Offload details like step-by-step instructions or configurations

For step-by-step instructions, link to a support (for User-Ed/Comms) or GitBook article, or a PDF. For an example of step-by-step instructions to go along with a workspace, see this support article or this PDF example of step-by-step instructions for the Workflows-QuickStart. Don't forget to make it very clear in the dashboard how to access these resources!

Example of separate step-by-step instructions (Zendesk article or pdf)

3. Use whitespace (not horizontal lines) to group information in sections

Markdown puts the same amount of space between every item, which means a lot of scrolling without a lot of breaks. Additionally, horizontal lines ("-------" in markdown) make for a cluttered dashboard that is hard to read.

To add whitespace, insert a fake graphic piece (note you may have to play with the size of the whitespace to get it right).  

Example whitespace in dashboard
A screenshot of one section of the quickstart dashboard is below. Note the additional whitespace before each section header.

Example markdown code to add whitespace

 ![white space](href="")

4. Use visuals

Graphic elements can help visual learners, and break up a long dashboard description. You can use the graphic assets here to generate your own. Note: if you are embedding images using markdown (instead of html, below) you will likely need to scale images to fit nicely in the dashboard, as markdown puts the image in full-sized, whatever size that is.

Example visual (workspace flow diagram)

Example code to add visuals

To add a visual click the picture icon in the dashboard edit menu. The image must be stored online (like in a public google bucket) for it to be viewable. Once the icon is clicked it will display the following:

 ![your-image-title - i.e. the "alt" tag](https://your-image-full-file-name) 

Within the brackets, put the image title and in the parenthesis put the location.

Or use html (see more on this below):

<img alt="A Warm Hello!" title="Hello, World!" src="" width="64">

Supported html tags in dashboard documentation

To make your dashboard easier to read, you can also use some embedded html tags. Note that although custom scripting and styling (i.e. css code, and alt tags) are not allowed, most html is.

Some html in Terra dashboards examples

This is only a subset of what you can do with html tags! For a full list of the html allowed in GitHub Markdown (the kind used in Terra dashboards, see their documentation.

Embedding an image

<img alt="A Warm Hello!" title="Hello, World!" src="" width="64">: 
A Warm Hello!

Opening a link in a new browser tab

<a href="https://somewhere" target="_blank">link text</a>

Superscript and subscript


Notebooks documentation Best Practices

With a combination of documentation and code, Notebooks are a wonderful tool for making your analysis more understandable and reproducible - for yourself and your colleagues, as well as others. To make the most of the documentation tools in a notebook, follow the Best Practices suggestions below.

1. Use collapsible headings to streamline information

Collapsible headings are exactly what they sounds like: sub-section markdown cells nested under a heading will be collapsed. To use collapsible headings, click on the downward-facing gray arrow at the left of the markdown cell to collapse the sections under that heading. The saved notebook will save these states. 

You can use this to hide optional information, for example, see the screenshots by expanding the collapsed section below:

Collapsed tip:S50e_Collapsible_heading_tip.png
Expanded tip:S50f_Collapsible_heading_expanded_tip.png

Warning: If you collapse a section that includes code cells, the code cells will be hidden and will not run until you expand the section. For this reason, you may need to be careful when nesting your sections in order to make sure the code isn't collapsed. 

For an example where this applies

This collapsed section includes code that won't run unless you first expand the section.

Note that the section automatically expands if you run the top markdown cell (the one in the screenshot above). This means that if you use the "Run all" commands, the hidden cells will run:

2. Include a documentation reference key

It is useful to use consistent formatting and include a reference key to help users navigate your notebook. Using a consistent formatting for code, additional information, tips, etc. will make your notebooks work well together, and will make it easier to maintain good documentation across all work. 


3. Document with code cell comments

Best Practices is to include comments directly in the code cell (use "# comment here" formatting) written in plain language to describe what the code in the cell does.  

Example code comments:S50h_Code_cell_comments.png
 4. Use codefolding to hide long code blocks

Not everyone running your notebook will need to know the coding details of each cell. One beautiful thing about a well-documented notebook is being able to go through the analysis and understand the results without having to know how to program. To focus on the results and not get bogged down in the coding details, you can use codefolding to hide the full commands.  People who want to know the exact syntax can easily unfold the code. To use codefolding, click on the downward-facing gray arrow at the left of the code cell to fold the code. Saving the notebook will save the state of your folded cells.    

Folded version:S50j_Code_cell_with_comments_folded.png

Unfolded version:S50h_Code_cell_comments.png

Best practices example

For an example of a workspace that follows these Best Practices (including in notebooks as well as dashboard documentation!), check out the Terra-Notebooks-QuickStart


Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.