5 Module Reference
A parameter that, during compilation of a Punct source, holds the metadata hash table for that file.
The final value of this parameter becomes the value of document-metas
for that file’s
as well as its metas
The only key automatically defined in every metadata table is 'here-path, which holds the
absolute path to the source file.
If no Punct file is currently being compiled, this parameter will hold #f by default. In
particular, this parameter is not automatically set to a Punct file’s metas
during the rendering phase (e.g., doc->html).
Set the value of key
. If there are no current
metas, an ugly exception is thrown.
Within a Punct file, this macro can be used as shorthand for set-meta
. Each key
is given as a bare identifier (i.e., without using quote
The bindings provided by this module are also provided by punct/core.
A parsed Punct document.
Changed in version 1.0 of package punct-lib: body and footnotes now guaranteed to be valid
X-expressions and not simply lists.
Returns the doc
binding from src
. No caching is used; this function is
basically a thin wrapper around dynamic-require
. If src
does not exist, you will
get a friendly error message. If any other kind of problem arises, you will get an ugly error.
Returns the value of key in the metas hash table provided by src,
or #f if the key does not exist in that hash table. If src does not exist, you
will get a friendly error message. If any other kind of problem arises, you will get an ugly error.
into a Punct AST by serializing everything as a string, sending the string
through the commonmark
parser, and then converting the result into a Punct
, reconstituting any custom elements
in the process.
If #:extract-inline? is #true, and if the parsed document contains only a single
paragraph element at the root level, then the inline content of the paragraph is returned as
a list. Otherwise, the entire result is returned as a document.
The #:parse-footnotes? argument determines whether the commonmark parser
will parse Markdown-style footnote references and definitions in elements.
|> (define elems|
| '("# Title\n\nA paragraph with *italic* text, and "|
| (custom "custom element")))|
|> (parse-markup-elements (hasheq) elems)|
((heading ((level "1")) "Title")
"A paragraph with "
" text, and 1"
(custom "custom element")))