Documentation Best Practices (dashboards and notebooks)
FollowClear and complete documentation is critical to making your work understandable and reproducible - for yourself, your team, and others. Below are Best Practice Guidelines - developed by the UX and User Ed teams - to help improve documentation in workspace dashboards and in notebooks in Terra.
Contents
Must-have dashboard components
Overall dashboard recommendations
- Limit the dashboard to high-level content
- Offload details like step-by-step instructions or configurations
- Use whitespace to group information in sections
- Use visuals
Notebooks documentation Best Practices
- Use collapsible headings to streamline information
- Include a reference key
- Document with code cell comments
- Use codefolding to hide long code blocks
Must-have dashboard components
Your dashboard should include - or clearly reference - any information needed to reproduce the analysis. 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)
- 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 and Include links to separate instructions in the dashboard. Comms can use a Zendesk article (preferred) and others can use a pdf for step-by-step instructions.
Example of separate step-by-step instructions (Zendesk article or pdf)
Overall dashboard recommendations
For security reasons, Terra dashboards use a version of markdown that doesn't support html code. Because of this, dashboards have limited formatting options. 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 the dashboard to high-level content
Keep dashboard documentation to a minimum by focusing on high-level information. A clean and clear dashboard, with adequate space in between headers and grouping of relevant blocks, is a clearer, more effective way to communicate the goals. Use links to reference more information, when needed.
Click for an example dashboard

2. Offload details like step-by-step instructions or configurations
For step-by-step instructions, link to a Zendesk article (for User-Ed/Comms) or a PDF. For an example of step-by-step instructions to go along with a workspace, see this Zendesk articl or this PDF example of step-by-step instructions for the Workflows-QuickStart. Make it very clear how to access these resources.
Example of separate step-by-step instructions (Zendesk article or pdf)
3. Use whitespace to group information in sections
Markdown puts the same amount of space between every item, which means a lot of scrolling without aa lot of breaks. Additionally, lines ("-------" in markdown) make for a cluttered dashboard that is hard to read.
To add white spaces, insert a fake graphic piece (note you may have to play with the size of the whitespace to get it right).
Click for an example and sample code
A screenshot of one section of the quickstart dashboard is below. Note the additional whitespace before each section header:
The markdown code you would use looks like this: 
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. You will likely need to scale them to fit in the dashboard.
To add a visual click the picture icon in the 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:

Within the brackets, put the image title and in the parenthesis put the location.
Click for an example
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:
For example screenshots, click to expand
Collapsed tip:
Expanded tip:
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, click to expand
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.
For an example documentation reference key, click to expand
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.
Click for an example of comments in code cells
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.
See an example of folded and unfolded code cells
Folded version:
Unfolded version:
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.
Comments
0 comments
Please sign in to leave a comment.