Text and Markdown cells
Add narrative to your Hex project with Text or Markdown cells.
- Users will need Can Edit permissions.
Text and Markdown cells let you add narrative, explanations, and context to your data project.
Text cells provide a WYSIWIG (what you see is what you get) editor that accepts both markdown shortcuts for text formatting as well as UI-driven formatting. Markdown cells provide a familiar UI for Markdown writers, which render as cell output.
- Markdown cell
- Text cell
Both Markdown and Text cells allow you to mix variables with your text through use of the Jinja templating language, like so: Today we sold {{ n_widgets }} widgets
Check out the section on dynamic text for more tips.
Markdown and Text cell features
We plan to combine these cells into two modes of the same cell. For now, there are slight differences in the functionality of each cell type.
Feature | Markdown cell | Text cell |
---|---|---|
Formatting | ✅ | ✅¹ |
Dynamic text | ✅ | 🟡² |
User mentions | ❌ | ✅ |
Image support | ✅ | ✅ |
Emoji picker | ✅ | ❌ |
LaTeX formulas | ✅ | ❌ |
¹Currently, code blocks are not supported in Text cells (i.e. code blocks with three backticks). Code snippets (single backticks) are supported. All other formatting options (headings, bold, italics, hyperlinks, lists, and quotes) are supported in Text cells.
²Jinja support in Text Cells is only for Jinja variables (i.e. code within {{ }}
). At present, code blocks (within {% %}
), like if
statements and for
loops are not supported).
Formatting
Headings
- Markdown cell
- Text cell
To add a heading, use the #
symbol followed by the heading text. You can add up to 6 #
and the size of the heading will decrease with each one added.
To add a heading, select the text that you want to format and right click. The options menu will appear over the selected text from which you can choose your heading size. You can also use the #
symbol in the same way you would with a markdown heading.
Lists
- Markdown cell
- Text cell
To create unordered lists in markdown, use either the *
or -
symbols. To create an ordered list, use the )
or .
symbols preceded by a number.
To create an ordered or unordered list, select the list formatting option on the far right of the menu.
Links
- Markdown cell
- Text cell
To add a link to a markdown cell, you can wrap your text in square brackets []
followed by the URL wraped in parenthesis ()
.
To add links to a Text cell, select the part of your text where the link will go and select the link formatting option. Press enter once the link has been pasted to commit your changes. You can also add links by pasting the link over the text you wish to format
Code formatting
- Markdown cell
- Text cell
You can highlight variables in your text by wrapping your text in backticks (``), or you can use 3 backticks before and after your text to create a code block.
You can highlight variables within a Text cell using the code formatting option.
Code blocks are not yet supported in Text cells.
Quotes
- Markdown cell
- Text cell
To create a blockquote, start a line with a >
followed by the quote.
You can add a quote to a Text cell by selecting the blockquote option in the formatting menu.
Dynamic text
- Markdown cell
- Text cell
You can also insert Python variables directly into Markdown cells. Type your text as usual but in place of hard-coding the value you want, wrap the variable name in {{ }}
braces to dynamically update your Markdown text. See the screenshot below for an example.
Text cells support variable substitution using the usual double curly braces, {{}}
, of Jinja syntax. In order to render values, you'll need to run the cell.
Complex logic such as if statements and for loops are not yet supported.
User mentions
- Markdown cell
- Text cell
Markdown cells do not currently support user mentions
You can ping other members of your workspace by mentioning them in a Text cell. When mentioning a user, they will receive a notification by email or slack.
Image support
You can render images in Markdown and Text cells by dragging a file from your computer and dropping it in the cell. The image is uploaded as a file and can be referenced again in any other cell.
- Markdown cell
- Text cell
Emoji picker
- Markdown cell
- Text cell
To add an emoji to your markdown, start by adding a colon (:
) which will promt you to select an emoji from the list of available emojis.
The emoji picker has not yet been implemented for text cells
LaTeX formulas
- Markdown cell
- Text cell
You can use the $$
delimiters in Markdown to insert math expressions in LaTeX style syntax.
LaTeX formulas are not yet supported in Text cells.