Syntext

A lightweight, markdownish markup language for generating HTML.

Version 3.1.0

Miscellanea


Tables of Contents

Syntext can automatically generate a table of contents for a document. This table can be inserted using the insert tag:

::: insert toc

The default listing skips H1 headings to avoid including the document title itself. A full listing of all the document's headings can be inserted using the fulltoc keyword:

::: insert fulltoc

The table of contents is generated as an unordered list of links.

Footnotes

Syntext includes built-in support for footnotes:

This sentence ends with a footnote reference.[^1]

Footnote references can omit their index to take advantage of automatic numbering:

This sentence ends with an automatically-numbered
reference.[^]

Footnotes themselves can be specified anywhere in the document using the footnote tag:

::: footnote 1
    This is a footnote. It can contain any kind of
    block-level markup.

Footnotes can also omit their index to take advantage of automatic numbering:

::: footnote
    This is an automatically-numbered footnote.

Note that footnote indices do not have to be numeric — any sequence of non-whitespace characters can be used.

You can specify the insertion point for your footnotes using the insert tag:

::: insert footnotes

Footnote references are wrapped in the following markup:

<sup class="footnote" id="fnref:1">
    <a href="#fn:1">1</a>
</sup>

Footnotes are output as items in a description list:

<dl class="footnotes">
    <div id="fn:1">
        <dt><a href="#fnref:1">1</a></dt>
        <dd> ... </dd>
    </div>
    ...
</dl>

Each footnote index is backlinked to its reference in the document.

Alternate Footnote Styles

Syntext supports two alternate styles for footnote references: superscripted1 and inline 2.

Superscripted references look like this [^1] while inline references look like this [fn:2]. The only difference in markup is that superscripted references are wrapped in a <sup> tag while inline references are wrapped in a <span>.

Tab Translation Size

Tab characters in input text are translated into spaces — by default, 4 spaces per tab. This value can be customized via the tabsize argument:

html = syntext.render(text, tabsize=8)

This argument is also available on the command line:

$ syntext --tabsize 8 < input.txt > output.html

Notes

1

This is a sample footnote. Footnotes can contain any kind of block-level markup including multiple paragraphs.

2

And this is another sample footnote.