summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/markdown/markdown.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-04-05 21:58:26 +0000
committerKarl Berry <karl@freefriends.org>2022-04-05 21:58:26 +0000
commit36595a910f2b8a3a56606d6f16c2626f44b29822 (patch)
tree71faae4c79494470e4930ec6e9810d5f473788a4 /Master/texmf-dist/source/generic/markdown/markdown.dtx
parentcc0ced9a900ccb1da557afadafdd4f500f69944a (diff)
markdown (31mar22)
git-svn-id: svn://tug.org/texlive/trunk@62928 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/generic/markdown/markdown.dtx')
-rw-r--r--Master/texmf-dist/source/generic/markdown/markdown.dtx3268
1 files changed, 2427 insertions, 841 deletions
diff --git a/Master/texmf-dist/source/generic/markdown/markdown.dtx b/Master/texmf-dist/source/generic/markdown/markdown.dtx
index 60d76269908..d43c7ab3cd4 100644
--- a/Master/texmf-dist/source/generic/markdown/markdown.dtx
+++ b/Master/texmf-dist/source/generic/markdown/markdown.dtx
@@ -869,17 +869,17 @@ author: Vít Novotný
date: \markdownVersion{} (\markdownLastModified{})
---
+<link href="https://afeld.github.io/emoji-css/emoji.css" rel="stylesheet" />
+
% \fi
% \par
% \begin{markdown}
-<link href="https://afeld.github.io/emoji-css/emoji.css" rel="stylesheet" />
-
Introduction
============
The [Markdown package][pkg] converts [markdown][] markup to \TeX{} commands. The
functionality is provided both as a Lua module and as plain \TeX{}, \LaTeX{}, and
-\Hologo{ConTeXt} macro packages that can be used to directly typeset \TeX documents
+\Hologo{ConTeXt} macro packages that can be used to directly typeset \TeX{} documents
containing markdown markup. Unlike other convertors, the Markdown package
does not require any external programs, and makes it easy to redefine how each
and every markdown element is rendered. Creative abuse of the markdown
@@ -916,7 +916,7 @@ documentation][techdoc].
% \fi
% \begin{macrocode}
local metadata = {
- version = "$(VERSION)",
+ version = "(((VERSION)))",
comment = "A module for the conversion from markdown to plain TeX",
author = "John MacFarlane, Hans Hagen, Vít Novotný",
copyright = {"2009-2016 John MacFarlane, Hans Hagen",
@@ -942,7 +942,7 @@ Requirements
The package requires either [our official Docker image][docker], which contains
the latest development version of the Markdown package, or a \TeX{}
-distribution: [\TeX{} Live][tl] ≥ 2018 is known to work with the current
+distribution: [\TeX{} Live][tl] ≥ 2020 is known to work with the current
version of the Markdown package and so are recent versions of [Mik\TeX{}][mik].
If you are using an older, incomplete, or atypical \TeX{} distribution, please
consult the [technical documentation][techdoc] for a detailed list of
@@ -1104,7 +1104,22 @@ local md5 = require("md5")
%
% The plain \TeX{} part of the package requires that the plain \TeX{}
% format (or its superset) is loaded, all the Lua prerequisites (see
-% Section <#sec:luaprerequisites>), and the following Lua module:
+% Section <#sec:luaprerequisites>), and the following package:
+%
+% \pkg{expl3}
+%
+%: A package that enables the expl3 language from the \LaTeX3 kernel in
+% \TeX{} Live${}\leq{}2019$. It is not used for anything... yet.
+%
+% \end{markdown}
+% \begin{macrocode}
+\ifx\ExplSyntaxOn\undefined
+ \input expl3-generic\relax
+\fi
+% \end{macrocode}
+% \begin{markdown}
+%
+% The plain \TeX{} part of the package also requires the following Lua module:
%
% \pkg{Lua File System}
%
@@ -1210,10 +1225,8 @@ local md5 = require("md5")
% \pkg{ifthen}
%
%: A package that provides a concise syntax for the inspection of macro
-% values. It is used to determine whether or not the \pkg{paralist} package
-% should be loaded based on the user options, in the `witiko/dot` \LaTeX{}
-% theme (see Section <#sec:latexthemes>), and to provide default token
-% renderer prototypes.
+% values. It is used in the `witiko/dot` \LaTeX{} theme (see Section
+% <#sec:latexthemes>), and to provide default token renderer prototypes.
%
% \pkg{fancyvrb}
%
@@ -1804,6 +1817,33 @@ Lua options control the conversion from markdown to \TeX{}. They are supported
by all interfaces of the Markdown package starting with the low-level Lua
interfaces and all the way up to the \LaTeX{} and \Hologo{ConTeXt} interfaces.
+%</manual-options>
+%<*tex>
+% \fi
+% \begin{markdown}
+%
+% To enable the enumeration of Lua options, we will maintain the
+% \mdef{g_\@\@_lua_options_seq} sequence.
+%
+% \end{markdown}
+% \begin{macrocode}
+\ExplSyntaxOn
+\seq_new:N \g_@@_lua_options_seq
+% \end{macrocode}
+% \begin{markdown}
+%
+% To enable the reflection of default Lua options and their types, we will
+% maintain the \mdef{g_\@\@_default_lua_options_prop} and
+% \mdef{g_\@\@_lua_option_types_prop} property lists, respectively.
+%
+% \end{markdown}
+% \begin{macrocode}
+\prop_new:N \g_@@_lua_option_types_prop
+\prop_new:N \g_@@_default_lua_options_prop
+% \end{macrocode}
+% \iffalse
+%</tex>
+%<*manual-options>
% \fi
% \begin{markdown}
%
@@ -1953,6 +1993,23 @@ Markdown package will also be produced as we requested using the `cacheDir`
option.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { cacheDir }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { cacheDir }
+ { string }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { cacheDir }
+ { . }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -2171,6 +2228,23 @@ without accessing the shell or invoking Lua, but the change in the content of
the markdown document from “Hello *world*!” to “Hi *world*!” was not reflected.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { frozenCacheFileName }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { frozenCacheFileName }
+ { string }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { frozenCacheFileName }
+ { frozenCache.tex }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -2385,6 +2459,23 @@ following text:
> A paragraph > Not a quote.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { blankBeforeBlockquote }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { blankBeforeBlockquote }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { blankBeforeBlockquote }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -2624,6 +2715,23 @@ following text:
> A paragraph. ``` Not a code fence. ```
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { blankBeforeCodeFence }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { blankBeforeCodeFence }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { blankBeforeCodeFence }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -2846,6 +2954,23 @@ following text:
> A paragraph. Not a heading. ==============
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { blankBeforeHeading }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { blankBeforeHeading }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { blankBeforeHeading }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3060,6 +3185,23 @@ following text:
> > Another block quote.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { breakableBlockquotes }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { breakableBlockquotes }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { breakableBlockquotes }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3144,6 +3286,23 @@ following text, where the middot (`·`) denotes a non-breaking space:
> Addison-Wesley, 1984.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { citationNbsps }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { citationNbsps }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { citationNbsps }
+ { true }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3235,6 +3394,23 @@ following text:
> Addison-Wesley, 1984.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { citations }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { citations }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { citations }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3443,6 +3619,23 @@ following text:
> “This is a quote.” “This is another quote.”
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { codeSpans }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { codeSpans }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { codeSpans }
+ { true }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3607,6 +3800,23 @@ following text:
> This is a *transcluded markdown document*.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { contentBlocks }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { contentBlocks }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { contentBlocks }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3757,6 +3967,23 @@ following text:
> This is a *transcluded markdown document*.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { contentBlocksLanguageMap }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { contentBlocksLanguageMap }
+ { string }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { contentBlocksLanguageMap }
+ { markdown-languages.json }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3886,6 +4113,23 @@ following text:
> Third paragraph of definition 2.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { definitionLists }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { definitionLists }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { definitionLists }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3907,24 +4151,24 @@ defaultOptions.definitionLists = false
%
: true
- Converted markdown documents will be cached in \Opt{cacheDir}. This can be
- useful for post-processing the converted documents and for recovering
- historical versions of the documents from the cache. However, it also
- produces a large number of auxiliary files on the disk and obscures the
- output of the Lua command-line interface when it is used for plumbing.
+ : Converted markdown documents will be cached in \Opt{cacheDir}. This can be
+ useful for post-processing the converted documents and for recovering
+ historical versions of the documents from the cache. However, it also
+ produces a large number of auxiliary files on the disk and obscures the
+ output of the Lua command-line interface when it is used for plumbing.
- This behavior will always be used if the \Opt{finalizeCache} option is
- enabled.
+ This behavior will always be used if the \Opt{finalizeCache} option is
+ enabled.
: false
- Converted markdown documents will not be cached. This decreases the number
- of auxiliary files that we produce and makes it easier to use the Lua
- command-line interface for plumbing.
+ : Converted markdown documents will not be cached. This decreases the number
+ of auxiliary files that we produce and makes it easier to use the Lua
+ command-line interface for plumbing.
- This behavior will only be used when the \Opt{finalizeCache} option is
- disabled. Furthermore, this behavior is planned to be the new default in
- the next major release of the Markdown package.
+ This behavior will only be used when the \Opt{finalizeCache} option is
+ disabled. Furthermore, this behavior is planned to be the new default in
+ the next major release of the Markdown package.
% \end{markdown}
% \iffalse
@@ -3977,6 +4221,23 @@ Hello \markdownRendererEmphasis{world}!\relax
```
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { eagerCache }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { eagerCache }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { eagerCache }
+ { true }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3987,6 +4248,141 @@ defaultOptions.eagerCache = true
%</lua,lua-cli>
%<*manual-options>
+#### Option `expectJekyllData`
+
+`expectJekyllData` (default value: `false`)
+
+% \fi
+% \markdownBegin
+%
+% \Optitem[false]{expectJekyllData}{\opt{true}, \opt{false}}
+%
+: false
+
+ : When the \Opt{jekyllData} option is enabled, then a markdown document
+ may begin with \acro{yaml} metadata if and only if the metadata begin
+ with the end-of-directives marker (`---`) and they end with either the
+ end-of-directives or the end-of-document marker (`...`):
+
+ ~~~~~ latex
+ \documentclass{article}
+ \usepackage[jekyllData]{markdown}
+ \begin{document}
+ \begin{markdown}
+ ---
+ - this
+ - is
+ - YAML
+ ...
+ - followed
+ - by
+ - Markdown
+ \end{markdown}
+ \begin{markdown}
+ - this
+ - is
+ - Markdown
+ \end{markdown}
+ \end{document}
+ ~~~~~~~~~~~
+
+: true
+
+ : When the \Opt{jekyllData} option is enabled, then a markdown document may
+ begin directly with \acro{yaml} metadata and may contain nothing but
+ \acro{yaml} metadata.
+
+ ~~~~~ latex
+ \documentclass{article}
+ \usepackage[jekyllData, expectJekyllData]{markdown}
+ \begin{document}
+ \begin{markdown}
+ - this
+ - is
+ - YAML
+ ...
+ - followed
+ - by
+ - Markdown
+ \end{markdown}
+ \begin{markdown}
+ - this
+ - is
+ - YAML
+ \end{markdown}
+ \end{document}
+ ~~~~~~~~~~~
+
+% \markdownEnd
+% \iffalse
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `jane-doe.yml` with the
+following content:
+``` yaml
+name: Jane Doe
+age: 99
+```
+Using a text editor, create also a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage[jekyllData]{markdown}
+\ExplSyntaxOn
+\keys_define:nn
+ { markdown/jekyllData }
+ {
+ name .code:n = { \gdef\name{#1} },
+ age .code:n = { \gdef\age{#1} },
+ }
+\ExplSyntaxOff
+\markdownSetup{
+ renderers = {
+ jekyllDataEnd = {\name{} is \age{} years old.},
+ }
+}
+\begin{document}
+\markdownInput[expectJekyllData]{jane-doe.yml}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Jane Doe is 99 years old.
+
+%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { expectJekyllData }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { expectJekyllData }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { expectJekyllData }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
+%<*lua,lua-cli>
+% \fi
+% \begin{macrocode}
+defaultOptions.expectJekyllData = false
+% \end{macrocode}
+% \par
+% \iffalse
+%</lua,lua-cli>
+%<*manual-options>
+
#### Option `fencedCode`
`fencedCode` (default value: `false`)
@@ -4135,6 +4531,23 @@ following text:
> ```
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { fencedCode }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { fencedCode }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { fencedCode }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4289,6 +4702,23 @@ without accessing the shell or invoking Lua, but the change in the content of
the markdown document from “Hello *world*!” to “Hi *world*!” was not reflected.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { finalizeCache }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { finalizeCache }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { finalizeCache }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4448,6 +4878,23 @@ following text:
> isn't indented.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { footnotes }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { footnotes }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { footnotes }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4503,6 +4950,23 @@ A PDF document named `document.pdf` should be produced and contain the text
requested using the `frozenCacheCounter` option.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { frozenCacheCounter }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { frozenCacheCounter }
+ { counter }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { frozenCacheCounter }
+ { 0 }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4577,6 +5041,23 @@ following text:
> And the mome raths outgrabe.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { hardLineBreaks }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { hardLineBreaks }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { hardLineBreaks }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4698,6 +5179,23 @@ following text:
> #. Parish
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { hashEnumerators }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { hashEnumerators }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { hashEnumerators }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4743,6 +5241,23 @@ defaultOptions.hashEnumerators = false
% \end{markdown}
% \iffalse
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { headerAttributes }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { headerAttributes }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { headerAttributes }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4995,6 +5510,23 @@ following text:
> There is support. There is support. There is support.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { html }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { html }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { html }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -5196,6 +5728,23 @@ following text:
> √-̅1̅ *equals* $i$.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { hybrid }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { hybrid }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { hybrid }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -5285,6 +5834,23 @@ following text:
> move down to type the note.]
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { inlineFootnotes }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { inlineFootnotes }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { inlineFootnotes }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -5338,8 +5904,14 @@ following content:
``` tex
\input markdown
\def\markdownOptionJekyllData{true}
-\def\markdownRendererJekyllDataString#1#2{\gdef\name{#2}}
-\def\markdownRendererJekyllDataNumber#1#2{\gdef\age{#2}}
+\ExplSyntaxOn
+\keys_define:nn
+ { markdown/jekyllData }
+ {
+ name .code:n = { \gdef\name{#1} },
+ age .code:n = { \gdef\age{#1} },
+ }
+\ExplSyntaxOff
\def\markdownRendererJekyllDataEnd{%
\name{} is \age{} years old.}
\markdownBegin
@@ -5366,10 +5938,16 @@ following content:
``` tex
\documentclass{article}
\usepackage[jekyllData]{markdown}
+\ExplSyntaxOn
+\keys_define:nn
+ { markdown/jekyllData }
+ {
+ name .code:n = { \gdef\name{#1} },
+ age .code:n = { \gdef\age{#1} },
+ }
+\ExplSyntaxOff
\markdownSetup{
renderers = {
- jekyllDataString = {\gdef\name{#2}},
- jekyllDataNumber = {\gdef\age{#2}},
jekyllDataEnd = {\name{} is \age{} years old.},
}
}
@@ -5400,8 +5978,14 @@ following content:
``` tex
\usemodule[t][markdown]
\def\markdownOptionJekyllData{true}
-\def\markdownRendererJekyllDataString#1#2{\gdef\name{#2}}
-\def\markdownRendererJekyllDataNumber#1#2{\gdef\age{#2}}
+\ExplSyntaxOn
+\keys_define:nn
+ { markdown/jekyllData }
+ {
+ name .code:n = { \gdef\name{#1} },
+ age .code:n = { \gdef\age{#1} },
+ }
+\ExplSyntaxOff
\def\markdownRendererJekyllDataEnd{%
\name{} is \age{} years old.}
\starttext
@@ -5425,6 +6009,23 @@ following text:
> Jane Doe is 99 years old.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { jekyllData }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { jekyllData }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { jekyllData }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -5524,6 +6125,23 @@ following text:
> | 1 | 1 | 1 | 1 |
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { pipeTables }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { pipeTables }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { pipeTables }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -5554,6 +6172,23 @@ defaultOptions.pipeTables = false
% \end{markdown}
% \iffalse
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { preserveTabs }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { preserveTabs }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { preserveTabs }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -5633,6 +6268,23 @@ following text:
> with their grandchildren than get eaten. Begone, wolf!
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { relativeReferences }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { relativeReferences }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { relativeReferences }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -5768,6 +6420,23 @@ following text:
> ### A section
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { shiftHeadings }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { shiftHeadings }
+ { number }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { shiftHeadings }
+ { 0 }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -5976,6 +6645,23 @@ following text:
> Hamlet dies.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { slice }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { slice }
+ { string }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { slice }
+ { ^~$ }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -6173,6 +6859,23 @@ following text:
> . . . and this is a victorian ellipsis.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { smartEllipses }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { smartEllipses }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { smartEllipses }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -6299,6 +7002,23 @@ following text:
> 3. fifth item
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { startNumber }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { startNumber }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { startNumber }
+ { true }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -6402,6 +7122,23 @@ A PDF document named `document.pdf` should be produced and contain the
text “Hello *world*!”
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { stripIndent }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { stripIndent }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { stripIndent }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -6516,6 +7253,23 @@ following text:
> : Demonstration of pipe table syntax.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { tableCaptions }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { tableCaptions }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { tableCaptions }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -6616,6 +7370,23 @@ following text:
> - Yes I can!
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { taskLists }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { taskLists }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { taskLists }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -6665,7 +7436,7 @@ Using a text editor, create a text document named `document.tex` with the
following content:
``` tex
\input markdown
-\def\markdownOptionTeXComments{true}
+\def\markdownOptionTexComments{true}
\markdownBegin
Hel% this is a comment
lo *world*!
@@ -6706,7 +7477,7 @@ Using a text editor, create a text document named `document.tex` with the
following content:
``` tex
\usemodule[t][markdown]
-\def\markdownOptionTeXComments{true}
+\def\markdownOptionTexComments{true}
\starttext
\startmarkdown
Hel% this is a comment
@@ -6722,6 +7493,23 @@ A PDF document named `document.pdf` should be produced and contain the
text “Hello *world*!”
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { texComments }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { texComments }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { texComments }
+ { false }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -6744,17 +7532,27 @@ defaultOptions.texComments = false
%
: true
- : Lists whose bullets do not consist of multiple paragraphs will be
- passed to the
- \mref{markdownRendererOlBeginTight}, \mref{markdownRendererOlEndTight},
- \mref{markdownRendererUlBeginTight}, \mref{markdownRendererUlEndTight},
- \mref{markdownRendererDlBeginTight}, and
- \mref{markdownRendererDlEndTight} \TeX{} macros.
+ : Unordered and ordered Lists whose items do not consist of multiple
+ paragraphs will be considered *tight*. Tight lists will produce tight
+ renderers that may produce different output than lists that are not
+ tight:
+
+ ``` md
+ - This is
+ - a tight
+ - unordered list.
+
+ - This is
+
+ not a tight
+
+ - unordered list.
+ ```
: false
- : Lists whose bullets do not consist of multiple paragraphs will be
- treated the same way as lists that do consist of multiple paragraphs.
+ : Unordered and ordered lists whose items consist of multiple paragraphs
+ will be treated the same way as lists that consist of multiple paragraphs.
% \end{markdown}
% \iffalse
@@ -6824,6 +7622,23 @@ following text:
> - third item
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { tightLists }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { tightLists }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { tightLists }
+ { true }
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -6956,6 +7771,24 @@ following text:
> This is _emphasized text_ and this is a math subscript: *mₙ*.
%</manual-options>
+%<*tex>
+% \fi
+% \begin{macrocode}
+\seq_put_right:Nn
+ \g_@@_lua_options_seq
+ { underscores }
+\prop_put:Nnn
+ \g_@@_lua_option_types_prop
+ { underscores }
+ { boolean }
+\prop_put:Nnn
+ \g_@@_default_lua_options_prop
+ { underscores }
+ { true }
+\ExplSyntaxOff
+% \end{macrocode}
+% \iffalse
+%</tex>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -7239,8 +8072,8 @@ pdftex --shell-escape document.tex
%
% \end{markdown}
% \begin{macrocode}
-\def\markdownLastModified{$(LAST_MODIFIED)}%
-\def\markdownVersion{$(VERSION)}%
+\def\markdownLastModified{(((LASTMODIFIED)))}%
+\def\markdownVersion{(((VERSION)))}%
% \end{macrocode}
% \par
% \begin{markdown}
@@ -7645,7 +8478,7 @@ bug](https://github.com/witiko/markdown/issues).
\let\markdownOptionStripIndent\undefined
\let\markdownOptionTableCaptions\undefined
\let\markdownOptionTaskLists\undefined
-\let\markdownOptionTeXComments\undefined
+\let\markdownOptionTexComments\undefined
\let\markdownOptionTightLists\undefined
% \end{macrocode}
% \par
@@ -7656,7 +8489,7 @@ bug](https://github.com/witiko/markdown/issues).
#### Package Documentation
The \mdef{markdownOptionStripPercentSigns} macro controls whether a percent
-sign (`%`) at the beginning of a line will be discarded when reading Markdown
+sign (`\%`) at the beginning of a line will be discarded when reading Markdown
input from a \TeX{} document. This enables the use of markdown when writing
\TeX{} package documentation using the [Doc \LaTeX{} package][doc] by Frank
Mittelbach. The recognized values of the macro are `true` (discard) and `false`
@@ -7696,7 +8529,7 @@ A PDF document named `document.pdf` should be produced and contain the text
%#### Miscellaneous Options
%
% The \mdef{markdownOptionStripPercentSigns} macro controls whether a percent
-% sign (`%`) at the beginning of a line will be discarded when buffering
+% sign (`\%`) at the beginning of a line will be discarded when buffering
% Markdown input (see Section <#sec:buffering>) or not. Notably, this
% enables the use of markdown when writing \TeX{} package documentation using
% the \pkg{Doc} \LaTeX{}~package~[@mittelbach17] or similar. The recognized
@@ -7738,6 +8571,38 @@ In this section, I will describe the individual token renderers.
% macros are intended to be redefined by the user who is typesetting a
% document. By default, they point to the corresponding prototypes (see Section
% <#sec:texrendererprototypes>).
+%
+% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+% \begin{markdown}
+%
+% To enable the enumeration of token renderers, we will maintain the
+% \mdef{g_\@\@_renderers_seq} sequence.
+%
+% \end{markdown}
+% \begin{macrocode}
+\ExplSyntaxOn
+\seq_new:N \g_@@_renderers_seq
+% \end{macrocode}
+% \begin{markdown}
+%
+% To enable the reflection of token renderers and their parameters, we will
+% maintain the \mdef{g_\@\@_renderer_arities_prop} property list.
+%
+% \end{markdown}
+% \begin{macrocode}
+\prop_new:N \g_@@_renderer_arities_prop
+\ExplSyntaxOff
+% \end{macrocode}
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
+% \begin{markdown}
#### Tickbox Renderers
The macros named \mdef{markdownRendererTickedBox},
@@ -7814,10 +8679,37 @@ following text:
% \begin{macrocode}
\def\markdownRendererTickedBox{%
\markdownRendererTickedBoxPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { tickedBox }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { tickedBox }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererHalfTickedBox{%
\markdownRendererHalfTickedBoxPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { halfTickedBox }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { halfTickedBox }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererUntickedBox{%
\markdownRendererUntickedBoxPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { untickedBox }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { untickedBox }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -7951,8 +8843,26 @@ following text:
% \begin{macrocode}
\def\markdownRendererDocumentBegin{%
\markdownRendererDocumentBeginPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { documentBegin }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { documentBegin }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererDocumentEnd{%
\markdownRendererDocumentEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { documentEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { documentEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -8078,6 +8988,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererInterblockSeparator{%
\markdownRendererInterblockSeparatorPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { interblockSeparator }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { interblockSeparator }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -8215,6 +9134,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererLineBreak{%
\markdownRendererLineBreakPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { lineBreak }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { lineBreak }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -8317,6 +9245,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererEllipsis{%
\markdownRendererEllipsisPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { ellipsis }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { ellipsis }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -8393,6 +9330,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererNbsp{%
\markdownRendererNbspPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { nbsp }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { nbsp }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -8509,26 +9455,125 @@ following text, where the middot (`·`) denotes a non-breaking space:
% \begin{macrocode}
\def\markdownRendererLeftBrace{%
\markdownRendererLeftBracePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { leftBrace }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { leftBrace }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererRightBrace{%
\markdownRendererRightBracePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { rightBrace }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { rightBrace }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererDollarSign{%
\markdownRendererDollarSignPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { dollarSign }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { dollarSign }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererPercentSign{%
\markdownRendererPercentSignPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { percentSign }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { percentSign }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererAmpersand{%
\markdownRendererAmpersandPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { ampersand }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { ampersand }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererUnderscore{%
\markdownRendererUnderscorePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { underscore }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { underscore }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererHash{%
\markdownRendererHashPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { hash }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { hash }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererCircumflex{%
\markdownRendererCircumflexPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { circumflex }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { circumflex }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererBackslash{%
\markdownRendererBackslashPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { backslash }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { backslash }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererTilde{%
\markdownRendererTildePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { tilde }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { tilde }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererPipe{%
\markdownRendererPipePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { pipe }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { pipe }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -8665,6 +9710,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererCodeSpan{%
\markdownRendererCodeSpanPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { codeSpan }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { codeSpan }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -8780,6 +9834,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererLink{%
\markdownRendererLinkPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { link }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { link }
+ { 4 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -8861,6 +9924,15 @@ that the \TeX{} engine has shell access.
% \begin{macrocode}
\def\markdownRendererImage{%
\markdownRendererImagePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { image }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { image }
+ { 4 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -8889,6 +9961,15 @@ and the title of the content block.
% \begin{macrocode}
\def\markdownRendererContentBlock{%
\markdownRendererContentBlockPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { contentBlock }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { contentBlock }
+ { 4 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -8913,6 +9994,15 @@ as \mref{markdownRendererContentBlock}.
% \begin{macrocode}
\def\markdownRendererContentBlockOnlineImage{%
\markdownRendererContentBlockOnlineImagePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { contentBlockOnlineImage }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { contentBlockOnlineImage }
+ { 4 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9099,6 +10189,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererContentBlockCode{%
\markdownRendererContentBlockCodePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { contentBlockCode }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { contentBlockCode }
+ { 5 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9124,6 +10223,15 @@ list is not tight). The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererUlBegin{%
\markdownRendererUlBeginPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { ulBegin }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { ulBegin }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9149,6 +10257,15 @@ is `false`. The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererUlBeginTight{%
\markdownRendererUlBeginTightPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { ulBeginTight }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { ulBeginTight }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9172,6 +10289,15 @@ list. The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererUlItem{%
\markdownRendererUlItemPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { ulItem }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { ulItem }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9195,6 +10321,15 @@ bulleted list. The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererUlItemEnd{%
\markdownRendererUlItemEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { ulItemEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { ulItemEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9219,6 +10354,15 @@ tight). The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererUlEnd{%
\markdownRendererUlEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { ulEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { ulEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9446,6 +10590,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererUlEndTight{%
\markdownRendererUlEndTightPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { ulEndTight }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { ulEndTight }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9471,6 +10624,15 @@ list is not tight). The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererOlBegin{%
\markdownRendererOlBeginPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { olBegin }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { olBegin }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9496,6 +10658,15 @@ option is `false`. The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererOlBeginTight{%
\markdownRendererOlBeginTightPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { olBeginTight }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { olBeginTight }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9520,6 +10691,15 @@ This macro will only be produced, when the \Opt{startNumber} option is
% \begin{macrocode}
\def\markdownRendererOlItem{%
\markdownRendererOlItemPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { olItem }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { olItem }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9543,6 +10723,15 @@ an ordered list. The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererOlItemEnd{%
\markdownRendererOlItemEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { olItemEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { olItemEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9568,6 +10757,15 @@ corresponds to the item number.
% \begin{macrocode}
\def\markdownRendererOlItemWithNumber{%
\markdownRendererOlItemWithNumberPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { olItemWithNumber }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { olItemWithNumber }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9592,6 +10790,15 @@ tight). The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererOlEnd{%
\markdownRendererOlEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { olEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { olEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9871,6 +11078,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererOlEndTight{%
\markdownRendererOlEndTightPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { olEndTight }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { olEndTight }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9899,6 +11115,15 @@ list is not tight). The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererDlBegin{%
\markdownRendererDlBeginPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { dlBegin }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { dlBegin }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9924,6 +11149,15 @@ list is not tight). This macro will only be produced, when the
% \begin{macrocode}
\def\markdownRendererDlBeginTight{%
\markdownRendererDlBeginTightPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { dlBeginTight }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { dlBeginTight }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9948,6 +11182,15 @@ being defined.
% \begin{macrocode}
\def\markdownRendererDlItem{%
\markdownRendererDlItemPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { dlItem }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { dlItem }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9971,6 +11214,15 @@ definitions for a single term.
% \begin{macrocode}
\def\markdownRendererDlItemEnd{%
\markdownRendererDlItemEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { dlItemEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { dlItemEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -9995,6 +11247,15 @@ a single term.
% \begin{macrocode}
\def\markdownRendererDlDefinitionBegin{%
\markdownRendererDlDefinitionBeginPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { dlDefinitionBegin }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { dlDefinitionBegin }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10019,6 +11280,15 @@ single term.
% \begin{macrocode}
\def\markdownRendererDlDefinitionEnd{%
\markdownRendererDlDefinitionEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { dlDefinitionEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { dlDefinitionEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10043,6 +11313,15 @@ tight). The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererDlEnd{%
\markdownRendererDlEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { dlEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { dlEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10400,6 +11679,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererDlEndTight{%
\markdownRendererDlEndTightPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { dlEndTight }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { dlEndTight }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10511,6 +11799,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererEmphasis{%
\markdownRendererEmphasisPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { emphasis }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { emphasis }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10535,6 +11832,15 @@ corresponds to the emphasized span of text.
% \begin{macrocode}
\def\markdownRendererStrongEmphasis{%
\markdownRendererStrongEmphasisPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { strongEmphasis }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { strongEmphasis }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10559,6 +11865,15 @@ a block quote. The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererBlockQuoteBegin{%
\markdownRendererBlockQuoteBeginPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { blockQuoteBegin }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { blockQuoteBegin }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10695,6 +12010,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererBlockQuoteEnd{%
\markdownRendererBlockQuoteEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { blockQuoteEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { blockQuoteEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10720,6 +12044,15 @@ filename of a file contaning the code block contents.
% \begin{macrocode}
\def\markdownRendererInputVerbatim{%
\markdownRendererInputVerbatimPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { inputVerbatim }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { inputVerbatim }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10827,6 +12160,15 @@ following text except for the filename, which may differ:
% \begin{macrocode}
\def\markdownRendererInputFencedCode{%
\markdownRendererInputFencedCodePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { inputFencedCode }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { inputFencedCode }
+ { 2 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10836,7 +12178,8 @@ following text except for the filename, which may differ:
% \fi
% \begin{markdown}
-#### YAML Metadata Renderers
+#### YAML Metadata Renderers {#yamlmetadatarenderers}
+
The \mdef{markdownRendererJekyllDataBegin} macro represents the beginning of a
\acro{yaml} document. This macro will only be produced when the \Opt{jekyllData}
option is enabled. The macro receives no arguments.
@@ -10851,6 +12194,15 @@ option is enabled. The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererJekyllDataBegin{%
\markdownRendererJekyllDataBeginPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { jekyllDataBegin }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { jekyllDataBegin }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10875,6 +12227,15 @@ The \mdef{markdownRendererJekyllDataEnd} macro represents the end of a
% \begin{macrocode}
\def\markdownRendererJekyllDataEnd{%
\markdownRendererJekyllDataEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { jekyllDataEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { jekyllDataEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10901,6 +12262,15 @@ arguments: the scalar key in the parent structure, cast to a string following
% \begin{macrocode}
\def\markdownRendererJekyllDataMappingBegin{%
\markdownRendererJekyllDataMappingBeginPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { jekyllDataMappingBegin }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { jekyllDataMappingBegin }
+ { 2 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10925,6 +12295,15 @@ when the \Opt{jekyllData} option is enabled. The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererJekyllDataMappingEnd{%
\markdownRendererJekyllDataMappingEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { jekyllDataMappingEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { jekyllDataMappingEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10951,6 +12330,15 @@ arguments: the scalar key in the parent structure, cast to a string following
% \begin{macrocode}
\def\markdownRendererJekyllDataSequenceBegin{%
\markdownRendererJekyllDataSequenceBeginPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { jekyllDataSequenceBegin }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { jekyllDataSequenceBegin }
+ { 2 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -10975,6 +12363,15 @@ when the \Opt{jekyllData} option is enabled. The macro receives no arguments.
% \begin{macrocode}
\def\markdownRendererJekyllDataSequenceEnd{%
\markdownRendererJekyllDataSequenceEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { jekyllDataSequenceEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { jekyllDataSequenceEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11001,6 +12398,15 @@ following \acro{yaml} serialization rules.
% \begin{macrocode}
\def\markdownRendererJekyllDataBoolean{%
\markdownRendererJekyllDataBooleanPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { jekyllDataBoolean }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { jekyllDataBoolean }
+ { 2 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11027,6 +12433,15 @@ following \acro{yaml} serialization rules.
% \begin{macrocode}
\def\markdownRendererJekyllDataNumber{%
\markdownRendererJekyllDataNumberPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { jekyllDataNumber }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { jekyllDataNumber }
+ { 2 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11053,6 +12468,15 @@ serialization rules, and the scalar value.
% \begin{macrocode}
\def\markdownRendererJekyllDataString{%
\markdownRendererJekyllDataStringPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { jekyllDataString }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { jekyllDataString }
+ { 2 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11069,6 +12493,10 @@ value in a \acro{yaml} document. This macro will only be produced when the
scalar key in the parent structure, cast to a string following \acro{yaml}
serialization rules.
+% See also Section <#sec:expl3yamlmetadata> for the description of the
+% high-level expl3 interface that you can also use to react to \acro{yaml}
+% metadata.
+%
% \end{markdown}
%
% \iffalse
@@ -11079,6 +12507,15 @@ serialization rules.
% \begin{macrocode}
\def\markdownRendererJekyllDataEmpty{%
\markdownRendererJekyllDataEmptyPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { jekyllDataEmpty }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { jekyllDataEmpty }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11197,6 +12634,15 @@ The macro receives a single argument that corresponds to the heading text.
% \begin{macrocode}
\def\markdownRendererHeadingOne{%
\markdownRendererHeadingOnePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { headingOne }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { headingOne }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11221,6 +12667,15 @@ text.
% \begin{macrocode}
\def\markdownRendererHeadingTwo{%
\markdownRendererHeadingTwoPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { headingTwo }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { headingTwo }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11245,6 +12700,15 @@ text.
% \begin{macrocode}
\def\markdownRendererHeadingThree{%
\markdownRendererHeadingThreePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { headingThree }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { headingThree }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11269,6 +12733,15 @@ text.
% \begin{macrocode}
\def\markdownRendererHeadingFour{%
\markdownRendererHeadingFourPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { headingFour }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { headingFour }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11293,6 +12766,15 @@ text.
% \begin{macrocode}
\def\markdownRendererHeadingFive{%
\markdownRendererHeadingFivePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { headingFive }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { headingFive }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11418,6 +12900,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererHeadingSix{%
\markdownRendererHeadingSixPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { headingSix }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { headingSix }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11537,6 +13028,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererHorizontalRule{%
\markdownRendererHorizontalRulePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { horizontalRule }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { horizontalRule }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11650,6 +13150,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererFootnote{%
\markdownRendererFootnotePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { footnote }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { footnote }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11738,6 +13247,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererCite{%
\markdownRendererCitePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { cite }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { cite }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11821,6 +13339,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererTextCite{%
\markdownRendererTextCitePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { textCite }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { textCite }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -11939,6 +13466,15 @@ following text:
% \begin{macrocode}
\def\markdownRendererTable{%
\markdownRendererTablePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { table }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { table }
+ { 3 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -12024,10 +13560,37 @@ The horizontal margins should contain the following text:
% \begin{macrocode}
\def\markdownRendererInlineHtmlComment{%
\markdownRendererInlineHtmlCommentPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { inlineHtmlComment }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { inlineHtmlComment }
+ { 1 }
+\ExplSyntaxOff
\def\markdownRendererBlockHtmlCommentBegin{%
\markdownRendererBlockHtmlCommentBeginPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { blockHtmlCommentBegin }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { blockHtmlCommentBegin }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererBlockHtmlCommentEnd{%
\markdownRendererBlockHtmlCommentEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { blockHtmlCommentEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { blockHtmlCommentEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -12096,8 +13659,26 @@ following body text:
% \begin{macrocode}
\def\markdownRendererInlineHtmlTag{%
\markdownRendererInlineHtmlTagPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { inlineHtmlTag }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { inlineHtmlTag }
+ { 1 }
+\ExplSyntaxOff
\def\markdownRendererInputBlockHtmlElement{%
\markdownRendererInputBlockHtmlElementPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { inputBlockHtmlElement }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { inputBlockHtmlElement }
+ { 1 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -12196,10 +13777,37 @@ following text:
% \begin{macrocode}
\def\markdownRendererAttributeIdentifier{%
\markdownRendererAttributeIdentifierPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { attributeIdentifier }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { attributeIdentifier }
+ { 1 }
+\ExplSyntaxOff
\def\markdownRendererAttributeClassName{%
\markdownRendererAttributeClassNamePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { attributeClassName }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { attributeClassName }
+ { 1 }
+\ExplSyntaxOff
\def\markdownRendererAttributeKeyValue{%
\markdownRendererAttributeKeyValuePrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { attributeKeyValue }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { attributeKeyValue }
+ { 2 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -12284,8 +13892,26 @@ following text:
% \begin{macrocode}
\def\markdownRendererHeaderAttributeContextBegin{%
\markdownRendererHeaderAttributeContextBeginPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { headerAttributeContextBegin }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { headerAttributeContextBegin }
+ { 0 }
+\ExplSyntaxOff
\def\markdownRendererHeaderAttributeContextEnd{%
\markdownRendererHeaderAttributeContextEndPrototype}%
+\ExplSyntaxOn
+\seq_put_right:Nn
+ \g_@@_renderers_seq
+ { headerAttributeContextEnd }
+\prop_put:Nnn
+ \g_@@_renderer_arities_prop
+ { headerAttributeContextEnd }
+ { 0 }
+\ExplSyntaxOff
% \end{macrocode}
% \par
%
@@ -12298,17 +13924,12 @@ following text:
### Token Renderer Prototypes {#texrendererprototypes}
-%
% \end{markdown}
% \iffalse
By default, token renderers point to package-defined \TeX{} macros, further
referred to as *prototypes*, which provide useful default definitions.
-% \fi
-%
-% \iffalse
-
##### Plain \TeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
@@ -12411,9 +14032,140 @@ following text:
>
> User-defined token renderers take precedence.
+% \fi
+%
+% \begin{markdown}
+
+#### YAML Metadata Renderer Prototypes {#expl3yamlmetadata}
+
+By default, the renderer prototypes for YAML metadata provide a high-level
+interface that can be programmed using the `markdown/jekyllData` key--values
+from the l3keys module of the \LaTeX3 kernel.
+
+% \end{markdown}
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownOptionJekyllData{true}
+\ExplSyntaxOn
+\keys_define:nn
+ { markdown/jekyllData }
+ {
+ name .code:n = { \gdef\name{#1} },
+ age .code:n = { \gdef\age{#1} },
+ }
+\ExplSyntaxOff
+\def\markdownRendererJekyllDataEnd{%
+ \name{} is \age{} years old.}
+\markdownBegin
+---
+name: Jane Doe
+age: 99
+---
+\markdownEnd
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Jane Doe is 99 years old.
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage[jekyllData]{markdown}
+\ExplSyntaxOn
+\keys_define:nn
+ { markdown/jekyllData }
+ {
+ name .code:n = { \gdef\name{#1} },
+ age .code:n = { \gdef\age{#1} },
+ }
+\ExplSyntaxOff
+\markdownSetup{
+ renderers = {
+ jekyllDataEnd = {\name{} is \age{} years old.},
+ }
+}
+\begin{document}
+
+\begin{markdown}
+---
+name: Jane Doe
+age: 99
+---
+\end{markdown}
+
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Jane Doe is 99 years old.
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownOptionJekyllData{true}
+\ExplSyntaxOn
+\keys_define:nn
+ { markdown/jekyllData }
+ {
+ name .code:n = { \gdef\name{#1} },
+ age .code:n = { \gdef\age{#1} },
+ }
+\ExplSyntaxOff
+\def\markdownRendererJekyllDataEnd{%
+ \name{} is \age{} years old.}
+\starttext
+
+\startmarkdown
+---
+name: Jane Doe
+age: 99
+---
+\stopmarkdown
+
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Jane Doe is 99 years old.
+
%</manual-tokens>
%<*tex>
% \fi
+% \begin{macrocode}
+\ExplSyntaxOn
+\keys_define:nn
+ { markdown/jekyllData }
+ { }
+\ExplSyntaxOff
+% \end{macrocode}
%
% \begin{markdown}
%
@@ -12481,16 +14233,8 @@ following text:
\def\markdownRendererBlockQuoteEndPrototype{}%
\def\markdownRendererInputVerbatimPrototype#1{}%
\def\markdownRendererInputFencedCodePrototype#1#2{}%
-\def\markdownRendererJekyllDataBooleanPrototype#1#2{}%
-\def\markdownRendererJekyllDataEmptyPrototype#1{}%
-\def\markdownRendererJekyllDataNumberPrototype#1#2{}%
-\def\markdownRendererJekyllDataStringPrototype#1#2{}%
\def\markdownRendererJekyllDataBeginPrototype{}%
\def\markdownRendererJekyllDataEndPrototype{}%
-\def\markdownRendererJekyllDataSequenceBeginPrototype#1#2{}%
-\def\markdownRendererJekyllDataSequenceEndPrototype{}%
-\def\markdownRendererJekyllDataMappingBeginPrototype#1#2{}%
-\def\markdownRendererJekyllDataMappingEndPrototype{}%
\def\markdownRendererHeadingOnePrototype#1{}%
\def\markdownRendererHeadingTwoPrototype#1{}%
\def\markdownRendererHeadingThreePrototype#1{}%
@@ -12791,21 +14535,33 @@ pdflatex --shell-escape document.tex
% \end{markdown}
% \begin{macrocode}
\newcommand\markdownSetupSnippet[2]{%
- \@ifundefined
- {markdownLaTeXSetupSnippet\markdownLaTeXThemeName#1}{%
- \newtoks\next
- \next={#2}%
- \expandafter\let\csname markdownLaTeXSetupSnippet%
- \markdownLaTeXThemeName#1\endcsname=\next
- }{%
+ \markdownIfSnippetExists{#1}%
+ {%
\markdownWarning
{Redefined setup snippet \markdownLaTeXThemeName#1}%
\csname markdownLaTeXSetupSnippet%
\markdownLaTeXThemeName#1\endcsname={#2}%
+ }{%
+ \newtoks\next
+ \next={#2}%
+ \expandafter\let\csname markdownLaTeXSetupSnippet%
+ \markdownLaTeXThemeName#1\endcsname=\next
}}%
% \end{macrocode}
% \begin{markdown}
%
+% To decide whether a setup snippet exists, we can use the
+% \mdef{markdownIfSnippetExists} macro:
+%
+% \end{markdown}
+% \begin{macrocode}
+\newcommand\markdownIfSnippetExists[3]{%
+ \@ifundefined
+ {markdownLaTeXSetupSnippet\markdownLaTeXThemeName#1}%
+ {#3}{#2}}%
+% \end{macrocode}
+% \begin{markdown}
+%
% See Section <#sec:latexthemes> for information on interactions between
% setup snippets and \LaTeX{} themes. See Section <#sec:latexsetupsnippets>
% for information about invoking the stored setup snippets.
@@ -13282,14 +15038,15 @@ various options locally.
% \fi
% \begin{macrocode}
\define@key{markdownOptions}{snippet}{%
- \@ifundefined
- {markdownLaTeXSetupSnippet#1}{%
+ \markdownIfSnippetExists{#1}%
+ {%
+ \expandafter\markdownSetup\expandafter{%
+ \the\csname markdownLaTeXSetupSnippet%
+ \markdownLaTeXThemeName#1\endcsname}%
+ }{%
\markdownError
{Can't invoke setup snippet #1}%
{The setup snippet is undefined}%
- }{%
- \expandafter\markdownSetup\expandafter{%
- \the\csname markdownLaTeXSetupSnippet#1\endcsname}%
}%
}%
% \end{macrocode}
@@ -13373,6 +15130,8 @@ The following ordered list will be preceded by roman numerals:
\def\markdownOptionDefinitionLists{#1}}%
\define@key{markdownOptions}{eagerCache}[true]{%
\def\markdownOptionEagerCache{#1}}%
+\define@key{markdownOptions}{expectJekyllData}[true]{%
+ \def\markdownOptionExpectJekyllData{#1}}%
\define@key{markdownOptions}{footnotes}[true]{%
\def\markdownOptionFootnotes{#1}}%
\define@key{markdownOptions}{fencedCode}[true]{%
@@ -13412,7 +15171,7 @@ The following ordered list will be preceded by roman numerals:
\define@key{markdownOptions}{taskLists}[true]{%
\def\markdownOptionTaskLists{#1}}%
\define@key{markdownOptions}{texComments}[true]{%
- \def\markdownOptionTeXComments{#1}}%
+ \def\markdownOptionTexComments{#1}}%
\define@key{markdownOptions}{tightLists}[true]{%
\def\markdownOptionTightLists{#1}}%
\define@key{markdownOptions}{underscores}[true]{%
@@ -13480,174 +15239,52 @@ The following ordered list will be preceded by roman numerals:
%
% \end{markdown}
% \begin{macrocode}
-\define@key{markdownRenderers}{attributeIdentifier}{%
- \renewcommand\markdownRendererAttributeIdentifier[1]{#1}}%
-\define@key{markdownRenderers}{attributeClassName}{%
- \renewcommand\markdownRendererAttributeClassName[1]{#1}}%
-\define@key{markdownRenderers}{attributeKeyValue}{%
- \renewcommand\markdownRendererAttributeKeyValue[2]{#1}}%
-\define@key{markdownRenderers}{documentBegin}{%
- \renewcommand\markdownRendererDocumentBegin{#1}}%
-\define@key{markdownRenderers}{documentEnd}{%
- \renewcommand\markdownRendererDocumentEnd{#1}}%
-\define@key{markdownRenderers}{interblockSeparator}{%
- \renewcommand\markdownRendererInterblockSeparator{#1}}%
-\define@key{markdownRenderers}{lineBreak}{%
- \renewcommand\markdownRendererLineBreak{#1}}%
-\define@key{markdownRenderers}{ellipsis}{%
- \renewcommand\markdownRendererEllipsis{#1}}%
-\define@key{markdownRenderers}{headerAttributeContextBegin}{%
- \renewcommand\markdownRendererHeaderAttributeContextBegin{#1}}%
-\define@key{markdownRenderers}{headerAttributeContextEnd}{%
- \renewcommand\markdownRendererHeaderAttributeContextEnd{#1}}%
-\define@key{markdownRenderers}{nbsp}{%
- \renewcommand\markdownRendererNbsp{#1}}%
-\define@key{markdownRenderers}{leftBrace}{%
- \renewcommand\markdownRendererLeftBrace{#1}}%
-\define@key{markdownRenderers}{rightBrace}{%
- \renewcommand\markdownRendererRightBrace{#1}}%
-\define@key{markdownRenderers}{dollarSign}{%
- \renewcommand\markdownRendererDollarSign{#1}}%
-\define@key{markdownRenderers}{percentSign}{%
- \renewcommand\markdownRendererPercentSign{#1}}%
-\define@key{markdownRenderers}{ampersand}{%
- \renewcommand\markdownRendererAmpersand{#1}}%
-\define@key{markdownRenderers}{underscore}{%
- \renewcommand\markdownRendererUnderscore{#1}}%
-\define@key{markdownRenderers}{hash}{%
- \renewcommand\markdownRendererHash{#1}}%
-\define@key{markdownRenderers}{circumflex}{%
- \renewcommand\markdownRendererCircumflex{#1}}%
-\define@key{markdownRenderers}{backslash}{%
- \renewcommand\markdownRendererBackslash{#1}}%
-\define@key{markdownRenderers}{tilde}{%
- \renewcommand\markdownRendererTilde{#1}}%
-\define@key{markdownRenderers}{pipe}{%
- \renewcommand\markdownRendererPipe{#1}}%
-\define@key{markdownRenderers}{codeSpan}{%
- \renewcommand\markdownRendererCodeSpan[1]{#1}}%
-\define@key{markdownRenderers}{link}{%
- \renewcommand\markdownRendererLink[4]{#1}}%
-\define@key{markdownRenderers}{contentBlock}{%
- \renewcommand\markdownRendererContentBlock[4]{#1}}%
-\define@key{markdownRenderers}{contentBlockOnlineImage}{%
- \renewcommand\markdownRendererContentBlockOnlineImage[4]{#1}}%
-\define@key{markdownRenderers}{contentBlockCode}{%
- \renewcommand\markdownRendererContentBlockCode[5]{#1}}%
-\define@key{markdownRenderers}{image}{%
- \renewcommand\markdownRendererImage[4]{#1}}%
-\define@key{markdownRenderers}{ulBegin}{%
- \renewcommand\markdownRendererUlBegin{#1}}%
-\define@key{markdownRenderers}{ulBeginTight}{%
- \renewcommand\markdownRendererUlBeginTight{#1}}%
-\define@key{markdownRenderers}{ulItem}{%
- \renewcommand\markdownRendererUlItem{#1}}%
-\define@key{markdownRenderers}{ulItemEnd}{%
- \renewcommand\markdownRendererUlItemEnd{#1}}%
-\define@key{markdownRenderers}{ulEnd}{%
- \renewcommand\markdownRendererUlEnd{#1}}%
-\define@key{markdownRenderers}{ulEndTight}{%
- \renewcommand\markdownRendererUlEndTight{#1}}%
-\define@key{markdownRenderers}{olBegin}{%
- \renewcommand\markdownRendererOlBegin{#1}}%
-\define@key{markdownRenderers}{olBeginTight}{%
- \renewcommand\markdownRendererOlBeginTight{#1}}%
-\define@key{markdownRenderers}{olItem}{%
- \renewcommand\markdownRendererOlItem{#1}}%
-\define@key{markdownRenderers}{olItemWithNumber}{%
- \renewcommand\markdownRendererOlItemWithNumber[1]{#1}}%
-\define@key{markdownRenderers}{olItemEnd}{%
- \renewcommand\markdownRendererOlItemEnd{#1}}%
-\define@key{markdownRenderers}{olEnd}{%
- \renewcommand\markdownRendererOlEnd{#1}}%
-\define@key{markdownRenderers}{olEndTight}{%
- \renewcommand\markdownRendererOlEndTight{#1}}%
-\define@key{markdownRenderers}{dlBegin}{%
- \renewcommand\markdownRendererDlBegin{#1}}%
-\define@key{markdownRenderers}{dlBeginTight}{%
- \renewcommand\markdownRendererDlBeginTight{#1}}%
-\define@key{markdownRenderers}{dlItem}{%
- \renewcommand\markdownRendererDlItem[1]{#1}}%
-\define@key{markdownRenderers}{dlItemEnd}{%
- \renewcommand\markdownRendererDlItemEnd{#1}}%
-\define@key{markdownRenderers}{dlDefinitionBegin}{%
- \renewcommand\markdownRendererDlDefinitionBegin{#1}}%
-\define@key{markdownRenderers}{dlDefinitionEnd}{%
- \renewcommand\markdownRendererDlDefinitionEnd{#1}}%
-\define@key{markdownRenderers}{dlEnd}{%
- \renewcommand\markdownRendererDlEnd{#1}}%
-\define@key{markdownRenderers}{dlEndTight}{%
- \renewcommand\markdownRendererDlEndTight{#1}}%
-\define@key{markdownRenderers}{emphasis}{%
- \renewcommand\markdownRendererEmphasis[1]{#1}}%
-\define@key{markdownRenderers}{strongEmphasis}{%
- \renewcommand\markdownRendererStrongEmphasis[1]{#1}}%
-\define@key{markdownRenderers}{blockQuoteBegin}{%
- \renewcommand\markdownRendererBlockQuoteBegin{#1}}%
-\define@key{markdownRenderers}{blockQuoteEnd}{%
- \renewcommand\markdownRendererBlockQuoteEnd{#1}}%
-\define@key{markdownRenderers}{inputVerbatim}{%
- \renewcommand\markdownRendererInputVerbatim[1]{#1}}%
-\define@key{markdownRenderers}{inputFencedCode}{%
- \renewcommand\markdownRendererInputFencedCode[2]{#1}}%
-\define@key{markdownRenderers}{jekyllDataBoolean}{%
- \renewcommand\markdownRendererJekyllDataBoolean[2]{#1}}%
-\define@key{markdownRenderers}{jekyllDataEmpty}{%
- \renewcommand\markdownRendererJekyllDataEmpty[1]{#1}}%
-\define@key{markdownRenderers}{jekyllDataNumber}{%
- \renewcommand\markdownRendererJekyllDataNumber[2]{#1}}%
-\define@key{markdownRenderers}{jekyllDataString}{%
- \renewcommand\markdownRendererJekyllDataString[2]{#1}}%
-\define@key{markdownRenderers}{jekyllDataBegin}{%
- \renewcommand\markdownRendererJekyllDataBegin{#1}}%
-\define@key{markdownRenderers}{jekyllDataEnd}{%
- \renewcommand\markdownRendererJekyllDataEnd{#1}}%
-\define@key{markdownRenderers}{jekyllDataSequenceBegin}{%
- \renewcommand\markdownRendererJekyllDataSequenceBegin[2]{#1}}%
-\define@key{markdownRenderers}{jekyllDataSequenceEnd}{%
- \renewcommand\markdownRendererJekyllDataSequenceEnd{#1}}%
-\define@key{markdownRenderers}{jekyllDataMappingBegin}{%
- \renewcommand\markdownRendererJekyllDataMappingBegin[2]{#1}}%
-\define@key{markdownRenderers}{jekyllDataMappingEnd}{%
- \renewcommand\markdownRendererJekyllDataMappingEnd{#1}}%
-\define@key{markdownRenderers}{headingOne}{%
- \renewcommand\markdownRendererHeadingOne[1]{#1}}%
-\define@key{markdownRenderers}{headingTwo}{%
- \renewcommand\markdownRendererHeadingTwo[1]{#1}}%
-\define@key{markdownRenderers}{headingThree}{%
- \renewcommand\markdownRendererHeadingThree[1]{#1}}%
-\define@key{markdownRenderers}{headingFour}{%
- \renewcommand\markdownRendererHeadingFour[1]{#1}}%
-\define@key{markdownRenderers}{headingFive}{%
- \renewcommand\markdownRendererHeadingFive[1]{#1}}%
-\define@key{markdownRenderers}{headingSix}{%
- \renewcommand\markdownRendererHeadingSix[1]{#1}}%
-\define@key{markdownRenderers}{horizontalRule}{%
- \renewcommand\markdownRendererHorizontalRule{#1}}%
-\define@key{markdownRenderers}{footnote}{%
- \renewcommand\markdownRendererFootnote[1]{#1}}%
-\define@key{markdownRenderers}{cite}{%
- \renewcommand\markdownRendererCite[1]{#1}}%
-\define@key{markdownRenderers}{textCite}{%
- \renewcommand\markdownRendererTextCite[1]{#1}}%
-\define@key{markdownRenderers}{table}{%
- \renewcommand\markdownRendererTable[3]{#1}}%
-\define@key{markdownRenderers}{inlineHtmlComment}{%
- \renewcommand\markdownRendererInlineHtmlComment[1]{#1}}%
-\define@key{markdownRenderers}{blockHtmlCommentBegin}{%
- \renewcommand\markdownRendererBlockHtmlCommentBegin{#1}}%
-\define@key{markdownRenderers}{blockHtmlCommentEnd}{%
- \renewcommand\markdownRendererBlockHtmlCommentEnd{#1}}%
-\define@key{markdownRenderers}{inlineHtmlTag}{%
- \renewcommand\markdownRendererInlineHtmlTag[1]{#1}}%
-\define@key{markdownRenderers}{inputBlockHtmlElement}{%
- \renewcommand\markdownRendererInputBlockHtmlElement[1]{#1}}%
-\define@key{markdownRenderers}{tickedBox}{%
- \renewcommand\markdownRendererTickedBox{#1}}%
-\define@key{markdownRenderers}{halfTickedBox}{%
- \renewcommand\markdownRendererHalfTickedBox{#1}}%
-\define@key{markdownRenderers}{untickedBox}{%
- \renewcommand\markdownRendererUntickedBox{#1}}%
+\ExplSyntaxOn
+\cs_new:Nn \@@_latex_define_renderers:
+ {
+ \seq_map_function:NN
+ \g_@@_renderers_seq
+ \@@_latex_define_renderer:n
+ }
+\cs_new:Nn \@@_latex_define_renderer:n
+ {
+ \tl_set:Nn
+ \l_tmpb_tl
+% TODO: Replace with \str_uppercase:n in TeX Live 2020.
+ { \str_upper_case:n { #1 } }
+ \tl_set:Nx
+ \l_tmpa_tl
+ {
+ markdownRenderer
+ \tl_head:f { \l_tmpb_tl }
+ \tl_tail:n { #1 }
+ }
+ \prop_get:NnN
+ \g_@@_renderer_arities_prop
+ { #1 }
+ \l_tmpb_tl
+ \@@_latex_define_renderer:ncV
+ { #1 }
+ { \l_tmpa_tl }
+ \l_tmpb_tl
+ }
+\cs_new:Nn \@@_latex_define_renderer:nNn
+ {
+ \define@key
+ { markdownRenderers }
+ { #1 }
+ {
+ \cs_generate_from_arg_count:NNnn
+ #2
+ \cs_set:Npn
+ { #3 }
+ { ##1 }
+ }
+ }
+\cs_generate_variant:Nn
+ \@@_latex_define_renderer:nNn
+ { ncV }
+\ExplSyntaxOff
% \end{macrocode}
% \par
% \begin{markdown}
@@ -13673,174 +15310,53 @@ The following ordered list will be preceded by roman numerals:
%
% \end{markdown}
% \begin{macrocode}
-\define@key{markdownRendererPrototypes}{attributeIdentifier}{%
- \renewcommand\markdownRendererAttributeIdentifierPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{attributeClassName}{%
- \renewcommand\markdownRendererAttributeClassNamePrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{attributeKeyValue}{%
- \renewcommand\markdownRendererAttributeKeyValuePrototype[2]{#1}}%
-\define@key{markdownRendererPrototypes}{documentBegin}{%
- \renewcommand\markdownRendererDocumentBeginPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{documentEnd}{%
- \renewcommand\markdownRendererDocumentEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{interblockSeparator}{%
- \renewcommand\markdownRendererInterblockSeparatorPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{lineBreak}{%
- \renewcommand\markdownRendererLineBreakPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{ellipsis}{%
- \renewcommand\markdownRendererEllipsisPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{headerAttributeContextBegin}{%
- \renewcommand\markdownRendererHeaderAttributeContextBeginPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{headerAttributeContextEnd}{%
- \renewcommand\markdownRendererHeaderAttributeContextEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{nbsp}{%
- \renewcommand\markdownRendererNbspPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{leftBrace}{%
- \renewcommand\markdownRendererLeftBracePrototype{#1}}%
-\define@key{markdownRendererPrototypes}{rightBrace}{%
- \renewcommand\markdownRendererRightBracePrototype{#1}}%
-\define@key{markdownRendererPrototypes}{dollarSign}{%
- \renewcommand\markdownRendererDollarSignPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{percentSign}{%
- \renewcommand\markdownRendererPercentSignPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{ampersand}{%
- \renewcommand\markdownRendererAmpersandPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{underscore}{%
- \renewcommand\markdownRendererUnderscorePrototype{#1}}%
-\define@key{markdownRendererPrototypes}{hash}{%
- \renewcommand\markdownRendererHashPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{circumflex}{%
- \renewcommand\markdownRendererCircumflexPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{backslash}{%
- \renewcommand\markdownRendererBackslashPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{tilde}{%
- \renewcommand\markdownRendererTildePrototype{#1}}%
-\define@key{markdownRendererPrototypes}{pipe}{%
- \renewcommand\markdownRendererPipePrototype{#1}}%
-\define@key{markdownRendererPrototypes}{codeSpan}{%
- \renewcommand\markdownRendererCodeSpanPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{link}{%
- \renewcommand\markdownRendererLinkPrototype[4]{#1}}%
-\define@key{markdownRendererPrototypes}{contentBlock}{%
- \renewcommand\markdownRendererContentBlockPrototype[4]{#1}}%
-\define@key{markdownRendererPrototypes}{contentBlockOnlineImage}{%
- \renewcommand\markdownRendererContentBlockOnlineImagePrototype[4]{#1}}%
-\define@key{markdownRendererPrototypes}{contentBlockCode}{%
- \renewcommand\markdownRendererContentBlockCodePrototype[5]{#1}}%
-\define@key{markdownRendererPrototypes}{image}{%
- \renewcommand\markdownRendererImagePrototype[4]{#1}}%
-\define@key{markdownRendererPrototypes}{ulBegin}{%
- \renewcommand\markdownRendererUlBeginPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{ulBeginTight}{%
- \renewcommand\markdownRendererUlBeginTightPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{ulItem}{%
- \renewcommand\markdownRendererUlItemPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{ulItemEnd}{%
- \renewcommand\markdownRendererUlItemEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{ulEnd}{%
- \renewcommand\markdownRendererUlEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{ulEndTight}{%
- \renewcommand\markdownRendererUlEndTightPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{olBegin}{%
- \renewcommand\markdownRendererOlBeginPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{olBeginTight}{%
- \renewcommand\markdownRendererOlBeginTightPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{olItem}{%
- \renewcommand\markdownRendererOlItemPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{olItemWithNumber}{%
- \renewcommand\markdownRendererOlItemWithNumberPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{olItemEnd}{%
- \renewcommand\markdownRendererOlItemEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{olEnd}{%
- \renewcommand\markdownRendererOlEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{olEndTight}{%
- \renewcommand\markdownRendererOlEndTightPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{dlBegin}{%
- \renewcommand\markdownRendererDlBeginPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{dlBeginTight}{%
- \renewcommand\markdownRendererDlBeginTightPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{dlItem}{%
- \renewcommand\markdownRendererDlItemPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{dlItemEnd}{%
- \renewcommand\markdownRendererDlItemEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{dlDefinitionBegin}{%
- \renewcommand\markdownRendererDlDefinitionBeginPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{dlDefinitionEnd}{%
- \renewcommand\markdownRendererDlDefinitionEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{dlEnd}{%
- \renewcommand\markdownRendererDlEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{dlEndTight}{%
- \renewcommand\markdownRendererDlEndTightPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{emphasis}{%
- \renewcommand\markdownRendererEmphasisPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{strongEmphasis}{%
- \renewcommand\markdownRendererStrongEmphasisPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{blockQuoteBegin}{%
- \renewcommand\markdownRendererBlockQuoteBeginPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{blockQuoteEnd}{%
- \renewcommand\markdownRendererBlockQuoteEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{inputVerbatim}{%
- \renewcommand\markdownRendererInputVerbatimPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{inputFencedCode}{%
- \renewcommand\markdownRendererInputFencedCodePrototype[2]{#1}}%
-\define@key{markdownRendererPrototypes}{jekyllDataBoolean}{%
- \renewcommand\markdownRendererJekyllDataBooleanPrototype[2]{#1}}%
-\define@key{markdownRendererPrototypes}{jekyllDataEmpty}{%
- \renewcommand\markdownRendererJekyllDataEmptyPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{jekyllDataNumber}{%
- \renewcommand\markdownRendererJekyllDataNumberPrototype[2]{#1}}%
-\define@key{markdownRendererPrototypes}{jekyllDataString}{%
- \renewcommand\markdownRendererJekyllDataStringPrototype[2]{#1}}%
-\define@key{markdownRendererPrototypes}{jekyllDataBegin}{%
- \renewcommand\markdownRendererJekyllDataBeginPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{jekyllDataEnd}{%
- \renewcommand\markdownRendererJekyllDataEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{jekyllDataSequenceBegin}{%
- \renewcommand\markdownRendererJekyllDataSequenceBeginPrototype[2]{#1}}%
-\define@key{markdownRendererPrototypes}{jekyllDataSequenceEnd}{%
- \renewcommand\markdownRendererJekyllDataSequenceEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{jekyllDataMappingBegin}{%
- \renewcommand\markdownRendererJekyllDataMappingBeginPrototype[2]{#1}}%
-\define@key{markdownRendererPrototypes}{jekyllDataMappingEnd}{%
- \renewcommand\markdownRendererJekyllDataMappingEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{headingOne}{%
- \renewcommand\markdownRendererHeadingOnePrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{headingTwo}{%
- \renewcommand\markdownRendererHeadingTwoPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{headingThree}{%
- \renewcommand\markdownRendererHeadingThreePrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{headingFour}{%
- \renewcommand\markdownRendererHeadingFourPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{headingFive}{%
- \renewcommand\markdownRendererHeadingFivePrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{headingSix}{%
- \renewcommand\markdownRendererHeadingSixPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{horizontalRule}{%
- \renewcommand\markdownRendererHorizontalRulePrototype{#1}}%
-\define@key{markdownRendererPrototypes}{footnote}{%
- \renewcommand\markdownRendererFootnotePrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{cite}{%
- \renewcommand\markdownRendererCitePrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{textCite}{%
- \renewcommand\markdownRendererTextCitePrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{table}{%
- \renewcommand\markdownRendererTablePrototype[3]{#1}}%
-\define@key{markdownRendererPrototypes}{inlineHtmlComment}{%
- \renewcommand\markdownRendererInlineHtmlCommentPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{blockHtmlCommentBegin}{%
- \renewcommand\markdownRendererBlockHtmlCommentBeginPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{blockHtmlCommentEnd}{%
- \renewcommand\markdownRendererBlockHtmlCommentEndPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{inlineHtmlTag}{%
- \renewcommand\markdownRendererInlineHtmlTagPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{inputBlockHtmlElement}{%
- \renewcommand\markdownRendererInputBlockHtmlElementPrototype[1]{#1}}%
-\define@key{markdownRendererPrototypes}{tickedBox}{%
- \renewcommand\markdownRendererTickedBoxPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{halfTickedBox}{%
- \renewcommand\markdownRendererHalfTickedBoxPrototype{#1}}%
-\define@key{markdownRendererPrototypes}{untickedBox}{%
- \renewcommand\markdownRendererUntickedBoxPrototype{#1}}%
+\ExplSyntaxOn
+\cs_new:Nn \@@_latex_define_renderer_prototypes:
+ {
+ \seq_map_function:NN
+ \g_@@_renderers_seq
+ \@@_latex_define_renderer_prototype:n
+ }
+\cs_new:Nn \@@_latex_define_renderer_prototype:n
+ {
+ \tl_set:Nn
+ \l_tmpb_tl
+% TODO: Replace with \str_uppercase:n in TeX Live 2020.
+ { \str_upper_case:n { #1 } }
+ \tl_set:Nx
+ \l_tmpa_tl
+ {
+ markdownRenderer
+ \tl_head:f { \l_tmpb_tl }
+ \tl_tail:n { #1 }
+ Prototype
+ }
+ \prop_get:NnN
+ \g_@@_renderer_arities_prop
+ { #1 }
+ \l_tmpb_tl
+ \@@_latex_define_renderer_prototype:ncV
+ { #1 }
+ { \l_tmpa_tl }
+ \l_tmpb_tl
+ }
+\cs_new:Nn \@@_latex_define_renderer_prototype:nNn
+ {
+ \define@key
+ { markdownRendererPrototypes }
+ { #1 }
+ {
+ \cs_generate_from_arg_count:NNnn
+ #2
+ \cs_set:Npn
+ { #3 }
+ { ##1 }
+ }
+ }
+\cs_generate_variant:Nn
+ \@@_latex_define_renderer_prototype:nNn
+ { ncV }
+\ExplSyntaxOff
% \end{macrocode}
% \par
% \begin{markdown}
@@ -18241,8 +19757,6 @@ parsers.urlchar = parsers.anyescaped - parsers.newline - parsers.more
%
% \end{markdown}
% \begin{macrocode}
-parsers.Block = V("Block")
-
parsers.OnlineImageURL
= parsers.leader
* parsers.onlineimageurl
@@ -18495,13 +20009,13 @@ function M.reader.new(writer, options)
= create_parser("parse_blocks",
function()
return larsers.blocks
- end, false)
+ end, true)
- local parse_blocks_toplevel
- = create_parser("parse_blocks_toplevel",
+ local parse_blocks_nested
+ = create_parser("parse_blocks_nested",
function()
- return larsers.blocks_toplevel
- end, true)
+ return larsers.blocks_nested
+ end, false)
local parse_inlines
= create_parser("parse_inlines",
@@ -18622,7 +20136,7 @@ function M.reader.new(writer, options)
return writer.defer_call(function()
local found = rawnotes[normalize_tag(ref)]
if found then
- return writer.note(parse_blocks_toplevel(found))
+ return writer.note(parse_blocks_nested(found))
else
return {"[", parse_inlines("^" .. ref), "]"}
end
@@ -18953,7 +20467,7 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline
* parsers.contentblock_tail
/ writer.contentblock
- larsers.DisplayHtml = (parsers.htmlcomment / parse_blocks)
+ larsers.DisplayHtml = (parsers.htmlcomment / parse_blocks_nested)
/ writer.block_html_comment
+ parsers.emptyelt_block / writer.block_html_element
+ parsers.openelt_exact("hr") / writer.block_html_element
@@ -18971,21 +20485,40 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline
expandtabs(code))
end
- larsers.JekyllData = P("---")
+ larsers.JekyllData = Cmt( C((parsers.line - P("---") - P("..."))^0)
+ , function(s, i, text)
+ local data
+ local ran_ok, error = pcall(function()
+ local tinyyaml = require("markdown-tinyyaml")
+ data = tinyyaml.parse(text, {timestamps=false})
+ end)
+ if ran_ok and data ~= nil then
+ return true, writer.jekyllData(data, function(s)
+ return parse_blocks_nested(s)
+ end, nil)
+ else
+ return false
+ end
+ end
+ )
+
+ larsers.UnexpectedJekyllData
+ = P("---")
* parsers.blankline / 0
* #(-parsers.blankline) -- if followed by blank, it's an hrule
- * C((parsers.line - P("---") - P("..."))^0)
+ * larsers.JekyllData
* (P("---") + P("..."))
- / function(text)
- local tinyyaml = require("markdown-tinyyaml")
- data = tinyyaml.parse(text,{timestamps=false})
- return writer.jekyllData(data, function(s)
- return parse_blocks(s)
- end, nil)
- end
+
+ larsers.ExpectedJekyllData
+ = ( P("---")
+ * parsers.blankline / 0
+ * #(-parsers.blankline) -- if followed by blank, it's an hrule
+ )^-1
+ * larsers.JekyllData
+ * (P("---") + P("..."))^-1
larsers.Blockquote = Cs(larsers.blockquote_body^1)
- / parse_blocks_toplevel / writer.blockquote
+ / parse_blocks_nested / writer.blockquote
larsers.HorizontalRule = ( parsers.lineof(parsers.asterisk)
+ parsers.lineof(parsers.dash)
@@ -18995,15 +20528,6 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline
larsers.Reference = parsers.define_reference_parser / register_link
larsers.Paragraph = parsers.nonindentspace * Ct(parsers.Inline^1)
- * parsers.newline
- * ( parsers.blankline^1
- + #parsers.hash
- + #(parsers.leader * parsers.more * parsers.space^-1)
- )
- / writer.paragraph
-
- larsers.ToplevelParagraph
- = parsers.nonindentspace * Ct(parsers.Inline^1)
* ( parsers.newline
* ( parsers.blankline^1
+ #parsers.hash
@@ -19052,7 +20576,7 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline
larsers.TightListItem = function(starter)
return -larsers.HorizontalRule
* (Cs(starter / "" * larsers.tickbox^-1 * larsers.ListBlock * larsers.NestedList^-1)
- / parse_blocks)
+ / parse_blocks_nested)
* -(parsers.blanklines * parsers.indent)
end
@@ -19061,7 +20585,7 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline
* Cs( starter / "" * larsers.tickbox^-1 * larsers.ListBlock * Cc("\n")
* (larsers.NestedList + larsers.ListContinuationBlock^0)
* (parsers.blanklines / "\n\n")
- ) / parse_blocks
+ ) / parse_blocks_nested
end
larsers.BulletList = ( Ct(larsers.TightListItem(parsers.bullet)^1) * Cc(true)
@@ -19098,12 +20622,12 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline
larsers.DefinitionListItemLoose = C(parsers.line) * parsers.skipblanklines
* Ct((parsers.defstart
* parsers.indented_blocks(parsers.dlchunk)
- / parse_blocks_toplevel)^1)
+ / parse_blocks_nested)^1)
* Cc(false) / definition_list_item
larsers.DefinitionListItemTight = C(parsers.line)
* Ct((parsers.defstart * parsers.dlchunk
- / parse_blocks)^1)
+ / parse_blocks_nested)^1)
* Cc(true) / definition_list_item
larsers.DefinitionList = ( Ct(larsers.DefinitionListItemLoose^1) * Cc(false)
@@ -19202,17 +20726,22 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline
local syntax =
{ "Blocks",
- Blocks = larsers.Blank^0 * parsers.Block^-1
- * (larsers.Blank^0 / writer.interblocksep
- * parsers.Block)^0
- * larsers.Blank^0 * parsers.eof,
+ Blocks = ( V("ExpectedJekyllData")
+ * (V("Blank")^0 / writer.interblocksep)
+ )^-1
+ * V("Blank")^0
+ * V("Block")^-1
+ * (V("Blank")^0 / writer.interblocksep
+ * V("Block"))^0
+ * V("Blank")^0 * parsers.eof,
Blank = larsers.Blank,
- JekyllData = larsers.JekyllData,
+ UnexpectedJekyllData = larsers.UnexpectedJekyllData,
+ ExpectedJekyllData = larsers.ExpectedJekyllData,
Block = V("ContentBlock")
- + V("JekyllData")
+ + V("UnexpectedJekyllData")
+ V("Blockquote")
+ V("PipeTable")
+ V("Verbatim")
@@ -19341,7 +20870,11 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline
end
if not options.jekyllData then
- syntax.JekyllData = parsers.fail
+ syntax.UnexpectedJekyllData = parsers.fail
+ end
+
+ if not options.jekyllData or not options.expectJekyllData then
+ syntax.ExpectedJekyllData = parsers.fail
end
if options.preserveTabs then
@@ -19360,9 +20893,9 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline
syntax.AutoLinkRelativeReference = parsers.fail
end
- local blocks_toplevel_t = util.table_copy(syntax)
- blocks_toplevel_t.Paragraph = larsers.ToplevelParagraph
- larsers.blocks_toplevel = Ct(blocks_toplevel_t)
+ local blocks_nested_t = util.table_copy(syntax)
+ blocks_nested_t.ExpectedJekyllData = parsers.fail
+ larsers.blocks_nested = Ct(blocks_nested_t)
larsers.blocks = Ct(syntax)
@@ -19427,7 +20960,7 @@ larsers.PipeTable = Ct(larsers.table_row * parsers.newline
% \end{markdown}
% \begin{macrocode}
local function convert(input)
- local document = parse_blocks_toplevel(input)
+ local document = parse_blocks(input)
return util.rope_to_string(writer.document(document))
end
if options.eagerCache or options.finalizeCache then
@@ -19684,121 +21217,377 @@ end
% \par
% \begin{markdown}
%
+%#### YAML Metadata Renderer Prototypes {#expl3yamlmetadataimplementation}
+%
+% To keep track of the current type of structure we inhabit when we are
+% traversing a \acro{yaml} document, we will maintain the
+% \mdef{g_\@\@_jekyll_data_datatypes_seq} stack. At every step of the traversal,
+% the stack will contain one of the following constants at any position $p$:
+%
+% \mdef{c_\@\@_jekyll_data_sequence_tl}
+%
+%: The currently traversed branch of the \acro{yaml} document contains a sequence
+% at depth $p$.
+%
+% \mdef{c_\@\@_jekyll_data_mapping_tl}
+%
+%: The currently traversed branch of the \acro{yaml} document contains a mapping
+% at depth $p$.
+%
+% \mdef{c_\@\@_jekyll_data_scalar_tl}
+%
+%: The currently traversed branch of the \acro{yaml} document contains a scalar
+% value at depth $p$.
+%
+% \end{markdown}
+% \begin{macrocode}
+\ExplSyntaxOn
+\seq_new:N \g_@@_jekyll_data_datatypes_seq
+\tl_const:Nn \c_@@_jekyll_data_sequence_tl { sequence }
+\tl_const:Nn \c_@@_jekyll_data_mapping_tl { mapping }
+\tl_const:Nn \c_@@_jekyll_data_scalar_tl { scalar }
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% To keep track of our current place when we are traversing a \acro{yaml}
+% document, we will maintain the
+% \mdef{g_\@\@_jekyll_data_wildcard_absolute_address_seq} stack of keys using
+% the \mdef{markdown_jekyll_data_push_address_segment:n} macro.
+%
+% \end{markdown}
+% \begin{macrocode}
+\seq_new:N \g_@@_jekyll_data_wildcard_absolute_address_seq
+\cs_new:Nn \markdown_jekyll_data_push_address_segment:n
+ {
+ \seq_if_empty:NF
+ \g_@@_jekyll_data_datatypes_seq
+ {
+ \seq_get_right:NN
+ \g_@@_jekyll_data_datatypes_seq
+ \l_tmpa_tl
+% \end{macrocode}
+% \begin{markdown}
+%
+% If we are currently in a sequence, we will put an asterisk (`*`) instead of
+% a key into \mref{g_\@\@_jekyll_data_wildcard_absolute_address_seq} to make
+% it represent a *wildcard*. Keeping a wildcard instead of a precise address
+% makes it easy for the users to react to *any* item of a sequence regardless
+% of how many there are, which can often be useful.
+%
+% \end{markdown}
+% \begin{macrocode}
+ \tl_if_eq:NNTF
+ \l_tmpa_tl
+ \c_@@_jekyll_data_sequence_tl
+ {
+ \seq_put_right:Nn
+ \g_@@_jekyll_data_wildcard_absolute_address_seq
+ { * }
+ }
+ {
+ \seq_put_right:Nn
+ \g_@@_jekyll_data_wildcard_absolute_address_seq
+ { #1 }
+ }
+ }
+ }
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% Out of \mref{g_\@\@_jekyll_data_wildcard_absolute_address_seq}, we will
+% construct the following two token lists:
+%
+% \mdef{g_\@\@_jekyll_data_wildcard_absolute_address_tl}
+%
+%: An *absolute wildcard*: The wildcard from the root of the document
+% prefixed with a slash (`/`) with individual keys and asterisks also
+% delimited by slashes. Allows the users to react to complex
+% context-sensitive structures with ease.
+%
+%: For example, the `name` key in the following \acro{yaml} document
+% would correspond to the `/*/person/name` absolute wildcard:
+% ``` yaml
+% [{person: {name: Elon, surname: Musk}}]
+% ```
+%
+% \mdef{g_\@\@_jekyll_data_wildcard_relative_address_tl}
+%
+%: A *relative wildcard*: The rightmost segment of the wildcard. Allows the
+% users to react to simple context-free structures.
+%
+%: For example, the `name` key in the following \acro{yaml} document
+% would correspond to the `name` relative wildcard:
+% ``` yaml
+% [{person: {name: Elon, surname: Musk}}]
+% ```
+%
+% We will construct \mref{g_\@\@_jekyll_data_wildcard_absolute_address_tl}
+% using the \mdef{markdown_jekyll_data_concatenate_address:NN} macro and
+% we will construct both token lists using the
+% \mdef{markdown_jekyll_data_update_address_tls:} macro.
+%
+% \end{markdown}
+% \begin{macrocode}
+\tl_new:N \g_@@_jekyll_data_wildcard_absolute_address_tl
+\tl_new:N \g_@@_jekyll_data_wildcard_relative_address_tl
+\cs_new:Nn \markdown_jekyll_data_concatenate_address:NN
+ {
+ \seq_pop_left:NN #1 \l_tmpa_tl
+ \tl_set:Nx #2 { / \seq_use:Nn #1 { / } }
+ \seq_put_left:NV #1 \l_tmpa_tl
+ }
+\cs_new:Nn \markdown_jekyll_data_update_address_tls:
+ {
+ \markdown_jekyll_data_concatenate_address:NN
+ \g_@@_jekyll_data_wildcard_absolute_address_seq
+ \g_@@_jekyll_data_wildcard_absolute_address_tl
+ \seq_get_right:NN
+ \g_@@_jekyll_data_wildcard_absolute_address_seq
+ \g_@@_jekyll_data_wildcard_relative_address_tl
+ }
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% To make sure that the stacks and token lists stay in sync, we will use the
+% \mdef{markdown_jekyll_data_push:nN} and \mdef{markdown_jekyll_data_pop:}
+% macros.
+%
+% \end{markdown}
+% \begin{macrocode}
+\cs_new:Nn \markdown_jekyll_data_push:nN
+ {
+ \markdown_jekyll_data_push_address_segment:n
+ { #1 }
+ \seq_put_right:NV
+ \g_@@_jekyll_data_datatypes_seq
+ #2
+ \markdown_jekyll_data_update_address_tls:
+ }
+\cs_new:Nn \markdown_jekyll_data_pop:
+ {
+ \seq_pop_right:NN
+ \g_@@_jekyll_data_wildcard_absolute_address_seq
+ \l_tmpa_tl
+ \seq_pop_right:NN
+ \g_@@_jekyll_data_datatypes_seq
+ \l_tmpa_tl
+ \markdown_jekyll_data_update_address_tls:
+ }
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% To set a single key--value, we will use the
+% \mdef{markdown_jekyll_data_set_keyval:Nn} macro, ignoring unknown keys.
+% To set key--values for both absolute and relative wildcards, we will use the
+% \mdef{markdown_jekyll_data_set_keyvals:nn} macro.
+%
+% \end{markdown}
+% \begin{macrocode}
+\cs_new:Nn \markdown_jekyll_data_set_keyval:nn
+ {
+ \keys_set_known:nn
+ { markdown/jekyllData }
+ { { #1 } = { #2 } }
+ }
+\cs_generate_variant:Nn
+ \markdown_jekyll_data_set_keyval:nn
+ { Vn }
+\cs_new:Nn \markdown_jekyll_data_set_keyvals:nn
+ {
+ \markdown_jekyll_data_push:nN
+ { #1 }
+ \c_@@_jekyll_data_scalar_tl
+ \markdown_jekyll_data_set_keyval:Vn
+ \g_@@_jekyll_data_wildcard_absolute_address_tl
+ { #2 }
+ \markdown_jekyll_data_set_keyval:Vn
+ \g_@@_jekyll_data_wildcard_relative_address_tl
+ { #2 }
+ \markdown_jekyll_data_pop:
+ }
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% Finally, we will register our macros as token renderer prototypes
+% to be able to react to the traversal of a \acro{yaml} document.
+%
+% \end{markdown}
+% \begin{macrocode}
+\def\markdownRendererJekyllDataSequenceBeginPrototype#1#2{
+ \markdown_jekyll_data_push:nN
+ { #1 }
+ \c_@@_jekyll_data_sequence_tl
+}
+\def\markdownRendererJekyllDataMappingBeginPrototype#1#2{
+ \markdown_jekyll_data_push:nN
+ { #1 }
+ \c_@@_jekyll_data_mapping_tl
+}
+\def\markdownRendererJekyllDataSequenceEndPrototype{
+ \markdown_jekyll_data_pop:
+}
+\def\markdownRendererJekyllDataMappingEndPrototype{
+ \markdown_jekyll_data_pop:
+}
+\def\markdownRendererJekyllDataBooleanPrototype#1#2{
+ \markdown_jekyll_data_set_keyvals:nn
+ { #1 }
+ { #2 }
+}
+\def\markdownRendererJekyllDataEmptyPrototype#1{}
+\def\markdownRendererJekyllDataNumberPrototype#1#2{
+ \markdown_jekyll_data_set_keyvals:nn
+ { #1 }
+ { #2 }
+}
+\def\markdownRendererJekyllDataStringPrototype#1#2{
+ \markdown_jekyll_data_set_keyvals:nn
+ { #1 }
+ { #2 }
+}
+\ExplSyntaxOff
+% \end{macrocode}
+% \begin{markdown}
+%
%### Lua Snippets
-% The \mdef{markdownLuaOptions} macro expands to a Lua table that
+% After the \mdef{markdownPrepareLuaOptions} macro has been fully expanded,
+% the \mdef{markdownLuaOptions} macro will expands to a Lua table that
% contains the plain \TeX{} options (see Section <#sec:texoptions>) in a
% format recognized by Lua (see Section <#sec:luaoptions>).
%
% \end{markdown}
% \begin{macrocode}
-\def\markdownLuaOptions{{%
-\ifx\markdownOptionBlankBeforeBlockquote\undefined\else
- blankBeforeBlockquote = \markdownOptionBlankBeforeBlockquote,
-\fi
-\ifx\markdownOptionBlankBeforeCodeFence\undefined\else
- blankBeforeCodeFence = \markdownOptionBlankBeforeCodeFence,
-\fi
-\ifx\markdownOptionBlankBeforeHeading\undefined\else
- blankBeforeHeading = \markdownOptionBlankBeforeHeading,
-\fi
-\ifx\markdownOptionBreakableBlockquotes\undefined\else
- breakableBlockquotes = \markdownOptionBreakableBlockquotes,
-\fi
- cacheDir = "\markdownOptionCacheDir",
-\ifx\markdownOptionCitations\undefined\else
- citations = \markdownOptionCitations,
-\fi
-\ifx\markdownOptionCitationNbsps\undefined\else
- citationNbsps = \markdownOptionCitationNbsps,
-\fi
-\ifx\markdownOptionCodeSpans\undefined\else
- codeSpans = \markdownOptionCodeSpans,
-\fi
-\ifx\markdownOptionContentBlocks\undefined\else
- contentBlocks = \markdownOptionContentBlocks,
-\fi
-\ifx\markdownOptionContentBlocksLanguageMap\undefined\else
- contentBlocksLanguageMap =
- "\markdownOptionContentBlocksLanguageMap",
-\fi
-\ifx\markdownOptionDefinitionLists\undefined\else
- definitionLists = \markdownOptionDefinitionLists,
-\fi
-\ifx\markdownOptionEagerCache\undefined\else
- eagerCache = \markdownOptionEagerCache,
-\fi
-\ifx\markdownOptionFinalizeCache\undefined\else
- finalizeCache = \markdownOptionFinalizeCache,
-\fi
- frozenCacheFileName = "\markdownOptionFrozenCacheFileName",
- frozenCacheCounter = \the\markdownFrozenCacheCounter,
-\ifx\markdownOptionFootnotes\undefined\else
- footnotes = \markdownOptionFootnotes,
-\fi
-\ifx\markdownOptionFencedCode\undefined\else
- fencedCode = \markdownOptionFencedCode,
-\fi
-\ifx\markdownOptionHardLineBreaks\undefined\else
- hardLineBreaks = \markdownOptionHardLineBreaks,
-\fi
-\ifx\markdownOptionHashEnumerators\undefined\else
- hashEnumerators = \markdownOptionHashEnumerators,
-\fi
-\ifx\markdownOptionHeaderAttributes\undefined\else
- headerAttributes = \markdownOptionHeaderAttributes,
-\fi
-\ifx\markdownOptionHtml\undefined\else
- html = \markdownOptionHtml,
-\fi
-\ifx\markdownOptionHybrid\undefined\else
- hybrid = \markdownOptionHybrid,
-\fi
-\ifx\markdownOptionInlineFootnotes\undefined\else
- inlineFootnotes = \markdownOptionInlineFootnotes,
-\fi
-\ifx\markdownOptionJekyllData\undefined\else
- jekyllData = \markdownOptionJekyllData,
-\fi
-\ifx\markdownOptionPipeTables\undefined\else
- pipeTables = \markdownOptionPipeTables,
-\fi
-\ifx\markdownOptionPreserveTabs\undefined\else
- preserveTabs = \markdownOptionPreserveTabs,
-\fi
-\ifx\markdownOptionRelativeReferences\undefined\else
- relativeReferences = \markdownOptionRelativeReferences,
-\fi
-\ifx\markdownOptionShiftHeadings\undefined\else
- shiftHeadings = "\markdownOptionShiftHeadings",
-\fi
-\ifx\markdownOptionSlice\undefined\else
- slice = "\markdownOptionSlice",
-\fi
-\ifx\markdownOptionSmartEllipses\undefined\else
- smartEllipses = \markdownOptionSmartEllipses,
-\fi
-\ifx\markdownOptionStartNumber\undefined\else
- startNumber = \markdownOptionStartNumber,
-\fi
-\ifx\markdownOptionStripIndent\undefined\else
- stripIndent = \markdownOptionStripIndent,
-\fi
-\ifx\markdownOptionTableCaptions\undefined\else
- tableCaptions = \markdownOptionTableCaptions,
-\fi
-\ifx\markdownOptionTaskLists\undefined\else
- taskLists = \markdownOptionTaskLists,
-\fi
-\ifx\markdownOptionTeXComments\undefined\else
- texComments = \markdownOptionTeXComments,
-\fi
-\ifx\markdownOptionTightLists\undefined\else
- tightLists = \markdownOptionTightLists,
-\fi
-\ifx\markdownOptionUnderscores\undefined\else
- underscores = \markdownOptionUnderscores,
-\fi}
-}%
+\ExplSyntaxOn
+\tl_new:N \g_@@_formatted_lua_options_tl
+\tl_const:Nn \c_@@_lua_option_type_boolean { boolean }
+\tl_const:Nn \c_@@_lua_option_type_counter { counter }
+\tl_const:Nn \c_@@_lua_option_type_number { number }
+\tl_const:Nn \c_@@_lua_option_type_string { string }
+\cs_new:Nn \@@_format_lua_options:
+ {
+ \tl_gclear:N
+ \g_@@_formatted_lua_options_tl
+ \seq_map_function:NN
+ \g_@@_lua_options_seq
+ \@@_format_lua_option:n
+ }
+\cs_new:Nn \@@_format_lua_option:n
+ {
+ \@@_typecheck_lua_option:n { #1 }
+ \tl_set:Nn
+ \l_tmpb_tl
+% TODO: Replace with \str_uppercase:n in TeX Live 2020.
+ { \str_upper_case:n { #1 } }
+ \tl_set:Nx
+ \l_tmpa_tl
+ {
+ markdownOption
+ \tl_head:f { \l_tmpb_tl }
+ \tl_tail:n { #1 }
+ }
+ \prop_get:NnN
+ \g_@@_lua_option_types_prop
+ { #1 }
+ \l_tmpb_tl
+ \cs_if_free:cTF
+ { \l_tmpa_tl }
+ { }
+ {
+ \tl_case:NnF
+ \l_tmpb_tl
+ {
+ \c_@@_lua_option_type_string
+ {
+ \tl_gput_right:Nx
+ \g_@@_formatted_lua_options_tl
+ { #1~=~" \cs:w \l_tmpa_tl \cs_end: ",~ }
+ }
+ \c_@@_lua_option_type_counter
+ {
+ \tl_gput_right:Nx
+ \g_@@_formatted_lua_options_tl
+ { #1~=~ \the \cs:w \l_tmpa_tl \cs_end: ,~ }
+ }
+ }
+ {
+ \tl_gput_right:Nx
+ \g_@@_formatted_lua_options_tl
+ { #1~=~ \cs:w \l_tmpa_tl \cs_end: ,~ }
+ }
+ }
+ }
+\msg_new:nnn
+ { markdown }
+ { undefined-lua-option }
+ {
+ Lua~option~#1~is~undefined.
+ }
+\msg_new:nnn
+ { markdown }
+ { failed-typecheck-for-boolean-lua-option }
+ {
+ Lua~option~#1~has~value~#2,~
+ but~a~boolean~(true~or~false)~was~expected.
+ }
+\cs_new:Nn \@@_typecheck_lua_option:n
+ {
+ \tl_set:Nn
+ \l_tmpb_tl
+% TODO: Replace with \str_uppercase:n in TeX Live 2020.
+ { \str_upper_case:n { #1 } }
+ \tl_set:Nx
+ \l_tmpa_tl
+ {
+ markdownOption
+ \tl_head:f { \l_tmpb_tl }
+ \tl_tail:n { #1 }
+ }
+ \prop_get:NnNTF
+ \g_@@_lua_option_types_prop
+ { #1 }
+ \l_tmpb_tl
+ {
+ \cs_if_free:cTF
+ { \l_tmpa_tl }
+ { }
+ {
+ \tl_case:Nn
+ \l_tmpb_tl
+ {
+ \c_@@_lua_option_type_boolean
+ {
+ \tl_case:cnF
+ { \l_tmpa_tl }
+ {
+ \c_@@_lua_option_value_true { }
+ \c_@@_lua_option_value_false { }
+ }
+ {
+ \msg_error:nnxx
+ { markdown }
+ { failed-typecheck-for-boolean-lua-option }
+ { #1 }
+ { \l_tmpa_tl }
+ }
+ }
+ }
+ }
+ }
+ {
+ \msg_error:nnn
+ { markdown }
+ { undefined-lua-option }
+ { #1 }
+ }
+ }
+\let\markdownPrepareLuaOptions=\@@_format_lua_options:
+\def\markdownLuaOptions{{ \g_@@_formatted_lua_options_tl }}
+\ExplSyntaxOff
% \end{macrocode}
% \par
% \begin{markdown}
@@ -19844,11 +21633,43 @@ end
%
% \end{markdown}
% \begin{macrocode}
-\def\markdownIfOption#1#2#3{%
- \begingroup
- \def\next{true}%
- \expandafter\ifx\csname markdownOption#1\endcsname\next
- \endgroup#2\else\endgroup#3\fi}%
+\ExplSyntaxOn
+\tl_const:Nn \c_@@_lua_option_value_true { true }
+\tl_const:Nn \c_@@_lua_option_value_false { false }
+\cs_new:Nn \@@_if_option:nTF
+ {
+ \tl_set:Nn
+ \l_tmpb_tl
+% TODO: Replace with \str_uppercase:n in TeX Live 2020.
+ { \str_upper_case:n { #1 } }
+ \tl_set:Nx
+ \l_tmpa_tl
+ {
+ markdownOption
+ \tl_head:f { \l_tmpb_tl }
+ \tl_tail:n { #1 }
+ }
+ \cs_if_free:cTF
+ { \l_tmpa_tl }
+ {
+ \prop_get:NnN
+ \g_@@_default_lua_options_prop
+ { #1 }
+ \l_tmpb_tl
+ }
+ {
+ \tl_set:Nf
+ \l_tmpb_tl
+ { \cs:w \l_tmpa_tl \cs_end: }
+ }
+ \tl_if_eq:NNTF
+ \l_tmpb_tl
+ \c_@@_lua_option_value_true
+ { #2 }
+ { #3 }
+ }
+\let\markdownIfOption=\@@_if_option:nTF
+\ExplSyntaxOff
% \end{macrocode}
% \par
% \begin{markdown}
@@ -19888,7 +21709,7 @@ end
% Make the newline and tab characters active and swap the character codes of
% the backslash symbol (`\`) and the pipe symbol (`|`), so that we can use the
% backslash as an ordinary character inside the macro definition. Likewise,
-% swap the character codes of the percent sign (`%`) and the ampersand (`@`),
+% swap the character codes of the percent sign (`\%`) and the ampersand (`@`),
% so that we can remove percent signs from the beginning of lines when
% \mref{markdownOptionStripPercentSigns} is enabled.
% \end{markdown}
@@ -19907,7 +21728,7 @@ end
% open the \mref{markdownOptionInputTempFileName} file for writing.
% \end{markdown}
% \begin{macrocode}
- |markdownIfOption{FrozenCache}{}{@
+ |markdownIfOption{frozenCache}{}{@
|immediate|openout|markdownOutputFileStream@
|markdownOptionInputTempFileName|relax@
|markdownInfo{Buffering markdown input into the temporary @
@@ -19928,7 +21749,7 @@ end
% \end{macrocode}
% \begin{markdown}
% The \mdef{markdownReadAndConvertStripPercentSigns} macro will process the
-% individual lines of output, stipping away leading percent signs (`%`) when
+% individual lines of output, stipping away leading percent signs (`\%`) when
% \mref{markdownOptionStripPercentSigns} is enabled.
% Notice the use of the comments (`@`) to ensure that the entire macro is at
% a single line and therefore no (active) newline symbols
@@ -19936,7 +21757,7 @@ end
% \end{markdown}
% \begin{macrocode}
|def|markdownReadAndConvertStripPercentSign##1{@
- |markdownIfOption{StripPercentSigns}{@
+ |markdownIfOption{stripPercentSigns}{@
|if##1%@
|expandafter|expandafter|expandafter@
|markdownReadAndConvertProcessLine@
@@ -19971,7 +21792,7 @@ end
% \end{markdown}
% \begin{macrocode}
|ifx|relax##3|relax@
- |markdownIfOption{FrozenCache}{}{@
+ |markdownIfOption{frozenCache}{}{@
|immediate|write|markdownOutputFileStream{##1}@
}@
|else@
@@ -19987,7 +21808,7 @@ end
% \begin{macrocode}
|def^^M{@
|markdownInfo{The ending token sequence was found}@
- |markdownIfOption{FrozenCache}{}{@
+ |markdownIfOption{frozenCache}{}{@
|immediate|closeout|markdownOutputFileStream@
}@
|endgroup@
@@ -20275,7 +22096,7 @@ end
|gdef|markdownInput#1{%
% \end{macrocode}
% \begin{markdown}
-% Change the category code of the percent sign (`%`) to other, so that a user
+% Change the category code of the percent sign (`\%`) to other, so that a user
% of the \Opt{hybrid} Lua option or a malevolent actor can't produce TeX
% comments in the plain TeX output of the Markdown package.
% \end{markdown}
@@ -20289,7 +22110,7 @@ end
% \mref{markdownFrozenCacheCounter}.
% \end{markdown}
% \begin{macrocode}
- |markdownIfOption{FrozenCache}{%
+ |markdownIfOption{frozenCache}{%
|ifnum|markdownFrozenCacheCounter=0|relax
|markdownInfo{Reading frozen cache from
"|markdownOptionFrozenCacheFileName"}%
@@ -20310,6 +22131,7 @@ end
% \begin{macrocode}
|openin|markdownInputFileStream#1
|closein|markdownInputFileStream
+ |markdownPrepareLuaOptions
|markdownLuaExecute{%
|markdownPrepare
local file = assert(io.open("#1", "r"),
@@ -20330,7 +22152,7 @@ end
% \mref{markdownFrozenCacheCounter}.
% \end{markdown}
% \begin{macrocode}
- |markdownIfOption{FinalizeCache}{%
+ |markdownIfOption{finalizeCache}{%
|global|advance|markdownFrozenCacheCounter by 1|relax
}%
}%
@@ -20370,6 +22192,19 @@ end
% \par
% \begin{markdown}
%
+% Use reflection to define the `renderers` and `rendererPrototypes` keys of
+% \mref{markdownSetup} as well as the keys that correspond to Lua options.
+%
+% \end{markdown}
+% \begin{macrocode}
+\ExplSyntaxOn
+\@@_latex_define_renderers:
+\@@_latex_define_renderer_prototypes:
+\ExplSyntaxOff
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
%### Logging Facilities
% The \LaTeX{} implementation redefines the plain \TeX{} logging macros (see
% Section <#sec:texinterfacelogging>) to use the \LaTeX{} \mref{PackageInfo},
@@ -20520,7 +22355,7 @@ end
\renewcommand\markdownRendererInputFencedCode[2]{%
\def\next##1 ##2\relax{%
\ifthenelse{\equal{##1}{dot}}{%
- \markdownIfOption{FrozenCache}{}{%
+ \markdownIfOption{frozenCache}{}{%
\immediate\write18{%
if ! test -e #1.pdf.source || ! diff #1 #1.pdf.source;
then
@@ -20630,7 +22465,7 @@ end
%
% \end{markdown}
% \begin{macrocode}
- \markdownIfOption{FrozenCache}{}{^^A
+ \markdownIfOption{frozenCache}{}{^^A
\immediate\write18{^^A
if printf '%s' "#3" | grep -q -E '^https?:';
then
@@ -20717,8 +22552,9 @@ end
% \end{macrocode}
% \begin{markdown}
%
-% After processing the options, activate the `renderers` and
-% `rendererPrototypes` keys.
+% After processing the options, activate the `renderers`, `rendererPrototypes`,
+% and `code` keys. The `code` key is used to immediately expand and execute code,
+% which can be especially useful in \LaTeX{} setup snippets.
%
% \end{markdown}
% \begin{macrocode}
@@ -20728,6 +22564,7 @@ end
\define@key{markdownOptions}{rendererPrototypes}{%
\setkeys{markdownRendererPrototypes}{#1}%
\def\KV@prefix{KV@markdownOptions@}}%
+\define@key{markdownOptions}{code}{#1}%
% \end{macrocode}
% \par
% \begin{markdown}
@@ -20743,23 +22580,14 @@ end
% \end{macrocode}
% \par
% \begin{markdown}%
-% If the \mref{markdownOptionTightLists} macro expands to `false`, do not load
-% the \pkg{paralist} package. This is necessary for \Hologo{LaTeX2e} document
-% classes that do not play nice with \pkg{paralist}, such as \pkg{beamer}.
-% If the \mref{markdownOptionTightLists} is undefined and the \pkg{beamer}
-% document class is in use, then do not load the \pkg{paralist} package either.
+% If the \Opt{tightLists} Lua option is disabled or the current document class
+% is \pkg{beamer}, do not load the \pkg{paralist} package.
%
% \end{markdown}
% \begin{macrocode}
-\RequirePackage{ifthen}
-
-\ifx\markdownOptionTightLists\undefined
- \@ifclassloaded{beamer}{}{%
- \RequirePackage{paralist}}%
-\else
- \ifthenelse{\equal{\markdownOptionTightLists}{false}}{}{%
- \RequirePackage{paralist}}%
-\fi
+\markdownIfOption{tightLists}{
+ \@ifclassloaded{beamer}{}{\RequirePackage{paralist}}%
+}{}
% \end{macrocode}
% \par
% \begin{markdown}
@@ -20787,7 +22615,7 @@ end
olEndTight = {\markdownRendererOlEnd},
dlBeginTight = {\markdownRendererDlBegin},
dlEndTight = {\markdownRendererDlEnd}}}}
-\RequirePackage{amsmath}
+\RequirePackage{amsmath,ifthen}
% \end{macrocode}
% \par
% \begin{markdown}
@@ -21431,180 +23259,14 @@ end
%
%#### YAML Metadata {#latexyamlmetadata}
%
-% \end{markdown}
-% \begin{macrocode}
-\ExplSyntaxOn
-% \end{macrocode}
-% \begin{markdown}
-%
-% To keep track of the current type of structure we inhabit when we are
-% traversing a \acro{yaml} document, we will maintain the
-% \mdef{g_\@\@_jekyll_data_datatypes_seq} stack. At every step of the traversal,
-% the stack will contain one of the following constants at any position $p$:
-%
-% \mdef{c_\@\@_jekyll_data_sequence_tl}
-%
-%: The currently traversed branch of the \acro{yaml} document contains a sequence
-% at depth $p$.
-%
-% \mdef{c_\@\@_jekyll_data_mapping_tl}
-%
-%: The currently traversed branch of the \acro{yaml} document contains a mapping
-% at depth $p$.
-%
-% \mdef{c_\@\@_jekyll_data_scalar_tl}
-%
-%: The currently traversed branch of the \acro{yaml} document contains a scalar
-% value at depth $p$.
-%
-% \end{markdown}
-% \begin{macrocode}
-\seq_new:N \g_@@_jekyll_data_datatypes_seq
-\tl_const:Nn \c_@@_jekyll_data_sequence_tl { sequence }
-\tl_const:Nn \c_@@_jekyll_data_mapping_tl { mapping }
-\tl_const:Nn \c_@@_jekyll_data_scalar_tl { scalar }
-% \end{macrocode}
-% \par
-% \begin{markdown}
-%
-% To keep track of our current place when we are traversing a \acro{yaml}
-% document, we will maintain the
-% \mdef{g_\@\@_jekyll_data_wildcard_absolute_address_seq} stack of keys using
-% the \mdef{markdown_jekyll_data_push_address_segment:n} macro.
-%
-% \end{markdown}
-% \begin{macrocode}
-\seq_new:N \g_@@_jekyll_data_wildcard_absolute_address_seq
-\cs_new:Nn \markdown_jekyll_data_push_address_segment:n
- {
- \seq_if_empty:NF
- \g_@@_jekyll_data_datatypes_seq
- {
- \seq_get_right:NN
- \g_@@_jekyll_data_datatypes_seq
- \l_tmpa_tl
-% \end{macrocode}
-% \begin{markdown}
-%
-% If we are currently in a sequence, we will put an asterisk (`*`) instead of
-% a key into \mref{g_\@\@_jekyll_data_wildcard_absolute_address_seq} to make
-% it represent a *wildcard*. Keeping a wildcard instead of a precise address
-% makes it easy for the users to react to *any* item of a sequence regardless
-% of how many there are, which can often be useful.
-%
-% \end{markdown}
-% \begin{macrocode}
- \tl_if_eq:NNTF
- \l_tmpa_tl
- \c_@@_jekyll_data_sequence_tl
- {
- \seq_put_right:Nn
- \g_@@_jekyll_data_wildcard_absolute_address_seq
- { * }
- }
- {
- \seq_put_right:Nn
- \g_@@_jekyll_data_wildcard_absolute_address_seq
- { #1 }
- }
- }
- }
-% \end{macrocode}
-% \par
-% \begin{markdown}
-%
-% Out of \mref{g_\@\@_jekyll_data_wildcard_absolute_address_seq}, we will
-% construct the following two token lists:
-%
-% \mdef{g_\@\@_jekyll_data_wildcard_absolute_address_tl}
-%
-%: An *absolute wildcard*: The wildcard from the root of the document
-% prefixed with a slash (`/`) with individual keys and asterisks also
-% delimited by slashes. Allows the users to react to complex
-% context-sensitive structures with ease.
-%
-%: For example, the `name` key in the following \acro{yaml} document
-% would correspond to the `/*/person/name` absolute wildcard:
-% ``` yaml
-% [{person: {name: Elon, surname: Musk}}]
-% ```
-%
-% \mdef{g_\@\@_jekyll_data_wildcard_relative_address_tl}
-%
-%: A *relative wildcard*: The rightmost segment of the wildcard. Allows the
-% users to react to simple context-free structures.
-%
-%: For example, the `name` key in the following \acro{yaml} document
-% would correspond to the `name` relative wildcard:
-% ``` yaml
-% [{person: {name: Elon, surname: Musk}}]
-% ```
-%
-% We will construct \mref{g_\@\@_jekyll_data_wildcard_absolute_address_tl}
-% using the \mdef{markdown_jekyll_data_concatenate_address:NN} macro and
-% we will construct both token lists using the
-% \mdef{markdown_jekyll_data_update_address_tls:} macro.
-%
-% \end{markdown}
-% \begin{macrocode}
-\tl_new:N \g_@@_jekyll_data_wildcard_absolute_address_tl
-\tl_new:N \g_@@_jekyll_data_wildcard_relative_address_tl
-\cs_new:Nn \markdown_jekyll_data_concatenate_address:NN
- {
- \seq_pop_left:NN #1 \l_tmpa_tl
- \tl_set:Nx #2 { / \seq_use:Nn #1 { / } }
- \seq_put_left:NV #1 \l_tmpa_tl
- }
-\cs_new:Nn \markdown_jekyll_data_update_address_tls:
- {
- \markdown_jekyll_data_concatenate_address:NN
- \g_@@_jekyll_data_wildcard_absolute_address_seq
- \g_@@_jekyll_data_wildcard_absolute_address_tl
- \seq_get_right:NN
- \g_@@_jekyll_data_wildcard_absolute_address_seq
- \g_@@_jekyll_data_wildcard_relative_address_tl
- }
-% \end{macrocode}
-% \par
-% \begin{markdown}
-%
-% To make sure that the stacks and token lists stay in sync, we will use the
-% \mdef{markdown_jekyll_data_push:nN} and \mdef{markdown_jekyll_data_pop:}
-% macros.
-%
-% \end{markdown}
-% \begin{macrocode}
-\cs_new:Nn \markdown_jekyll_data_push:nN
- {
- \markdown_jekyll_data_push_address_segment:n
- { #1 }
- \seq_put_right:NV
- \g_@@_jekyll_data_datatypes_seq
- #2
- \markdown_jekyll_data_update_address_tls:
- }
-\cs_new:Nn \markdown_jekyll_data_pop:
- {
- \seq_pop_right:NN
- \g_@@_jekyll_data_wildcard_absolute_address_seq
- \l_tmpa_tl
- \seq_pop_right:NN
- \g_@@_jekyll_data_datatypes_seq
- \l_tmpa_tl
- \markdown_jekyll_data_update_address_tls:
- }
-% \end{macrocode}
-% \par
-% \begin{markdown}
-%
-% To interface with the user, we use `markdown/jekyllData` key--values from the
-% l3keys module of the \LaTeX3 kernel. The default setup will invoke the
-% \mref{title}, \mref{author}, and \mref{date} macros when scalar values for
-% keys that correspond to the `title`, `author`, and `date` relative wildcards
-% are encountered, respectively.
+% The default setup of \acro{yaml} metadata will invoke the \mref{title},
+% \mref{author}, and \mref{date} macros when scalar values for keys that
+% correspond to the `title`, `author`, and `date` relative wildcards are
+% encountered, respectively.
%
% \end{markdown}
% \begin{macrocode}
+\ExplSyntaxOn
\keys_define:nn
{ markdown/jekyllData }
{
@@ -21615,81 +23277,6 @@ end
% \end{macrocode}
% \begin{markdown}
%
-% To set a single key--value, we will use the
-% \mdef{markdown_jekyll_data_set_keyval:Nn} macro, ignoring unknown keys.
-% To set key--values for both absolute and relative wildcards, we will use the
-% \mdef{markdown_jekyll_data_set_keyvals:nn} macro.
-%
-% \end{markdown}
-% \begin{macrocode}
-\cs_new:Nn \markdown_jekyll_data_set_keyval:nn
- {
- \keys_set_known:nn
- { markdown/jekyllData }
- { { #1 } = { #2 } }
- }
-\cs_generate_variant:Nn
- \markdown_jekyll_data_set_keyval:nn
- { Vn }
-\cs_new:Nn \markdown_jekyll_data_set_keyvals:nn
- {
- \markdown_jekyll_data_push:nN
- { #1 }
- \c_@@_jekyll_data_scalar_tl
- \markdown_jekyll_data_set_keyval:Vn
- \g_@@_jekyll_data_wildcard_absolute_address_tl
- { #2 }
- \markdown_jekyll_data_set_keyval:Vn
- \g_@@_jekyll_data_wildcard_relative_address_tl
- { #2 }
- \markdown_jekyll_data_pop:
- }
-% \end{macrocode}
-% \par
-% \begin{markdown}
-%
-% Finally, we will register our macros as token renderer prototypes
-% to be able to react to the traversal of a \acro{yaml} document.
-%
-% \end{markdown}
-% \begin{macrocode}
-\markdownSetup{
- rendererPrototypes = {
- jekyllDataSequenceBegin = {
- \markdown_jekyll_data_push:nN
- { #1 }
- \c_@@_jekyll_data_sequence_tl
- },
- jekyllDataMappingBegin = {
- \markdown_jekyll_data_push:nN
- { #1 }
- \c_@@_jekyll_data_mapping_tl
- },
- jekyllDataSequenceEnd = {
- \markdown_jekyll_data_pop:
- },
- jekyllDataMappingEnd = {
- \markdown_jekyll_data_pop:
- },
- jekyllDataBoolean = {
- \markdown_jekyll_data_set_keyvals:nn
- { #1 }
- { #2 }
- },
- jekyllDataEmpty = { },
- jekyllDataNumber = {
- \markdown_jekyll_data_set_keyvals:nn
- { #1 }
- { #2 }
- },
- jekyllDataString = {
- \markdown_jekyll_data_set_keyvals:nn
- { #1 }
- { #2 }
- },
-% \end{macrocode}
-% \begin{markdown}
-%
% To complement the default setup of our key--values, we will use
% the \mref{maketitle} macro to typeset the title page of a document
% at the end of \acro{yaml} metadata. If we are in the preamble, we will wait
@@ -21698,12 +23285,12 @@ end
%
% \end{markdown}
% \begin{macrocode}
- },
-}
+% TODO: Remove the command definition in TeX Live 2021.
\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
\markdownSetup{
rendererPrototypes = {
jekyllDataEnd = {
+% TODO: Remove the else branch in TeX Live 2021.
\IfFormatAtLeastTF
{ 2020-10-01 }
{ \AddToHook{begindocument/end}{\maketitle} }
@@ -21720,7 +23307,6 @@ end
},
},
}
-
\ExplSyntaxOff
% \end{macrocode}
% \par