This page provides an overview of the types of block and inline markup features supported by CommonMark and MyST, with pointers to additional content of interest. For full details on all the nuance of these features, please look at the CommonMark Spec documentation.
MyST (Markedly Structured Text) was designed to make it easier to create publishable computational documents written with Markdown notation. It is a superset of CommonMark Markdown and draws heavy inspiration from reStructuredText and pandoc. In addition to CommonMark, MyST also implements and extends unist and mdast, which are standard abstract syntax trees for Markdown.
unist is part of the unifiedjs community and has many utilities for analyzing, exporting and transforming your content.
Markdown syntax denotes headers starting with between 1 to 6
For example, a level 3 header looks like:
An alternative syntax (called setext) is also supported for level 1 and 2 headers,
by underlining using multiple
---. For example:
Code blocks are enclosed in 3 or more
~ with an optional language name.
Indented paragraphs are also treated as literal text. This may be used for code or other preformatted text.
Quote blocks are prepended with
Create a horizontal line in the output
Links may be defined outside of text with a reference target (no spaces) and an optional title.
Any text that does not belong to another block is simply a paragraph:
Any valid HTML may also be included in a MyST document and rendered to HTML. However, you must set the option
allowDangerousHtml: true in the MyST parser.
Auto-link where link itself is shown in final output:
Link with alternative text and optional title:
Link to an image can be done similar to other inline links, or you may use HTML syntax to include image size, etc.
Standard inline formatting including bold, italic, code, as well as escaped symbols and line breaks: