This is a sample Document.Factory document containing Markdown content along with a CSS stylesheet that is used to control the presentation of the resulting HTML output file.
The first line of a file is a header that specifies the kind of information
contained in the file - in this case, the reserved word markdown
specifies
that this contains text that conforms to the markdown specification. That
header line is followed by a block of markdown text.
Later in the file, a second header line introduces a fragment containing css styling information. The Yaml header for the css fragment specifies the name of the fragment, "styles", allowing the Markdown fragment to refer to it for inclusion.
A third fragment in the file contains another css fragment - this will be ignored because the generated html fragment does not reference it.
Other data included in the YAML header is ignored.
The file is loaded into the renderer and split into multiple fragments - one containing the Markdown content, and two containing css markup.
The markdown is rendered into a new HTML fragment. This fragment has no yaml header of its own, but has access to the values defined in the header of the markdown original.
By matching the css
value from the markdown fragment's yaml header with the
id
of the css fragments, the appropriate fragment will be selected and
embedded in the HTML fragment.
The HTML fragment is written to an output file