Skip to content

XML metadata

step- edited this page Dec 7, 2024 · 1 revision

XML metadata

Some parser and viewer characteristics can be set inside the input Markdown document. We call this XML metadata or page metadata.

Metadata portability -- There is no guarantee that other Markdown viewing systems will ignore XML metadata. So if you want for your Mardown document to be compatible with other programs, do not include XML metadata.

Page metadata can be added by prefixing the Markdown text with an XML section. The following keys are supported:

<mtx>
    <renderer>
        <!-- output all tags - allows embedding pango markup -->
        <keep_tags>1</keep_tags>
        <!-- never add the Table of Contents -->
        <skip_toc>1</skip_toc>
    </renderer>
    <viewer>
        <!-- do not add the page name to the navigation trail -->
        <track_page>0</track_page>
    </viewer>
</mtx>

XML is only detected if it starts with <mtx> otherwise it is parsed as Markdown. The XML block is erased on output.

YAML metadata

There is no YAML medatada. The Markdown parser skips over a leading YAML section if it finds one. YAML is only detected if it starts with three dashes alone on a line, and ends with three dots, or three dashes, alone on another line. The YAML block is erased on output.

Clone this wiki locally