diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/markdown')
3 files changed, 1523 insertions, 681 deletions
diff --git a/Master/texmf-dist/tex/generic/markdown/markdown.tex b/Master/texmf-dist/tex/generic/markdown/markdown.tex index 8ad545ea609..3f692d579e8 100644 --- a/Master/texmf-dist/tex/generic/markdown/markdown.tex +++ b/Master/texmf-dist/tex/generic/markdown/markdown.tex @@ -6,7 +6,7 @@ %% %% markdown.dtx (with options: `tex') %% -%% Copyright (C) 2016-2023 Vít Novotný +%% Copyright (C) 2016-2024 Vít Starý Novotný %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -16,7 +16,7 @@ %% http://www.latex-project.org/lppl.txt %% %% This work has the LPPL maintenance status `maintained'. -%% The Current Maintainer of this work is Vít Novotný. +%% The Current Maintainer of this work is Vít Starý Novotný. %% %% Send bug reports, requests for additions and questions %% either to the GitHub issue tracker at @@ -43,7 +43,7 @@ %% The names of the source files used are shown above. %% \ifx\ExplSyntaxOn\undefined - \input expl3-generic\relax + \input expl3-generic \fi \ExplSyntaxOn \seq_new:N \g__markdown_lua_options_seq @@ -321,6 +321,14 @@ } \seq_gput_right:Nn \g__markdown_cases_seq { __markdown_snake_case:N } \__markdown_add_lua_option:nnn + { eagerCache } + { boolean } + { false } +\__markdown_add_lua_option:nnn + { singletonCache } + { boolean } + { true } +\__markdown_add_lua_option:nnn { cacheDir } { path } { \markdownOptionOutputDir / _markdown_\jobname } @@ -337,6 +345,10 @@ { path } { \markdownOptionCacheDir / frozenCache.tex } \__markdown_add_lua_option:nnn + { autoIdentifiers } + { boolean } + { false } +\__markdown_add_lua_option:nnn { blankBeforeBlockquote } { boolean } { false } @@ -353,13 +365,17 @@ { boolean } { false } \__markdown_add_lua_option:nnn + { blankBeforeList } + { boolean } + { false } +\__markdown_add_lua_option:nnn { bracketedSpans } { boolean } { false } \__markdown_add_lua_option:nnn { breakableBlockquotes } { boolean } - { false } + { true } \__markdown_add_lua_option:nnn { citationNbsps } { boolean } @@ -377,6 +393,10 @@ { boolean } { false } \__markdown_add_lua_option:nnn + { contentLevel } + { string } + { block } +\__markdown_add_lua_option:nnn { debugExtensions } { boolean } { false } @@ -385,10 +405,6 @@ { boolean } { false } \__markdown_add_lua_option:nnn - { eagerCache } - { boolean } - { true } -\__markdown_add_lua_option:nnn { expectJekyllData } { boolean } { false } @@ -406,7 +422,7 @@ \__markdown_add_lua_option:nnn { fencedCode } { boolean } - { false } + { true } \__markdown_add_lua_option:nnn { fencedCodeAttributes } { boolean } @@ -424,7 +440,7 @@ { counter } { 0 } \__markdown_add_lua_option:nnn - { hardLineBreaks } + { gfmAutoIdentifiers } { boolean } { false } \__markdown_add_lua_option:nnn @@ -438,7 +454,7 @@ \__markdown_add_lua_option:nnn { html } { boolean } - { false } + { true } \__markdown_add_lua_option:nnn { hybrid } { boolean } @@ -448,10 +464,6 @@ { boolean } { false } \__markdown_add_lua_option:nnn - { inlineFootnotes } - { boolean } - { false } -\__markdown_add_lua_option:nnn { inlineNotes } { boolean } { false } @@ -468,7 +480,7 @@ { boolean } { false } \__markdown_add_lua_option:nnn - { footnotes } + { mark } { boolean } { false } \__markdown_add_lua_option:nnn @@ -482,7 +494,7 @@ \__markdown_add_lua_option:nnn { preserveTabs } { boolean } - { false } + { true } \__markdown_add_lua_option:nnn { rawAttribute } { boolean } @@ -524,6 +536,10 @@ { boolean } { false } \__markdown_add_lua_option:nnn + { tableAttributes } + { boolean } + { false } +\__markdown_add_lua_option:nnn { tableCaptions } { boolean } { false } @@ -556,17 +572,27 @@ { boolean } { true } \ExplSyntaxOff -\def\markdownLastModified{2023-04-27}% -\def\markdownVersion{2.23.0-0-g0b22f91}% +\def\markdownLastModified{2024-02-16}% +\def\markdownVersion{3.4.1-0-g457226ae}% \let\markdownBegin\relax \let\markdownEnd\relax \let\markdownInput\relax \let\markdownEscape\relax \ExplSyntaxOn +\tl_const:Nn \c__markdown_option_layer_plain_tex_tl { plain_tex } +\cs_generate_variant:Nn + \tl_const:Nn + { NV } +\tl_if_exist:NF + \c__markdown_top_layer_tl + { + \tl_const:NV + \c__markdown_top_layer_tl + \c__markdown_option_layer_plain_tex_tl + } \seq_new:N \g__markdown_plain_tex_options_seq \prop_new:N \g__markdown_plain_tex_option_types_prop \prop_new:N \g__markdown_default_plain_tex_options_prop -\tl_const:Nn \c__markdown_option_layer_plain_tex_tl { plain_tex } \seq_gput_right:NV \g__markdown_option_layers_seq \c__markdown_option_layer_plain_tex_tl \cs_new:Nn \__markdown_add_plain_tex_option:nnn @@ -577,46 +603,111 @@ { #2 } { #3 } } +\cs_new:Nn + \__markdown_setup:n + { + \keys_set:nn + { markdown/options } + { #1 } + } +\cs_gset_eq:NN + \markdownSetup + \__markdown_setup:n +\prg_new_conditional:Nnn + \__markdown_if_option:n + { TF, T, F } + { + \__markdown_get_option_type:nN + { #1 } + \l_tmpa_tl + \str_if_eq:NNF + \l_tmpa_tl + \c__markdown_option_type_boolean_tl + { + \msg_error:nnxx + { markdown } + { expected-boolean-option } + { #1 } + { \l_tmpa_tl } + } + \__markdown_get_option_value:nN + { #1 } + \l_tmpa_tl + \str_if_eq:NNTF + \l_tmpa_tl + \c__markdown_option_value_true_tl + { \prg_return_true: } + { \prg_return_false: } + } +\msg_new:nnn + { markdown } + { expected-boolean-option } + { + Option~#1~has~type~#2,~ + but~a~boolean~was~expected. + } +\let\markdownIfOption=\__markdown_if_option:nTF \__markdown_add_plain_tex_option:nnn { frozenCache } { boolean } { false } \__markdown_add_plain_tex_option:nnn - { helperScriptFileName } - { path } - { \jobname.markdown.lua } -\str_new:N - \g_luabridge_helper_script_filename_str -\tl_gset:Nn - \g_luabridge_helper_script_filename_str - { \markdownOptionHelperScriptFileName } -\__markdown_add_plain_tex_option:nnn { inputTempFileName } { path } { \jobname.markdown.in } -\__markdown_add_plain_tex_option:nnn - { outputTempFileName } +\cs_generate_variant:Nn + \__markdown_add_plain_tex_option:nnn + { nnV } +\ExplSyntaxOff +\input lt3luabridge.tex +\ExplSyntaxOn +\bool_if:nTF + { + \cs_if_exist_p:N + \luabridge_tl_set:Nn && + ( + \int_compare_p:nNn + { \g_luabridge_method_int } + = + { \c_luabridge_method_directlua_int } || + \sys_if_shell_unrestricted_p: + ) + } + { + \luabridge_tl_set:Nn + \l_tmpa_tl + { print(os.getenv("TEXMF_OUTPUT_DIRECTORY") or ".") } + } + { + \tl_set:Nn + \l_tmpa_tl + { . } + } +\__markdown_add_plain_tex_option:nnV + { outputDir } { path } - { \jobname.markdown.out } -\str_new:N - \g_luabridge_standard_output_filename_str -\tl_gset:Nn - \g_luabridge_standard_output_filename_str - { \markdownOptionOutputTempFileName } + \l_tmpa_tl \__markdown_add_plain_tex_option:nnn - { errorTempFileName } - { path } - { \jobname.markdown.err } -\str_new:N - \g_luabridge_error_output_filename_str -\tl_gset:Nn - \g_luabridge_error_output_filename_str - { \markdownOptionErrorTempFileName } + { plain } + { boolean } + { false } \__markdown_add_plain_tex_option:nnn - { outputDir } - { path } - { . } -\cs_new:Nn \__markdown_plain_tex_define_option_commands: + { noDefaults } + { boolean } + { false } +\seq_gput_right:Nn + \g__markdown_plain_tex_options_seq + { stripPercentSigns } +\prop_gput:Nnn + \g__markdown_plain_tex_option_types_prop + { stripPercentSigns } + { boolean } +\prop_gput:Nnx + \g__markdown_default_plain_tex_options_prop + { stripPercentSigns } + { false } +\cs_new:Nn + \__markdown_define_option_commands_and_keyvals: { \seq_map_inline:Nn \g__markdown_option_layers_seq @@ -624,19 +715,35 @@ \seq_map_inline:cn { g__markdown_ ##1 _options_seq } { - \__markdown_plain_tex_define_option_command:n + \__markdown_define_option_command:n + { ####1 } + \__markdown_with_various_cases:nn { ####1 } + { + \__markdown_define_option_keyval:nnn + { ##1 } + { ####1 } + { ########1 } + } } } } -\cs_new:Nn \__markdown_plain_tex_define_option_command:n +\cs_new:Nn + \__markdown_define_option_command:n { - \__markdown_get_default_option_value:nN - { #1 } - \l_tmpa_tl - \__markdown_set_option_value:nV + \__markdown_option_tl_to_csname:nN { #1 } \l_tmpa_tl + \cs_if_exist:cF + { \l_tmpa_tl } + { + \__markdown_get_default_option_value:nN + { #1 } + \l_tmpa_tl + \__markdown_set_option_value:nV + { #1 } + \l_tmpa_tl + } } \cs_new:Nn \__markdown_set_option_value:nn @@ -693,19 +800,376 @@ } } } -\__markdown_plain_tex_define_option_commands: -\seq_gput_right:Nn - \g__markdown_plain_tex_options_seq - { stripPercentSigns } -\prop_gput:Nnn - \g__markdown_plain_tex_option_types_prop - { stripPercentSigns } - { boolean } -\prop_gput:Nnx - \g__markdown_default_plain_tex_options_prop - { stripPercentSigns } - { false } -\ExplSyntaxOff +\cs_new:Nn + \__markdown_define_option_keyval:nnn + { + \prop_get:cnN + { g__markdown_ #1 _option_types_prop } + { #2 } + \l_tmpa_tl + \str_if_eq:VVTF + \l_tmpa_tl + \c__markdown_option_type_boolean_tl + { + \keys_define:nn + { markdown/options } + { + #3 .code:n = { + \tl_set:Nx + \l_tmpa_tl + { + \str_case:nnF + { ##1 } + { + { yes } { true } + { no } { false } + } + { ##1 } + } + \__markdown_set_option_value:nV + { #2 } + \l_tmpa_tl + }, + #3 .default:n = { true }, + } + } + { + \keys_define:nn + { markdown/options } + { + #3 .code:n = { + \__markdown_set_option_value:nn + { #2 } + { ##1 } + }, + } + } + \str_if_eq:VVT + \l_tmpa_tl + \c__markdown_option_type_clist_tl + { + \tl_set:Nn + \l_tmpa_tl + { #3 } + \tl_reverse:N + \l_tmpa_tl + \str_if_eq:enF + { + \tl_head:V + \l_tmpa_tl + } + { s } + { + \msg_error:nnn + { markdown } + { malformed-name-for-clist-option } + { #3 } + } + \tl_set:Nx + \l_tmpa_tl + { + \tl_tail:V + \l_tmpa_tl + } + \tl_reverse:N + \l_tmpa_tl + \tl_put_right:Nn + \l_tmpa_tl + { + .code:n = { + \__markdown_get_option_value:nN + { #2 } + \l_tmpa_tl + \clist_set:NV + \l_tmpa_clist + { \l_tmpa_tl, { ##1 } } + \__markdown_set_option_value:nV + { #2 } + \l_tmpa_clist + } + } + \keys_define:nV + { markdown/options } + \l_tmpa_tl + } + } +\cs_generate_variant:Nn + \clist_set:Nn + { NV } +\cs_generate_variant:Nn + \keys_define:nn + { nV } +\cs_generate_variant:Nn + \__markdown_set_option_value:nn + { nV } +\prg_generate_conditional_variant:Nnn + \str_if_eq:nn + { en } + { F } +\msg_new:nnn + { markdown } + { malformed-name-for-clist-option } + { + Clist~option~name~#1~does~not~end~with~-s. + } +\str_if_eq:VVT + \c__markdown_top_layer_tl + \c__markdown_option_layer_plain_tex_tl + { + \__markdown_define_option_commands_and_keyvals: + } +\keys_define:nn + { markdown/options } + { + theme .code:n = { + \__markdown_set_theme:n + { #1 } + }, + import .code:n = { + \tl_set:Nn + \l_tmpa_tl + { #1 } + \tl_replace_all:NnV + \l_tmpa_tl + { / } + \c_backslash_str + \keys_set:nV + { markdown/options/import } + \l_tmpa_tl + }, + } +\seq_new:N + \g__markdown_themes_seq +\tl_new:N + \g__markdown_current_theme_tl +\tl_gset:Nn + \g__markdown_current_theme_tl + { } +\seq_gput_right:NV + \g__markdown_themes_seq + \g__markdown_current_theme_tl +\cs_new:Nn + \__markdown_set_theme:n + { + \str_if_in:nnF + { #1 } + { / } + { + \msg_error:nnn + { markdown } + { unqualified-theme-name } + { #1 } + } + \str_if_in:nnT + { #1 } + { _ } + { + \msg_error:nnn + { markdown } + { underscores-in-theme-name } + { #1 } + } + \str_set:Nn + \l_tmpa_str + { #1 } + \str_replace_all:Nnn + \l_tmpa_str + { / } + { _ } + \tl_gset:Nn + \g__markdown_current_theme_tl + { #1 / } + \seq_gput_right:NV + \g__markdown_themes_seq + \g__markdown_current_theme_tl + \__markdown_load_theme:nV + { #1 } + \l_tmpa_str + \seq_gpop_right:NN + \g__markdown_themes_seq + \l_tmpa_tl + \seq_get_right:NN + \g__markdown_themes_seq + \l_tmpa_tl + \tl_gset:NV + \g__markdown_current_theme_tl + \l_tmpa_tl + } +\msg_new:nnnn + { markdown } + { unqualified-theme-name } + { Won't~load~theme~with~unqualified~name~#1 } + { Theme~names~must~contain~at~least~one~forward~slash } +\msg_new:nnnn + { markdown } + { underscores-in-theme-name } + { Won't~load~theme~with~an~underscore~in~its~name~#1 } + { Theme~names~must~not~contain~underscores~in~their~names } +\cs_generate_variant:Nn + \tl_replace_all:Nnn + { NnV } +\prop_new:N + \g__markdown_snippets_prop +\cs_new:Nn + \__markdown_setup_snippet:nn + { + \tl_if_empty:nT + { #1 } + { + \msg_error:nnn + { markdown } + { empty-snippet-name } + { #1 } + } + \tl_set:NV + \l_tmpa_tl + \g__markdown_current_theme_tl + \tl_put_right:Nn + \l_tmpa_tl + { #1 } + \__markdown_if_snippet_exists:nT + { #1 } + { + \msg_warning:nnV + { markdown } + { redefined-snippet } + \l_tmpa_tl + } + \prop_gput:NVn + \g__markdown_snippets_prop + \l_tmpa_tl + { #2 } + } +\cs_gset_eq:NN + \markdownSetupSnippet + \__markdown_setup_snippet:nn +\msg_new:nnnn + { markdown } + { empty-snippet-name } + { Empty~snippet~name~#1 } + { Pick~a~non-empty~name~for~your~snippet } +\msg_new:nnn + { markdown } + { redefined-snippet } + { Redefined~snippet~#1 } +\prg_new_conditional:Nnn + \__markdown_if_snippet_exists:n + { TF, T, F } + { + \tl_set:NV + \l_tmpa_tl + \g__markdown_current_theme_tl + \tl_put_right:Nn + \l_tmpa_tl + { #1 } + \prop_get:NVNTF + \g__markdown_snippets_prop + \l_tmpa_tl + \l_tmpb_tl + { \prg_return_true: } + { \prg_return_false: } + } +\cs_gset_eq:NN + \markdownIfSnippetExists + \__markdown_if_snippet_exists:nTF +\keys_define:nn + { markdown/options } + { + snippet .code:n = { + \tl_set:NV + \l_tmpa_tl + \g__markdown_current_theme_tl + \tl_put_right:Nn + \l_tmpa_tl + { #1 } + \__markdown_if_snippet_exists:nTF + { #1 } + { + \prop_get:NVN + \g__markdown_snippets_prop + \l_tmpa_tl + \l_tmpb_tl + \__markdown_setup:V + \l_tmpb_tl + } + { + \msg_error:nnV + { markdown } + { undefined-snippet } + \l_tmpa_tl + } + } + } +\msg_new:nnn + { markdown } + { undefined-snippet } + { Can't~invoke~undefined~snippet~#1 } +\cs_generate_variant:Nn + \__markdown_setup:n + { V } +\tl_new:N + \l__markdown_import_current_theme_tl +\keys_define:nn + { markdown/options/import } + { + unknown .default:n = {}, + unknown .code:n = { + \tl_set_eq:NN + \l__markdown_import_current_theme_tl + \l_keys_key_str + \tl_replace_all:NVn + \l__markdown_import_current_theme_tl + \c_backslash_str + { / } + \clist_map_inline:nn + { #1 } + { + \regex_extract_once:nnNTF + { ^(.*?)\s+as\s+(.*?)$ } + { ##1 } + \l_tmpa_seq + { + \seq_pop:NN + \l_tmpa_seq + \l_tmpa_tl + \seq_pop:NN + \l_tmpa_seq + \l_tmpa_tl + \seq_pop:NN + \l_tmpa_seq + \l_tmpb_tl + } + { + \tl_set:Nn + \l_tmpa_tl + { ##1 } + \tl_set:Nn + \l_tmpb_tl + { ##1 } + } + \tl_put_left:Nn + \l_tmpa_tl + { / } + \tl_put_left:NV + \l_tmpa_tl + \l__markdown_import_current_theme_tl + \__markdown_setup_snippet:Vx + \l_tmpb_tl + { snippet = { \l_tmpa_tl } } + } + \__markdown_set_theme:V + \l__markdown_import_current_theme_tl + }, + } +\cs_generate_variant:Nn + \tl_replace_all:Nnn + { NVn } +\cs_generate_variant:Nn + \__markdown_set_theme:n + { V } +\cs_generate_variant:Nn + \__markdown_setup_snippet:nn + { Vx } \ExplSyntaxOn \seq_new:N \g__markdown_renderers_seq \prop_new:N \g__markdown_renderer_arities_prop @@ -853,6 +1317,28 @@ { ulEndTight } { 0 } \ExplSyntaxOff +\def\markdownRendererCite{% + \markdownRendererCitePrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g__markdown_renderers_seq + { cite } +\prop_gput:Nnn + \g__markdown_renderer_arities_prop + { cite } + { 1 } +\ExplSyntaxOff +\def\markdownRendererTextCite{% + \markdownRendererTextCitePrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g__markdown_renderers_seq + { textCite } +\prop_gput:Nnn + \g__markdown_renderer_arities_prop + { textCite } + { 1 } +\ExplSyntaxOff \def\markdownRendererInputVerbatim{% \markdownRendererInputVerbatimPrototype}% \ExplSyntaxOn @@ -873,7 +1359,7 @@ \prop_gput:Nnn \g__markdown_renderer_arities_prop { inputFencedCode } - { 2 } + { 3 } \ExplSyntaxOff \def\markdownRendererCodeSpan{% \markdownRendererCodeSpanPrototype}% @@ -1205,28 +1691,6 @@ { inlineHtmlComment } { 1 } \ExplSyntaxOff -\def\markdownRendererBlockHtmlCommentBegin{% - \markdownRendererBlockHtmlCommentBeginPrototype}% -\ExplSyntaxOn -\seq_gput_right:Nn - \g__markdown_renderers_seq - { blockHtmlCommentBegin } -\prop_gput:Nnn - \g__markdown_renderer_arities_prop - { blockHtmlCommentBegin } - { 0 } -\ExplSyntaxOff -\def\markdownRendererBlockHtmlCommentEnd{% - \markdownRendererBlockHtmlCommentEndPrototype}% -\ExplSyntaxOn -\seq_gput_right:Nn - \g__markdown_renderers_seq - { blockHtmlCommentEnd } -\prop_gput:Nnn - \g__markdown_renderer_arities_prop - { blockHtmlCommentEnd } - { 0 } -\ExplSyntaxOff \def\markdownRendererInlineHtmlTag{% \markdownRendererInlineHtmlTagPrototype}% \ExplSyntaxOn @@ -1293,6 +1757,17 @@ { interblockSeparator } { 0 } \ExplSyntaxOff +\def\markdownRendererParagraphSeparator{% + \markdownRendererParagraphSeparatorPrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g__markdown_renderers_seq + { paragraphSeparator } +\prop_gput:Nnn + \g__markdown_renderer_arities_prop + { paragraphSeparator } + { 0 } +\ExplSyntaxOff \def\markdownRendererLineBlockBegin{% \markdownRendererLineBlockBeginPrototype}% \ExplSyntaxOn @@ -1315,43 +1790,20 @@ { lineBlockEnd } { 0 } \ExplSyntaxOff +\def\markdownRendererSoftLineBreak{% + \markdownRendererSoftLineBreakPrototype}% \ExplSyntaxOn -\cs_new:Npn - \markdownRendererHardLineBreak - { - \cs_if_exist:NTF - \markdownRendererLineBreak - { - \markdownWarning - { - Line~break~renderer~has~been~deprecated,~ - to~be~removed~in~Markdown~3.0.0 - } - \markdownRendererLineBreak - } - { - \cs_if_exist:NTF - \markdownRendererLineBreakPrototype - { - \markdownWarning - { - Line~break~renderer~prototype~has~been~deprecated,~ - to~be~removed~in~Markdown~3.0.0 - } - \markdownRendererLineBreakPrototype - } - { - \markdownRendererHardLineBreakPrototype - } - } - } \seq_gput_right:Nn \g__markdown_renderers_seq - { lineBreak } + { softLineBreak } \prop_gput:Nnn \g__markdown_renderer_arities_prop - { lineBreak } + { softLineBreak } { 0 } +\ExplSyntaxOff +\def\markdownRendererHardLineBreak{% + \markdownRendererHardLineBreakPrototype}% +\ExplSyntaxOn \seq_gput_right:Nn \g__markdown_renderers_seq { hardLineBreak } @@ -1393,6 +1845,17 @@ { linkAttributeContextEnd } { 0 } \ExplSyntaxOff +\def\markdownRendererMark{% + \markdownRendererMarkPrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g__markdown_renderers_seq + { mark } +\prop_gput:Nnn + \g__markdown_renderer_arities_prop + { mark } + { 1 } +\ExplSyntaxOff \def\markdownRendererDocumentBegin{% \markdownRendererDocumentBeginPrototype}% \ExplSyntaxOn @@ -1426,43 +1889,9 @@ { nbsp } { 0 } \ExplSyntaxOff +\def\markdownRendererNote{% + \markdownRendererNotePrototype}% \ExplSyntaxOn -\cs_new:Npn - \markdownRendererNote - { - \cs_if_exist:NTF - \markdownRendererFootnote - { - \markdownWarning - { - Footnote~renderer~has~been~deprecated,~ - to~be~removed~in~Markdown~3.0.0 - } - \markdownRendererFootnote - } - { - \cs_if_exist:NTF - \markdownRendererFootnotePrototype - { - \markdownWarning - { - Footnote~renderer~prototype~has~been~deprecated,~ - to~be~removed~in~Markdown~3.0.0 - } - \markdownRendererFootnotePrototype - } - { - \markdownRendererNotePrototype - } - } - } -\seq_gput_right:Nn - \g__markdown_renderers_seq - { footnote } -\prop_gput:Nnn - \g__markdown_renderer_arities_prop - { footnote } - { 1 } \seq_gput_right:Nn \g__markdown_renderers_seq { note } @@ -1625,17 +2054,6 @@ { fancyOlEndTight } { 0 } \ExplSyntaxOff -\def\markdownRendererCite{% - \markdownRendererCitePrototype}% -\ExplSyntaxOn -\seq_gput_right:Nn - \g__markdown_renderers_seq - { cite } -\prop_gput:Nnn - \g__markdown_renderer_arities_prop - { cite } - { 1 } -\ExplSyntaxOff \def\markdownRendererInputRawInline{% \markdownRendererInputRawInlinePrototype}% \ExplSyntaxOn @@ -1844,6 +2262,28 @@ { superscript } { 1 } \ExplSyntaxOff +\def\markdownRendererTableAttributeContextBegin{% + \markdownRendererTableAttributeContextBeginPrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g__markdown_renderers_seq + { tableAttributeContextBegin } +\prop_gput:Nnn + \g__markdown_renderer_arities_prop + { tableAttributeContextBegin } + { 0 } +\ExplSyntaxOff +\def\markdownRendererTableAttributeContextEnd{% + \markdownRendererTableAttributeContextEndPrototype}% +\ExplSyntaxOn +\seq_gput_right:Nn + \g__markdown_renderers_seq + { tableAttributeContextEnd } +\prop_gput:Nnn + \g__markdown_renderer_arities_prop + { tableAttributeContextEnd } + { 0 } +\ExplSyntaxOff \def\markdownRendererTable{% \markdownRendererTablePrototype}% \ExplSyntaxOn @@ -1877,54 +2317,9 @@ { displayMath } { 1 } \ExplSyntaxOff -\def\markdownRendererTextCite{% - \markdownRendererTextCitePrototype}% -\ExplSyntaxOn -\seq_gput_right:Nn - \g__markdown_renderers_seq - { textCite } -\prop_gput:Nnn - \g__markdown_renderer_arities_prop - { textCite } - { 1 } -\ExplSyntaxOff +\def\markdownRendererThematicBreak{% + \markdownRendererThematicBreakPrototype}% \ExplSyntaxOn -\cs_new:Npn - \markdownRendererThematicBreak - { - \cs_if_exist:NTF - \markdownRendererHorizontalRule - { - \markdownWarning - { - Horizontal~rule~renderer~has~been~deprecated,~ - to~be~removed~in~Markdown~3.0.0 - } - \markdownRendererHorizontalRule - } - { - \cs_if_exist:NTF - \markdownRendererHorizontalRulePrototype - { - \markdownWarning - { - Horizontal~rule~renderer~prototype~has~been~deprecated,~ - to~be~removed~in~Markdown~3.0.0 - } - \markdownRendererHorizontalRulePrototype - } - { - \markdownRendererThematicBreakPrototype - } - } - } -\seq_gput_right:Nn - \g__markdown_renderers_seq - { horizontalRule } -\prop_gput:Nnn - \g__markdown_renderer_arities_prop - { horizontalRule } - { 0 } \seq_gput_right:Nn \g__markdown_renderers_seq { thematicBreak } @@ -2075,41 +2470,27 @@ \g__markdown_renderer_arities_prop { jekyllDataEmpty } { 1 } -\ExplSyntaxOff -\ExplSyntaxOn -\keys_define:nn - { markdown/jekyllData } - { } -\ExplSyntaxOff -\ExplSyntaxOn -\cs_new:Nn \__markdown_plaintex_define_renderer_prototypes: +\cs_new:Nn \__markdown_define_renderers: { \seq_map_function:NN \g__markdown_renderers_seq - \__markdown_plaintex_define_renderer_prototype:n - \let\markdownRendererBlockHtmlCommentBeginPrototype=\iffalse - \let\markdownRendererBlockHtmlCommentBegin=\iffalse - \let\markdownRendererBlockHtmlCommentEndPrototype=\fi - \let\markdownRendererBlockHtmlCommentEnd=\fi - \cs_undefine:N \markdownRendererFootnote - \cs_undefine:N \markdownRendererFootnotePrototype - \cs_undefine:N \markdownRendererHorizontalRule - \cs_undefine:N \markdownRendererHorizontalRulePrototype - } -\cs_new:Nn \__markdown_plaintex_define_renderer_prototype:n + \__markdown_define_renderer:n + } +\cs_new:Nn \__markdown_define_renderer:n { - \__markdown_renderer_prototype_tl_to_csname:nN + \__markdown_renderer_tl_to_csname:nN { #1 } \l_tmpa_tl \prop_get:NnN \g__markdown_renderer_arities_prop { #1 } \l_tmpb_tl - \__markdown_plaintex_define_renderer_prototype:cV + \__markdown_define_renderer:ncV + { #1 } { \l_tmpa_tl } \l_tmpb_tl } -\cs_new:Nn \__markdown_renderer_prototype_tl_to_csname:nN +\cs_new:Nn \__markdown_renderer_tl_to_csname:nN { \tl_set:Nn \l_tmpa_tl @@ -2120,351 +2501,534 @@ markdownRenderer \tl_head:f { \l_tmpa_tl } \tl_tail:n { #1 } - Prototype } } -\cs_new:Nn \__markdown_plaintex_define_renderer_prototype:Nn +\tl_new:N + \l__markdown_renderer_definition_tl +\cs_new:Nn \__markdown_define_renderer:nNn { - \cs_generate_from_arg_count:NNnn - #1 - \cs_set:Npn - { #2 } - { } + \keys_define:nn + { markdown/options/renderers } + { + #1 .code:n = { + \tl_set:Nn + \l__markdown_renderer_definition_tl + { ##1 } + \regex_replace_all:nnN + { \cP\#0 } + { #1 } + \l__markdown_renderer_definition_tl + \cs_generate_from_arg_count:NNnV + #2 + \cs_set:Npn + { #3 } + \l__markdown_renderer_definition_tl + }, + } } \cs_generate_variant:Nn - \__markdown_plaintex_define_renderer_prototype:Nn - { cV } -\__markdown_plaintex_define_renderer_prototypes: -\ExplSyntaxOff -\let\markdownMakeOther\relax -\let\markdownReadAndConvert\relax -\begingroup - \catcode`\|=0\catcode`\\=12% - |gdef|markdownBegin{% - |markdownReadAndConvert{\markdownEnd}% - {|markdownEnd}}% -|endgroup -\ExplSyntaxOn -\cs_if_exist:NF - \markdownMode + \__markdown_define_renderer:nNn + { ncV } +\cs_generate_variant:Nn + \cs_generate_from_arg_count:NNnn + { NNnV } +\keys_define:nn + { markdown/options } + { + renderers .code:n = { + \keys_set:nn + { markdown/options/renderers } + { #1 } + }, + } +\prop_new:N + \g__markdown_glob_cache_prop +\tl_new:N + \l__markdown_current_glob_tl +\cs_new:Nn + \__markdown_glob_seq:nnN { - \file_if_exist:nTF - { lt3luabridge.tex } + \tl_set:Nn + \l__markdown_current_glob_tl + { ^ #1 $ } + \prop_get:NeNTF + \g__markdown_glob_cache_prop + { #2 / \l__markdown_current_glob_tl } + \l_tmpa_clist { - \cs_new:Npn - \markdownMode - { 3 } + \seq_set_from_clist:NN + #3 + \l_tmpa_clist } { - \cs_if_exist:NTF - \directlua - { - \cs_new:Npn - \markdownMode - { 2 } - } + \seq_clear:N + #3 + \regex_replace_all:nnN + { \* } + { .* } + \l__markdown_current_glob_tl + \regex_set:NV + \l_tmpa_regex + \l__markdown_current_glob_tl + \seq_map_inline:cn + { #2 } { - \cs_new:Npn - \markdownMode - { 0 } + \regex_match:NnT + \l_tmpa_regex + { ##1 } + { + \seq_put_right:Nn + #3 + { ##1 } + } } + \clist_set_from_seq:NN + \l_tmpa_clist + #3 + \prop_gput:NeV + \g__markdown_glob_cache_prop + { #2 / \l__markdown_current_glob_tl } + \l_tmpa_clist } } -\ExplSyntaxOff -\def\markdownLuaRegisterIBCallback#1{\relax}% -\def\markdownLuaUnregisterIBCallback#1{\relax}% -\ifx\markdownInfo\undefined - \def\markdownInfo#1{% - \immediate\write-1{(l.\the\inputlineno) markdown.tex info: #1.}}% -\fi -\ifx\markdownWarning\undefined - \def\markdownWarning#1{% - \immediate\write16{(l.\the\inputlineno) markdown.tex warning: #1}}% -\fi -\ifx\markdownError\undefined - \def\markdownError#1#2{% - \errhelp{#2.}% - \errmessage{(l.\the\inputlineno) markdown.tex error: #1}}% -\fi -\def\markdownRendererInterblockSeparatorPrototype{\par}% -\def\markdownRendererHardLineBreakPrototype{\hfil\break}% -\let\markdownRendererEllipsisPrototype\dots -\def\markdownRendererNbspPrototype{~}% -\def\markdownRendererLeftBracePrototype{\char`\{}% -\def\markdownRendererRightBracePrototype{\char`\}}% -\def\markdownRendererDollarSignPrototype{\char`$}% -\def\markdownRendererPercentSignPrototype{\char`\%}% -\def\markdownRendererAmpersandPrototype{\&}% -\def\markdownRendererUnderscorePrototype{\char`_}% -\def\markdownRendererHashPrototype{\char`\#}% -\def\markdownRendererCircumflexPrototype{\char`^}% -\def\markdownRendererBackslashPrototype{\char`\\}% -\def\markdownRendererTildePrototype{\char`~}% -\def\markdownRendererPipePrototype{|}% -\def\markdownRendererCodeSpanPrototype#1{{\tt#1}}% -\def\markdownRendererLinkPrototype#1#2#3#4{#2}% -\def\markdownRendererContentBlockPrototype#1#2#3#4{% - \markdownInput{#3}}% -\def\markdownRendererContentBlockOnlineImagePrototype{% - \markdownRendererImage}% -\def\markdownRendererContentBlockCodePrototype#1#2#3#4#5{% - \markdownRendererInputFencedCode{#3}{#2}}% -\def\markdownRendererImagePrototype#1#2#3#4{#2}% -\def\markdownRendererUlBeginPrototype{}% -\def\markdownRendererUlBeginTightPrototype{}% -\def\markdownRendererUlItemPrototype{}% -\def\markdownRendererUlItemEndPrototype{}% -\def\markdownRendererUlEndPrototype{}% -\def\markdownRendererUlEndTightPrototype{}% -\def\markdownRendererOlBeginPrototype{}% -\def\markdownRendererOlBeginTightPrototype{}% -\def\markdownRendererFancyOlBeginPrototype#1#2{\markdownRendererOlBegin}% -\def\markdownRendererFancyOlBeginTightPrototype#1#2{\markdownRendererOlBeginTight}% -\def\markdownRendererOlItemPrototype{}% -\def\markdownRendererOlItemWithNumberPrototype#1{}% -\def\markdownRendererOlItemEndPrototype{}% -\def\markdownRendererFancyOlItemPrototype{\markdownRendererOlItem}% -\def\markdownRendererFancyOlItemWithNumberPrototype{\markdownRendererOlItemWithNumber}% -\def\markdownRendererFancyOlItemEndPrototype{}% -\def\markdownRendererOlEndPrototype{}% -\def\markdownRendererOlEndTightPrototype{}% -\def\markdownRendererFancyOlEndPrototype{\markdownRendererOlEnd}% -\def\markdownRendererFancyOlEndTightPrototype{\markdownRendererOlEndTight}% -\def\markdownRendererDlBeginPrototype{}% -\def\markdownRendererDlBeginTightPrototype{}% -\def\markdownRendererDlItemPrototype#1{#1}% -\def\markdownRendererDlItemEndPrototype{}% -\def\markdownRendererDlDefinitionBeginPrototype{}% -\def\markdownRendererDlDefinitionEndPrototype{\par}% -\def\markdownRendererDlEndPrototype{}% -\def\markdownRendererDlEndTightPrototype{}% -\def\markdownRendererEmphasisPrototype#1{{\it#1}}% -\def\markdownRendererStrongEmphasisPrototype#1{{\bf#1}}% -\def\markdownRendererBlockQuoteBeginPrototype{\begingroup\it}% -\def\markdownRendererBlockQuoteEndPrototype{\endgroup\par}% -\def\markdownRendererLineBlockBeginPrototype{\begingroup\parindent=0pt}% -\def\markdownRendererLineBlockEndPrototype{\endgroup}% -\def\markdownRendererInputVerbatimPrototype#1{% - \par{\tt\input#1\relax{}}\par}% -\def\markdownRendererInputFencedCodePrototype#1#2{% - \markdownRendererInputVerbatim{#1}}% -\def\markdownRendererHeadingOnePrototype#1{#1}% -\def\markdownRendererHeadingTwoPrototype#1{#1}% -\def\markdownRendererHeadingThreePrototype#1{#1}% -\def\markdownRendererHeadingFourPrototype#1{#1}% -\def\markdownRendererHeadingFivePrototype#1{#1}% -\def\markdownRendererHeadingSixPrototype#1{#1}% -\def\markdownRendererThematicBreakPrototype{}% -\def\markdownRendererNotePrototype#1{#1}% -\def\markdownRendererCitePrototype#1{}% -\def\markdownRendererTextCitePrototype#1{}% -\def\markdownRendererTickedBoxPrototype{[X]}% -\def\markdownRendererHalfTickedBoxPrototype{[/]}% -\def\markdownRendererUntickedBoxPrototype{[ ]}% -\def\markdownRendererStrikeThroughPrototype#1{#1}% -\def\markdownRendererSuperscriptPrototype#1{#1}% -\def\markdownRendererSubscriptPrototype#1{#1}% -\def\markdownRendererDisplayMathPrototype#1{$$#1$$}% -\def\markdownRendererInlineMathPrototype#1{$#1$}% -\ExplSyntaxOn -\cs_gset:Npn - \markdownRendererHeaderAttributeContextBeginPrototype - { - \group_begin: - \color_group_begin: - } -\cs_gset:Npn - \markdownRendererHeaderAttributeContextEndPrototype - { - \color_group_end: - \group_end: +\prg_generate_conditional_variant:Nnn + \prop_get:NnN + { NeN } + { TF } +\cs_generate_variant:Nn + \regex_set:Nn + { NV } +\cs_generate_variant:Nn + \prop_gput:Nnn + { NeV } +\seq_new:N + \l__markdown_renderer_glob_results_seq +\keys_define:nn + { markdown/options/renderers } + { + unknown .code:n = { + \__markdown_glob_seq:VnN + \l_keys_key_str + { g__markdown_renderers_seq } + \l__markdown_renderer_glob_results_seq + \seq_if_empty:NTF + \l__markdown_renderer_glob_results_seq + { + \msg_error:nnV + { markdown } + { undefined-renderer } + \l_keys_key_str + } + { + \tl_set:Nn + \l__markdown_renderer_definition_tl + { #1 } + \seq_map_inline:Nn + \l__markdown_renderer_glob_results_seq + { + \__markdown_renderer_tl_to_csname:nN + { ##1 } + \l_tmpa_tl + \prop_get:NnN + \g__markdown_renderer_arities_prop + { ##1 } + \l_tmpb_tl + \int_set:Nn + \l_tmpa_int + \l_tmpb_tl + \tl_set:NV + \l_tmpb_tl + \l__markdown_renderer_definition_tl + \regex_replace_all:nnN + { \cP\#0 } + { ##1 } + \l_tmpb_tl + \cs_generate_from_arg_count:cNVV + { \l_tmpa_tl } + \cs_set:Npn + \l_tmpa_int + \l_tmpb_tl + } + } + }, } -\cs_gset_eq:NN - \markdownRendererBracketedSpanAttributeContextBeginPrototype - \markdownRendererHeaderAttributeContextBeginPrototype -\cs_gset_eq:NN - \markdownRendererBracketedSpanAttributeContextEndPrototype - \markdownRendererHeaderAttributeContextEndPrototype -\cs_gset_eq:NN - \markdownRendererFencedDivAttributeContextBeginPrototype - \markdownRendererHeaderAttributeContextBeginPrototype -\cs_gset_eq:NN - \markdownRendererFencedDivAttributeContextEndPrototype - \markdownRendererHeaderAttributeContextEndPrototype -\cs_gset_eq:NN - \markdownRendererFencedCodeAttributeContextBeginPrototype - \markdownRendererHeaderAttributeContextBeginPrototype -\cs_gset_eq:NN - \markdownRendererFencedCodeAttributeContextEndPrototype - \markdownRendererHeaderAttributeContextEndPrototype -\cs_gset:Npn - \markdownRendererReplacementCharacterPrototype +\msg_new:nnn + { markdown } + { undefined-renderer } { - % TODO: Replace with `\codepoint_generate:nn` in TeX Live 2023 - \sys_if_engine_pdftex:TF - { ^^ef^^bf^^bd } - { ^^^^fffd } + Renderer~#1~is~undefined. } -\ExplSyntaxOff -\def\markdownRendererSectionBeginPrototype{}% -\def\markdownRendererSectionEndPrototype{}% -\ExplSyntaxOn -\cs_new:Nn - \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn +\cs_generate_variant:Nn + \__markdown_glob_seq:nnN + { VnN } +\cs_generate_variant:Nn + \cs_generate_from_arg_count:NNnn + { cNVV } +\cs_generate_variant:Nn + \msg_error:nnn + { nnV } +\str_if_eq:VVT + \c__markdown_top_layer_tl + \c__markdown_option_layer_plain_tex_tl { - \str_case:nn - { #2 } - { - { md } { \markdownInput{#1} } - { tex } { \markdownEscape{#1} \unskip } - } + \__markdown_define_renderers: } -\cs_new:Nn - \__markdown_plain_tex_default_input_raw_block_renderer_prototype:nn +\keys_define:nn + { markdown/jekyllData } + { } +\__markdown_with_various_cases:nn + { jekyllDataRenderers } { - \str_case:nn - { #2 } + \keys_define:nn + { markdown/options } { - { md } { \markdownInput{#1} } - { tex } { \markdownEscape{#1} } + #1 .code:n = { + \tl_set:Nn + \l_tmpa_tl + { ##1 } + \tl_replace_all:NnV + \l_tmpa_tl + { / } + \c_backslash_str + \keys_set:nV + { markdown/options/jekyll-data-renderers } + \l_tmpa_tl + }, } } -\cs_gset:Npn - \markdownRendererInputRawInlinePrototype#1#2 +\keys_define:nn + { markdown/options/jekyll-data-renderers } { - \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn - { #1 } - { #2 } + unknown .code:n = { + \tl_set_eq:NN + \l_tmpa_tl + \l_keys_key_str + \tl_replace_all:NVn + \l_tmpa_tl + \c_backslash_str + { / } + \tl_put_right:Nn + \l_tmpa_tl + { + .code:n = { #1 } + } + \keys_define:nV + { markdown/jekyllData } + \l_tmpa_tl + } } -\cs_gset:Npn - \markdownRendererInputRawBlockPrototype#1#2 +\cs_generate_variant:Nn + \keys_define:nn + { nV } +\cs_new:Nn \__markdown_define_renderer_prototypes: { - \__markdown_plain_tex_default_input_raw_block_renderer_prototype:nn + \seq_map_function:NN + \g__markdown_renderers_seq + \__markdown_define_renderer_prototype:n + } +\cs_new:Nn \__markdown_define_renderer_prototype:n + { + \__markdown_renderer_prototype_tl_to_csname:nN { #1 } - { #2 } + \l_tmpa_tl + \prop_get:NnN + \g__markdown_renderer_arities_prop + { #1 } + \l_tmpb_tl + \__markdown_define_renderer_prototype:ncV + { #1 } + { \l_tmpa_tl } + \l_tmpb_tl } -\ExplSyntaxOff -\ExplSyntaxOn -\seq_new:N \g__markdown_jekyll_data_datatypes_seq -\tl_const:Nn \c__markdown_jekyll_data_sequence_tl { sequence } -\tl_const:Nn \c__markdown_jekyll_data_mapping_tl { mapping } -\tl_const:Nn \c__markdown_jekyll_data_scalar_tl { scalar } -\seq_new:N \g__markdown_jekyll_data_wildcard_absolute_address_seq -\cs_new:Nn \markdown_jekyll_data_push_address_segment:n +\cs_new:Nn \__markdown_renderer_prototype_tl_to_csname:nN { - \seq_if_empty:NF - \g__markdown_jekyll_data_datatypes_seq + \tl_set:Nn + \l_tmpa_tl + { \str_uppercase:n { #1 } } + \tl_set:Nx + #2 { - \seq_get_right:NN - \g__markdown_jekyll_data_datatypes_seq - \l_tmpa_tl - \str_if_eq:NNTF - \l_tmpa_tl - \c__markdown_jekyll_data_sequence_tl + markdownRenderer + \tl_head:f { \l_tmpa_tl } + \tl_tail:n { #1 } + Prototype + } + } +\tl_new:N + \l__markdown_renderer_prototype_definition_tl +\cs_new:Nn \__markdown_define_renderer_prototype:nNn + { + \keys_define:nn + { markdown/options/renderer-prototypes } + { + #1 .code:n = { + \tl_set:Nn + \l__markdown_renderer_prototype_definition_tl + { ##1 } + \regex_replace_all:nnN + { \cP\#0 } + { #1 } + \l__markdown_renderer_prototype_definition_tl + \cs_generate_from_arg_count:NNnV + #2 + \cs_set:Npn + { #3 } + \l__markdown_renderer_prototype_definition_tl + }, + } + \cs_if_free:NT + #2 + { + \cs_generate_from_arg_count:NNnn + #2 + \cs_set:Npn + { #3 } + { } + } + } +\cs_generate_variant:Nn + \__markdown_define_renderer_prototype:nNn + { ncV } +\seq_new:N + \l__markdown_renderer_prototype_glob_results_seq +\keys_define:nn + { markdown/options/renderer-prototypes } + { + unknown .code:n = { + \__markdown_glob_seq:VnN + \l_keys_key_str + { g__markdown_renderers_seq } + \l__markdown_renderer_prototype_glob_results_seq + \seq_if_empty:NTF + \l__markdown_renderer_prototype_glob_results_seq { - \seq_put_right:Nn - \g__markdown_jekyll_data_wildcard_absolute_address_seq - { * } + \msg_error:nnV + { markdown } + { undefined-renderer-prototype } + \l_keys_key_str } { - \seq_put_right:Nn - \g__markdown_jekyll_data_wildcard_absolute_address_seq + \tl_set:Nn + \l__markdown_renderer_prototype_definition_tl { #1 } + \seq_map_inline:Nn + \l__markdown_renderer_prototype_glob_results_seq + { + \__markdown_renderer_prototype_tl_to_csname:nN + { ##1 } + \l_tmpa_tl + \prop_get:NnN + \g__markdown_renderer_arities_prop + { ##1 } + \l_tmpb_tl + \int_set:Nn + \l_tmpa_int + \l_tmpb_tl + \tl_set:NV + \l_tmpb_tl + \l__markdown_renderer_prototype_definition_tl + \regex_replace_all:nnN + { \cP\#0 } + { ##1 } + \l_tmpb_tl + \cs_generate_from_arg_count:cNVV + { \l_tmpa_tl } + \cs_set:Npn + \l_tmpa_int + \l_tmpb_tl + } } + }, + } +\msg_new:nnn + { markdown } + { undefined-renderer-prototype } + { + Renderer~prototype~#1~is~undefined. + } +\__markdown_with_various_cases:nn + { rendererPrototypes } + { + \keys_define:nn + { markdown/options } + { + #1 .code:n = { + \keys_set:nn + { markdown/options/renderer-prototypes } + { ##1 } + }, } } -\tl_new:N \g__markdown_jekyll_data_wildcard_absolute_address_tl -\tl_new:N \g__markdown_jekyll_data_wildcard_relative_address_tl -\cs_new:Nn \markdown_jekyll_data_concatenate_address:NN +\str_if_eq:VVT + \c__markdown_top_layer_tl + \c__markdown_option_layer_plain_tex_tl { - \seq_pop_left:NN #1 \l_tmpa_tl - \tl_set:Nx #2 { / \seq_use:Nn #1 { / } } - \seq_put_left:NV #1 \l_tmpa_tl + \__markdown_define_renderer_prototypes: } -\cs_new:Nn \markdown_jekyll_data_update_address_tls: +\ExplSyntaxOff +\let\markdownMakeOther\relax +\let\markdownReadAndConvert\relax +\begingroup + \catcode`\|=0\catcode`\\=12% + |gdef|markdownBegin{% + |markdownReadAndConvert{\markdownEnd}% + {|markdownEnd}}% +|endgroup +\ExplSyntaxOn +\keys_define:nn + { markdown/options } { - \markdown_jekyll_data_concatenate_address:NN - \g__markdown_jekyll_data_wildcard_absolute_address_seq - \g__markdown_jekyll_data_wildcard_absolute_address_tl - \seq_get_right:NN - \g__markdown_jekyll_data_wildcard_absolute_address_seq - \g__markdown_jekyll_data_wildcard_relative_address_tl + code .code:n = { #1 }, } -\cs_new:Nn \markdown_jekyll_data_push:nN +\cs_if_free:NT + \markdownInfo { - \markdown_jekyll_data_push_address_segment:n - { #1 } - \seq_put_right:NV - \g__markdown_jekyll_data_datatypes_seq - #2 - \markdown_jekyll_data_update_address_tls: + \cs_new:Npn + \markdownInfo #1 + { + \msg_info:nne + { markdown } + { generic-message } + { #1 } + } } -\cs_new:Nn \markdown_jekyll_data_pop: +\cs_if_free:NT + \markdownWarning { - \seq_pop_right:NN - \g__markdown_jekyll_data_wildcard_absolute_address_seq - \l_tmpa_tl - \seq_pop_right:NN - \g__markdown_jekyll_data_datatypes_seq - \l_tmpa_tl - \markdown_jekyll_data_update_address_tls: + \cs_new:Npn + \markdownWarning #1 + { + \msg_warning:nne + { markdown } + { generic-message } + { #1 } + } } -\cs_new:Nn \markdown_jekyll_data_set_keyval:nn +\cs_if_free:NT + \markdownError { - \keys_set_known:nn - { markdown/jekyllData } - { { #1 } = { #2 } } + \cs_new:Npn + \markdownError #1 #2 + { + \msg_error:nnee + { markdown } + { generic-message-with-help-text } + { #1 } + { #2 } + } } +\msg_new:nnn + { markdown } + { generic-message } + { #1 } +\msg_new:nnnn + { markdown } + { generic-message-with-help-text } + { #1 } + { #2 } \cs_generate_variant:Nn - \markdown_jekyll_data_set_keyval:nn - { Vn } -\cs_new:Nn \markdown_jekyll_data_set_keyvals:nn + \msg_info:nnn + { nne } +\cs_generate_variant:Nn + \msg_warning:nnn + { nne } +\cs_generate_variant:Nn + \msg_error:nnnn + { nnee } +\prop_new:N \g__markdown_plain_tex_loaded_themes_linenos_prop +\cs_new:Nn + \__markdown_plain_tex_load_theme:nn { - \markdown_jekyll_data_push:nN + \prop_get:NnNTF + \g__markdown_plain_tex_loaded_themes_linenos_prop { #1 } - \c__markdown_jekyll_data_scalar_tl - \markdown_jekyll_data_set_keyval:Vn - \g__markdown_jekyll_data_wildcard_absolute_address_tl - { #2 } - \markdown_jekyll_data_set_keyval:Vn - \g__markdown_jekyll_data_wildcard_relative_address_tl - { #2 } - \markdown_jekyll_data_pop: - } -\def\markdownRendererJekyllDataSequenceBeginPrototype#1#2{ - \markdown_jekyll_data_push:nN - { #1 } - \c__markdown_jekyll_data_sequence_tl -} -\def\markdownRendererJekyllDataMappingBeginPrototype#1#2{ - \markdown_jekyll_data_push:nN - { #1 } - \c__markdown_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 -\ExplSyntaxOn + \l_tmpa_tl + { + \msg_warning:nnnV + { markdown } + { repeatedly-loaded-plain-tex-theme } + { #1 } + \l_tmpa_tl + } + { + \msg_info:nnn + { markdown } + { loading-plain-tex-theme } + { #1 } + \prop_gput:Nnx + \g__markdown_plain_tex_loaded_themes_linenos_prop + { #1 } + { \tex_the:D \tex_inputlineno:D } + \file_input:n + { markdown theme #2 } + } + } +\msg_new:nnn + { markdown } + { loading-plain-tex-theme } + { Loading~plain~TeX~Markdown~theme~#1 } +\msg_new:nnn + { markdown } + { repeatedly-loaded-plain-tex-theme } + { + Plain~TeX~Markdown~theme~#1~was~previously~ + loaded~on~line~#2,~not~loading~it~again + } +\cs_generate_variant:Nn + \prop_gput:Nnn + { Nnx } +\cs_gset_eq:NN + \__markdown_load_theme:nn + \__markdown_plain_tex_load_theme:nn +\cs_generate_variant:Nn + \__markdown_load_theme:nn + { nV } +\cs_new:Npn + \markdownLoadPlainTeXTheme + { + \tl_set:NV + \l_tmpa_tl + \g__markdown_current_theme_tl + \tl_reverse:N + \l_tmpa_tl + \tl_set:Ne + \l_tmpb_tl + { + \tl_tail:V + \l_tmpa_tl + } + \tl_reverse:N + \l_tmpb_tl + \str_set:NV + \l_tmpa_str + \l_tmpb_tl + \str_replace_all:Nnn + \l_tmpa_str + { / } + { _ } + \__markdown_plain_tex_load_theme:VV + \l_tmpb_tl + \l_tmpa_str + } +\cs_generate_variant:Nn + \tl_set:Nn + { Ne } +\cs_generate_variant:Nn + \__markdown_plain_tex_load_theme:nn + { VV } +\str_if_eq:VVT + \c__markdown_top_layer_tl + \c__markdown_option_layer_plain_tex_tl + { + \ExplSyntaxOff + \__markdown_if_option:nF + { noDefaults } + { + \__markdown_setup:n + {theme = witiko/markdown/defaults} + } + \ExplSyntaxOn + } \tl_new:N \g__markdown_formatted_lua_options_tl \cs_new:Nn \__markdown_format_lua_options: { @@ -2550,42 +3114,9 @@ local md = require("markdown") local convert = md.new(\markdownLuaOptions) }% -\ExplSyntaxOn -\prg_new_conditional:Nnn - \__markdown_if_option:n - { TF, T, F } - { - \__markdown_get_option_type:nN - { #1 } - \l_tmpa_tl - \str_if_eq:NNF - \l_tmpa_tl - \c__markdown_option_type_boolean_tl - { - \msg_error:nnxx - { markdown } - { expected-boolean-option } - { #1 } - { \l_tmpa_tl } - } - \__markdown_get_option_value:nN - { #1 } - \l_tmpa_tl - \str_if_eq:NNTF - \l_tmpa_tl - \c__markdown_option_value_true_tl - { \prg_return_true: } - { \prg_return_false: } - } -\msg_new:nnn - { markdown } - { expected-boolean-option } - { - Option~#1~has~type~#2,~ - but~a~boolean~was~expected. - } -\let\markdownIfOption=\__markdown_if_option:nTF -\ExplSyntaxOff +\def\markdownCleanup{% + lfs.rmdir(cacheDir) +}% \csname newread\endcsname\markdownInputFileStream \csname newwrite\endcsname\markdownOutputFileStream \begingroup @@ -2656,118 +3187,54 @@ ^^M}@ |endgroup \ExplSyntaxOn -\int_compare:nT - { \markdownMode = 3 } +\cs_new:Npn + \markdownLuaExecute + #1 { - \markdownInfo{Using~mode~3:~The~lt3luabridge~package} - \file_input:n { lt3luabridge.tex } - \cs_new:Npn - \markdownLuaExecute - { \luabridgeExecute } + \int_compare:nNnT + { \g_luabridge_method_int } + = + { \c_luabridge_method_shell_int } + { + \sys_if_shell_unrestricted:F + { + \sys_if_shell:TF + { + \msg_error:nn + { markdown } + { restricted-shell-access } + } + { + \msg_error:nn + { markdown } + { disabled-shell-access } + } + } + } + \luabridge_now:e + { #1 } } +\cs_generate_variant:Nn + \msg_new:nnnn + { nnnV } +\tl_set:Nn + \l_tmpa_tl + { + You~may~need~to~run~TeX~with~the~--shell-escape~or~the~ + --enable-write18~flag,~or~write~shell_escape=t~in~the~ + texmf.cnf~file. + } +\msg_new:nnnV + { markdown } + { restricted-shell-access } + { Shell~escape~is~restricted } + \l_tmpa_tl +\msg_new:nnnV + { markdown } + { disabled-shell-access } + { Shell~escape~is~disabled } + \l_tmpa_tl \ExplSyntaxOff -\ifnum\markdownMode<2\relax -\ifnum\markdownMode=0\relax - \markdownWarning{Using mode 0: Shell escape via write18 - (deprecated, to be removed in Markdown 3.0.0)}% -\else - \markdownWarning{Using mode 1: Shell escape via os.execute - (deprecated, to be removed in Markdown 3.0.0)}% -\fi -\ifx\pdfshellescape\undefined - \ifx\shellescape\undefined - \ifnum\markdownMode=0\relax - \def\markdownExecuteShellEscape{1}% - \else - \def\markdownExecuteShellEscape{% - \directlua{tex.sprint(status.shell_escape or "1")}}% - \fi - \else - \let\markdownExecuteShellEscape\shellescape - \fi -\else - \let\markdownExecuteShellEscape\pdfshellescape -\fi -\ifnum\markdownMode=0\relax - \def\markdownExecuteDirect#1{\immediate\write18{#1}}% -\else - \def\markdownExecuteDirect#1{% - \directlua{os.execute("\luaescapestring{#1}")}}% -\fi -\def\markdownExecute#1{% - \ifnum\markdownExecuteShellEscape=1\relax - \markdownExecuteDirect{#1}% - \else - \markdownError{I can not access the shell}{Either run the TeX - compiler with the --shell-escape or the --enable-write18 flag, - or set shell_escape=t in the texmf.cnf file}% - \fi}% -\begingroup - \catcode`|=0% - \catcode`\\=12% - |gdef|markdownLuaExecute#1{% - |immediate|openout|markdownOutputFileStream=% - |markdownOptionHelperScriptFileName - |markdownInfo{Writing a helper Lua script to the file - "|markdownOptionHelperScriptFileName"}% - |immediate|write|markdownOutputFileStream{% - local ran_ok, error = pcall(function() - local kpse - (function() - local should_initialize = package.loaded.kpse == nil - or tex.initialize - local ran_ok - ran_ok, kpse = pcall(require, "kpse") - if ran_ok and should_initialize then - kpse.set_program_name("luatex") - end - end)() - #1 - end) - if not ran_ok then - local file = io.open("% - |markdownOptionOutputDir - /|markdownOptionErrorTempFileName", "w") - if file then - file:write(error .. "\n") - file:close() - end - print('\\markdownError{An error was encountered while executing - Lua code}{For further clues, examine the file - "|markdownOptionOutputDir - /|markdownOptionErrorTempFileName"}') - end}% - |immediate|closeout|markdownOutputFileStream - |markdownInfo{Executing a helper Lua script from the file - "|markdownOptionHelperScriptFileName" and storing the result in the - file "|markdownOptionOutputTempFileName"}% - |markdownExecute{texlua "|markdownOptionOutputDir - /|markdownOptionHelperScriptFileName" > % - "|markdownOptionOutputDir - /|markdownOptionOutputTempFileName"}% - |input|markdownOptionOutputTempFileName|relax}% -|endgroup -\fi -\ifnum\markdownMode=2\relax - \markdownWarning{Using mode 2: Direct Lua access - (deprecated, to be removed in Markdown 3.0.0)}% -\begingroup - \catcode`|=0% - \catcode`\\=12% - |gdef|markdownLuaExecute#1{% - |directlua{% - local function print(input) - local output = {} - for line in input:gmatch("[^\r\n]+") do - table.insert(output, line) - end - tex.print(output) - end - #1 - }% - }% -|endgroup -\fi \begingroup \catcode`|=0% \catcode`\\=12% @@ -2797,8 +3264,10 @@ [[Could not open file "&1" for reading]]) local input = assert(file:read("*a")) assert(file:close()) - print(convert(input))}% - |global|advance|markdownOptionFrozenCacheCounter by 1|relax + print(convert(input)) + |markdownCleanup}% + |markdownIfOption{finalizeCache}{% + |global|advance|markdownOptionFrozenCacheCounter by 1|relax}{}% }% |endgroup }% diff --git a/Master/texmf-dist/tex/generic/markdown/markdownthemewitiko_markdown_defaults.tex b/Master/texmf-dist/tex/generic/markdown/markdownthemewitiko_markdown_defaults.tex new file mode 100644 index 00000000000..dc8a90917f6 --- /dev/null +++ b/Master/texmf-dist/tex/generic/markdown/markdownthemewitiko_markdown_defaults.tex @@ -0,0 +1,321 @@ +%% +%% This is file `markdownthemewitiko_markdown_defaults.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% markdown.dtx (with options: `themes-witiko-markdown-defaults-tex') +%% +%% Copyright (C) 2016-2024 Vít Starý Novotný +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work has the LPPL maintenance status `maintained'. +%% The Current Maintainer of this work is Vít Starý Novotný. +%% +%% Send bug reports, requests for additions and questions +%% either to the GitHub issue tracker at +%% +%% https://github.com/Witiko/markdown/issues +%% +%% or to the e-mail address <witiko@mail.muni.cz>. +%% +%% MODIFICATION ADVICE: +%% +%% If you want to customize this file, it is best to make a copy of +%% the source file(s) from which it was produced. Use a different +%% name for your copy(ies) and modify the copy(ies); this will ensure +%% that your modifications do not get overwritten when you install a +%% new release of the standard system. You should also ensure that +%% your modified source file does not generate any modified file with +%% the same name as a standard file. +%% +%% You will also need to produce your own, suitably named, .ins file to +%% control the generation of files from your source file; this file +%% should contain your own preambles for the files it generates, not +%% those in the standard .ins files. +%% +%% The names of the source files used are shown above. +%% +\def\markdownRendererInterblockSeparatorPrototype{\par}% +\def\markdownRendererParagraphSeparatorPrototype{% + \markdownRendererInterblockSeparator}% +\def\markdownRendererHardLineBreakPrototype{\hfil\break}% +\def\markdownRendererSoftLineBreakPrototype{ }% +\let\markdownRendererEllipsisPrototype\dots +\def\markdownRendererNbspPrototype{~}% +\def\markdownRendererLeftBracePrototype{\char`\{}% +\def\markdownRendererRightBracePrototype{\char`\}}% +\def\markdownRendererDollarSignPrototype{\char`$}% +\def\markdownRendererPercentSignPrototype{\char`\%}% +\def\markdownRendererAmpersandPrototype{\&}% +\def\markdownRendererUnderscorePrototype{\char`_}% +\def\markdownRendererHashPrototype{\char`\#}% +\def\markdownRendererCircumflexPrototype{\char`^}% +\def\markdownRendererBackslashPrototype{\char`\\}% +\def\markdownRendererTildePrototype{\char`~}% +\def\markdownRendererPipePrototype{|}% +\def\markdownRendererCodeSpanPrototype#1{{\tt#1}}% +\def\markdownRendererLinkPrototype#1#2#3#4{#2}% +\def\markdownRendererContentBlockPrototype#1#2#3#4{% + \markdownInput{#3}}% +\def\markdownRendererContentBlockOnlineImagePrototype{% + \markdownRendererImage}% +\def\markdownRendererContentBlockCodePrototype#1#2#3#4#5{% + \markdownRendererInputFencedCode{#3}{#2}{#2}}% +\def\markdownRendererImagePrototype#1#2#3#4{#2}% +\def\markdownRendererUlBeginPrototype{}% +\def\markdownRendererUlBeginTightPrototype{}% +\def\markdownRendererUlItemPrototype{}% +\def\markdownRendererUlItemEndPrototype{}% +\def\markdownRendererUlEndPrototype{}% +\def\markdownRendererUlEndTightPrototype{}% +\def\markdownRendererOlBeginPrototype{}% +\def\markdownRendererOlBeginTightPrototype{}% +\def\markdownRendererFancyOlBeginPrototype#1#2{\markdownRendererOlBegin}% +\def\markdownRendererFancyOlBeginTightPrototype#1#2{\markdownRendererOlBeginTight}% +\def\markdownRendererOlItemPrototype{}% +\def\markdownRendererOlItemWithNumberPrototype#1{}% +\def\markdownRendererOlItemEndPrototype{}% +\def\markdownRendererFancyOlItemPrototype{\markdownRendererOlItem}% +\def\markdownRendererFancyOlItemWithNumberPrototype{\markdownRendererOlItemWithNumber}% +\def\markdownRendererFancyOlItemEndPrototype{}% +\def\markdownRendererOlEndPrototype{}% +\def\markdownRendererOlEndTightPrototype{}% +\def\markdownRendererFancyOlEndPrototype{\markdownRendererOlEnd}% +\def\markdownRendererFancyOlEndTightPrototype{\markdownRendererOlEndTight}% +\def\markdownRendererDlBeginPrototype{}% +\def\markdownRendererDlBeginTightPrototype{}% +\def\markdownRendererDlItemPrototype#1{#1}% +\def\markdownRendererDlItemEndPrototype{}% +\def\markdownRendererDlDefinitionBeginPrototype{}% +\def\markdownRendererDlDefinitionEndPrototype{\par}% +\def\markdownRendererDlEndPrototype{}% +\def\markdownRendererDlEndTightPrototype{}% +\def\markdownRendererEmphasisPrototype#1{{\it#1}}% +\def\markdownRendererStrongEmphasisPrototype#1{{\bf#1}}% +\def\markdownRendererBlockQuoteBeginPrototype{\begingroup\it}% +\def\markdownRendererBlockQuoteEndPrototype{\endgroup\par}% +\def\markdownRendererLineBlockBeginPrototype{\begingroup\parindent=0pt}% +\def\markdownRendererLineBlockEndPrototype{\endgroup}% +\def\markdownRendererInputVerbatimPrototype#1{% + \par{\tt\input#1\relax{}}\par}% +\def\markdownRendererInputFencedCodePrototype#1#2#3{% + \markdownRendererInputVerbatim{#1}}% +\def\markdownRendererHeadingOnePrototype#1{#1}% +\def\markdownRendererHeadingTwoPrototype#1{#1}% +\def\markdownRendererHeadingThreePrototype#1{#1}% +\def\markdownRendererHeadingFourPrototype#1{#1}% +\def\markdownRendererHeadingFivePrototype#1{#1}% +\def\markdownRendererHeadingSixPrototype#1{#1}% +\def\markdownRendererThematicBreakPrototype{}% +\def\markdownRendererNotePrototype#1{#1}% +\def\markdownRendererCitePrototype#1{}% +\def\markdownRendererTextCitePrototype#1{}% +\def\markdownRendererTickedBoxPrototype{[X]}% +\def\markdownRendererHalfTickedBoxPrototype{[/]}% +\def\markdownRendererUntickedBoxPrototype{[ ]}% +\def\markdownRendererStrikeThroughPrototype#1{#1}% +\def\markdownRendererSuperscriptPrototype#1{#1}% +\def\markdownRendererSubscriptPrototype#1{#1}% +\def\markdownRendererDisplayMathPrototype#1{$$#1$$}% +\def\markdownRendererInlineMathPrototype#1{$#1$}% +\ExplSyntaxOn +\cs_gset:Npn + \markdownRendererHeaderAttributeContextBeginPrototype + { + \group_begin: + \color_group_begin: + } +\cs_gset:Npn + \markdownRendererHeaderAttributeContextEndPrototype + { + \color_group_end: + \group_end: + } +\cs_gset_eq:NN + \markdownRendererBracketedSpanAttributeContextBeginPrototype + \markdownRendererHeaderAttributeContextBeginPrototype +\cs_gset_eq:NN + \markdownRendererBracketedSpanAttributeContextEndPrototype + \markdownRendererHeaderAttributeContextEndPrototype +\cs_gset_eq:NN + \markdownRendererFencedDivAttributeContextBeginPrototype + \markdownRendererHeaderAttributeContextBeginPrototype +\cs_gset_eq:NN + \markdownRendererFencedDivAttributeContextEndPrototype + \markdownRendererHeaderAttributeContextEndPrototype +\cs_gset_eq:NN + \markdownRendererFencedCodeAttributeContextBeginPrototype + \markdownRendererHeaderAttributeContextBeginPrototype +\cs_gset_eq:NN + \markdownRendererFencedCodeAttributeContextEndPrototype + \markdownRendererHeaderAttributeContextEndPrototype +\cs_gset:Npn + \markdownRendererReplacementCharacterPrototype + { \codepoint_str_generate:n { fffd } } +\ExplSyntaxOff +\def\markdownRendererSectionBeginPrototype{}% +\def\markdownRendererSectionEndPrototype{}% +\ExplSyntaxOn +\cs_new:Nn + \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn + { + \str_case:nn + { #2 } + { + { md } { \markdownInput{#1} } + { tex } { \markdownEscape{#1} \unskip } + } + } +\cs_new:Nn + \__markdown_plain_tex_default_input_raw_block_renderer_prototype:nn + { + \str_case:nn + { #2 } + { + { md } { \markdownInput{#1} } + { tex } { \markdownEscape{#1} } + } + } +\cs_gset:Npn + \markdownRendererInputRawInlinePrototype#1#2 + { + \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn + { #1 } + { #2 } + } +\cs_gset:Npn + \markdownRendererInputRawBlockPrototype#1#2 + { + \__markdown_plain_tex_default_input_raw_block_renderer_prototype:nn + { #1 } + { #2 } + } +\seq_new:N \g__markdown_jekyll_data_datatypes_seq +\tl_const:Nn \c__markdown_jekyll_data_sequence_tl { sequence } +\tl_const:Nn \c__markdown_jekyll_data_mapping_tl { mapping } +\tl_const:Nn \c__markdown_jekyll_data_scalar_tl { scalar } +\seq_new:N \g__markdown_jekyll_data_wildcard_absolute_address_seq +\cs_new:Nn \markdown_jekyll_data_push_address_segment:n + { + \seq_if_empty:NF + \g__markdown_jekyll_data_datatypes_seq + { + \seq_get_right:NN + \g__markdown_jekyll_data_datatypes_seq + \l_tmpa_tl + \str_if_eq:NNTF + \l_tmpa_tl + \c__markdown_jekyll_data_sequence_tl + { + \seq_put_right:Nn + \g__markdown_jekyll_data_wildcard_absolute_address_seq + { * } + } + { + \seq_put_right:Nn + \g__markdown_jekyll_data_wildcard_absolute_address_seq + { #1 } + } + } + } +\tl_new:N \g__markdown_jekyll_data_wildcard_absolute_address_tl +\tl_new:N \g__markdown_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__markdown_jekyll_data_wildcard_absolute_address_seq + \g__markdown_jekyll_data_wildcard_absolute_address_tl + \seq_get_right:NN + \g__markdown_jekyll_data_wildcard_absolute_address_seq + \g__markdown_jekyll_data_wildcard_relative_address_tl + } +\cs_new:Nn \markdown_jekyll_data_push:nN + { + \markdown_jekyll_data_push_address_segment:n + { #1 } + \seq_put_right:NV + \g__markdown_jekyll_data_datatypes_seq + #2 + \markdown_jekyll_data_update_address_tls: + } +\cs_new:Nn \markdown_jekyll_data_pop: + { + \seq_pop_right:NN + \g__markdown_jekyll_data_wildcard_absolute_address_seq + \l_tmpa_tl + \seq_pop_right:NN + \g__markdown_jekyll_data_datatypes_seq + \l_tmpa_tl + \markdown_jekyll_data_update_address_tls: + } +\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__markdown_jekyll_data_scalar_tl + \markdown_jekyll_data_set_keyval:Vn + \g__markdown_jekyll_data_wildcard_absolute_address_tl + { #2 } + \markdown_jekyll_data_set_keyval:Vn + \g__markdown_jekyll_data_wildcard_relative_address_tl + { #2 } + \markdown_jekyll_data_pop: + } +\def\markdownRendererJekyllDataSequenceBeginPrototype#1#2{ + \markdown_jekyll_data_push:nN + { #1 } + \c__markdown_jekyll_data_sequence_tl +} +\def\markdownRendererJekyllDataMappingBeginPrototype#1#2{ + \markdown_jekyll_data_push:nN + { #1 } + \c__markdown_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 +\endinput +%% +%% End of file `markdownthemewitiko_markdown_defaults.tex'. diff --git a/Master/texmf-dist/tex/generic/markdown/markdownthemewitiko_tilde.tex b/Master/texmf-dist/tex/generic/markdown/markdownthemewitiko_tilde.tex new file mode 100644 index 00000000000..90d34446f00 --- /dev/null +++ b/Master/texmf-dist/tex/generic/markdown/markdownthemewitiko_tilde.tex @@ -0,0 +1,52 @@ +%% +%% This is file `markdownthemewitiko_tilde.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% markdown.dtx (with options: `themes-witiko-tilde') +%% +%% Copyright (C) 2016-2024 Vít Starý Novotný +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work has the LPPL maintenance status `maintained'. +%% The Current Maintainer of this work is Vít Starý Novotný. +%% +%% Send bug reports, requests for additions and questions +%% either to the GitHub issue tracker at +%% +%% https://github.com/Witiko/markdown/issues +%% +%% or to the e-mail address <witiko@mail.muni.cz>. +%% +%% MODIFICATION ADVICE: +%% +%% If you want to customize this file, it is best to make a copy of +%% the source file(s) from which it was produced. Use a different +%% name for your copy(ies) and modify the copy(ies); this will ensure +%% that your modifications do not get overwritten when you install a +%% new release of the standard system. You should also ensure that +%% your modified source file does not generate any modified file with +%% the same name as a standard file. +%% +%% You will also need to produce your own, suitably named, .ins file to +%% control the generation of files from your source file; this file +%% should contain your own preambles for the files it generates, not +%% those in the standard .ins files. +%% +%% The names of the source files used are shown above. +%% +\markdownSetup { + rendererPrototypes = { + tilde = {~}, + }, +} +\endinput +%% +%% End of file `markdownthemewitiko_tilde.tex'. |