Notebooks 2 provides two flavors of Markdown. The default Markdown converter is based on Discount, but you can also select MultiMarkdown 6. Both converters support basic Markdown, but they also offer different sets of extensions. So extensions that work in one converter don't necessarily work in the other, and they may require varying syntax for elements like tables.
You set your preferred Markdown converter in Notebooks' preferences, but you can select a different converter for any book and its contents, and even override your selection for single documents.
Use one to six hash (#) characters at the start of the line, corresponding to header levels:
# This is a level one header
## This is a level two header
###### This is a level six header
Unordered lists use asterisk (*), plus (+), and hyphen (-) as list markers. Ordered lists use numbers followed by periods, but the actual numbers you use have no effect on the result.
- Red
- Green
- Blue
1. Red
2. Green
3. Blue
Add three or more asterisks (*), hyphens (-) or underscores (_) on a line:
***
Use asterisks (*) and underscores (_) as indicators of emphasis. Text wrapped with one of these character appears italic, text wrapped with two characters appears bold.
this is *italic* and this is **bold**, and this is ***bold and italic***
The complete syntax as defined in the Markdown standard is documented at the Markdown website.
By default, Notebooks uses Discount, a great and fast open source Markdown converter by David Parson, which supports a few extras not available in standard Markdown. Some of these options are not available if you choose MultiMarkdown as converter.
Wrap the text that should appear struck through with "~~".
This is the code for ~~struck through~~ text.
To center a paragraph, just wrap it with –> and <–
->This is a centered paragraph<-
They follow the definition from Michael Fortin’s PHP Markdown
First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell
Text with a footnote.[^1] [^1]: Here is the footnote.
Wrap the tag with "=" and indent the definition with four spaces or one tab.
=Apple=
Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
=Orange=
The fruit of an ~~evergreen~~ tree of the genus Citrus
Notebooks also supports PHP Markdown style definition lists like this:
Apple
: Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
Orange
: The fruit of an ~~evergreen~~ tree of the genus Citrus
> Email-style angle brackets
> are used for blockquotes.
> > And, they can be nested.
> #### Headers in blockquotes
>
> * You can quote a list.
> * Etc.
Surround the text with at least three ~ characters or four ` (back tick) characters.
~~~
This text appears as a code block
~~~
```` This text appears as a code block, in back tick notation. ````
If the first three lines in the document begin with a % character, they are taken to be a document header in the form of
% Title
% Author
% Date
During conversion to HTML, Notebooks uses this information to produce a formatted document header. Notebooks' built in document styles apply specific CSS styles to this header.
You are not limited to this sequence, and instead of plain text you could add HTML code, for example, and insert an image instead of an author's name.
MultiMarkdown was created to use the syntax of Markdown, but extend it to work with complete documents that can be converted from text to other formats, including HTML documents, LaTeX or PDF. The extensions are too extensive to be listed here, hence the reference to the MMD documentation.
MultiMarkdown can also interpret CriticMarkdown. In Notebooks, CriticMarkdown annotations are colorized in plain text. When viewing the rendered HTML version, you have the option to highlight the annotations or to accept them (which produces the final text).
You can add a table of contents to your Markdown document from the ••• menu by selecting Show Table Of Contents (you can remove it just as easily again). The table is a structured list of clickable links leading to the headers in the document.
By default, the table of contents appears at the top of the document or right below the Pandoc header if you use one, but you can also choose where within the document the TOC should appear. Just add
<TOC> or
{{TOC}} (the MultiMarkdown syntax)
at the position where Notebooks should insert the table of contents. Please make sure to put the tag at the beginning of a line, and ideally add an empty line above and below.
Notebooks provides a set of keyboard shortcuts that make editing Markdown much more convenient. You find the list of shortcuts in an extra document.