Marked Help

Marked Special Syntax

Page breaks

You can force page breaks in a document printed from the preview by inserting an HTML-style comment in your document:

<!--BREAK-->

Place that tag at the beginning of a line at any point in your document where you’d like to force the page to end and begin printing on the next page. These comments won’t show up in exported HTML, and won’t affect your preview or document statistics. Marked also recognizes Leanpub pagebreak format, so current documents are already compatible.

Note that in the Printing section of Preferences you can also tell Marked to automatically substitute page breaks for horizontal rules (---) or use level 1 and/or 2 headers as section dividers.

File includes

The contents of additional files can be inserted by using the syntax:

<<[folder/filename]

The path to the file can be relative to the index file or absolute. Includes can be nested; you can use this same syntax inside of an included file. If you’re using relative paths, includes in nested files should be relative to that file. However, MultiMarkdown will process everything based on the location of the first file opened, so all image paths or other embeds should be relative to the first parent file, even when they exist in child documents.

See “Multi-File Documents” for more information.

Including code

Marked can include external files as code using a syntax similar to file includes above:

<<(folder/filename)

Note the parenthesis instead of square brackets. For compatibility with Leanpub syntax, Marked will also recognize a preceding set of square brackets containing a title, but at the current time nothing is done with it in Marked:

<<[Code title](folder/filename)

The contents of the specified file will be inserted within a pre>code block in your document and will be available for automatic syntax highlighting if it’s enabled. Code blocks can not be nested and will not be processed with MultiMarkdown. Custom processors will still be run over the pre>code block created.

Including unprocessed text or html

Note: This feature is for advanced users.

If you want to include raw HTML or other text that should not be processed by MultiMarkdown (or your custom processor), you can use curly brackets ({}) to include a file after processing the rest of the document:

<<{folder/raw_file.html}

No include syntax will be recognized within these files (no nesting) and the raw contents of the file will be inserted in the final HTML output. This is great for inserting HTML without bogging down the text processor or having things converted/escaped when you don’t want them to be, but be careful as there are few safeguards to ensure formatting of the document is preserved around what you insert.


top