Closed Witiko closed 1 week ago
As shown in the CI from #506, this feature needs more time in the oven, since we don't want to protect renderers that are used outside typesetting such as the renderers used in tests:
We would need an interface along the following lines:
\markdownSetup{renderers/rendererPrototypes={name/glob (+)= {...}}}
defines protected commands by default.\markdownSetup{renderers/rendererPrototypes={!name/glob (+)= {...}}}
defines unprotected commands. This would be used in tests and in contexts where the renderers are not used for typesetting and/or need to expand.Of course, the prefix !
is arbitrary and can be replaced with a more intuitive signifier.
Alternatively, we could also add new top-level keys unprotectedRenderers
and unprotectedRendererPrototypes
. This would keep us from extending the already-overloaded syntax for renderer (prototype) names / blobs.
Furthermore, many default definitions from plain TeX are not protected in #506. We should likely replace all uses of \def
, \newcommand
, and similar in files markdownthemewitiko_markdown_defaults.tex
, markdownthemewitiko_markdown_defaults.sty
, and t-markdownthemewitiko_markdown_defaults.tex
with \cs_gset_protected:Npn
.
Markdown renderers and renderer prototypes may appear in the table of contents, floats, and notes. Therefore, they should be defined as protected by default.