Note: Markdown is not a core feature of Tinderbox, although it supports its use as detailed below. Thus, problems using Markdown syntax to get the correct HTML output are best researched in the Markdown community. Or, if asking in the Tinderbox user forum be mindful that not all Tinderbox users know about or understand Markdown.
How does Tinderbox know to parse a note for Markdown markup?
This is done if $HTMLMarkdown is set to true
for a note. This occurs in a number of ways:
- zero-configuration use of the text pane 'Preview' tab. Doing this in a document with no export templates, adds the Hints folder (and its preview-related content. This includes setting the note's $HTMLMarkdown to
true
. - setting a note to use the built-in 'Markdown' prototype (which sets $HTMLMarkdown to
true
). - setting $HTMLMarkdown to
true
either manually or via action code.
As well as parsing for Markdown syntax such notes also evaluate the $Text as ^text(Markdown preview rendering,5-basic_all):: text tries to include itself including any incline export code; inline HTML code is treated as deliberate code (as opposed to literal text) and so not escaped.
Details of how Markdown and its various flavours work is out of scope for aTbRef and should be researched in Markdown resources such as markdownguide.org.
If no export template is defined for the note, the built-in default of ^text^ is used for selecting the content shown in the preview.
Tags embedded in the text such as ^value()^ are evaluated before being passed to Markdown.
Do not use place Markdown style marking around Tinderbox links in $Text (neither text nor web types of links) or the Markdown parser will double-encode the web link; it will look like a link but not work. In such a scenario, always check the source HTML of the exported page, or if working in the in-app Preview tab, look at the HTML code in the text Export tab.
Markdown variants available
Unlike HTML, evolution in the Markdown community means there are a number of 'flavours' of Markdown available. Each shares core Markdown feature support but then adds additional syntax/features some or none of which are compatible with other Markdown flavours.
The Tinderbox app ships with two flavours including:
- '
CommonMark
'. This is an internal pointer to the bundled copy of the newer and faster rendering fork of the original Markdown. Details of CommonMark features and how they work are at commonmark.org. CommonMark preview permits embedded HTML. - '
Markdown
'. This is an internal pointer to the bundled copy of the original Markdown processor. Details of CommonMark features and how they work are at daringfireball.net. - OS path to some other Markdown script. This allows Tinderbox to use a specified Markdown variant (e.g. one to which the user has added extra plug-ins) stored in the host macOS system.
In all the choice can be altered by setting the $HTMLPreviewCommand. If the latter is left blank (the default) 'markdown' is the assumed variant to use.
When using export, the text pane's Export tab displays the current note's $HTMLExportPreviewCommand value and allows the Markdown processing to be toggled on/off to help with troubleshooting its use.
Details of Markdown syntax and its various flavours work is out of scope for aTbRef and should be researched in Markdown resources such as markdownguide.org.
Preview streaming to other apps. When a Markdown-prototyped note in Tinderbox is selected or edited, its export and Markdown code-evaluated contents will be sent to apps that support preview streaming. Markdown apps currently known to use preview streaming with Tinderbox:
- Marked 2 (see more).
See also—notes linking to here: