summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/markdown/markdown.sty
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/tex/latex/markdown/markdown.sty
parentcc0ced9a900ccb1da557afadafdd4f500f69944a (diff)
markdown (31mar22)
git-svn-id: svn://tug.org/texlive/trunk@62928 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/markdown/markdown.sty')
-rw-r--r--Master/texmf-dist/tex/latex/markdown/markdown.sty602
1 files changed, 120 insertions, 482 deletions
diff --git a/Master/texmf-dist/tex/latex/markdown/markdown.sty b/Master/texmf-dist/tex/latex/markdown/markdown.sty
index 8645918a346..a6c17ab3c2f 100644
--- a/Master/texmf-dist/tex/latex/markdown/markdown.sty
+++ b/Master/texmf-dist/tex/latex/markdown/markdown.sty
@@ -53,18 +53,22 @@
\newcommand\markdownSetup[1]{%
\setkeys{markdownOptions}{#1}}%
\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
}}%
+\newcommand\markdownIfSnippetExists[3]{%
+ \@ifundefined
+ {markdownLaTeXSetupSnippet\markdownLaTeXThemeName#1}%
+ {#3}{#2}}%
\newif\ifmarkdownLaTeXPlain
\markdownLaTeXPlainfalse
\define@key{markdownOptions}{plain}[true]{%
@@ -89,14 +93,15 @@
\markdownLaTeXThemePackageName}{#1/}}%
\@onlypreamble\KV@markdownOptions@theme
\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}%
}%
}%
\define@key{markdownOptions}{helperScriptFileName}{%
@@ -133,6 +138,8 @@
\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]{%
@@ -172,7 +179,7 @@
\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]{%
@@ -187,342 +194,97 @@
\DeclareOption{frozencache}{\markdownSetup{frozenCache}}
\define@key{markdownOptions}{frozenCacheFileName}{%
\def\markdownOptionFrozenCacheFileName{#1}}%
-\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}}%
-\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 \__markdown_latex_define_renderers:
+ {
+ \seq_map_function:NN
+ \g__markdown_renderers_seq
+ \__markdown_latex_define_renderer:n
+ }
+\cs_new:Nn \__markdown_latex_define_renderer:n
+ {
+ \tl_set:Nn
+ \l_tmpb_tl
+ { \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__markdown_renderer_arities_prop
+ { #1 }
+ \l_tmpb_tl
+ \__markdown_latex_define_renderer:ncV
+ { #1 }
+ { \l_tmpa_tl }
+ \l_tmpb_tl
+ }
+\cs_new:Nn \__markdown_latex_define_renderer:nNn
+ {
+ \define@key
+ { markdownRenderers }
+ { #1 }
+ {
+ \cs_generate_from_arg_count:NNnn
+ #2
+ \cs_set:Npn
+ { #3 }
+ { ##1 }
+ }
+ }
+\cs_generate_variant:Nn
+ \__markdown_latex_define_renderer:nNn
+ { ncV }
+\ExplSyntaxOff
+\ExplSyntaxOn
+\cs_new:Nn \__markdown_latex_define_renderer_prototypes:
+ {
+ \seq_map_function:NN
+ \g__markdown_renderers_seq
+ \__markdown_latex_define_renderer_prototype:n
+ }
+\cs_new:Nn \__markdown_latex_define_renderer_prototype:n
+ {
+ \tl_set:Nn
+ \l_tmpb_tl
+ { \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__markdown_renderer_arities_prop
+ { #1 }
+ \l_tmpb_tl
+ \__markdown_latex_define_renderer_prototype:ncV
+ { #1 }
+ { \l_tmpa_tl }
+ \l_tmpb_tl
+ }
+\cs_new:Nn \__markdown_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
+ \__markdown_latex_define_renderer_prototype:nNn
+ { ncV }
+\ExplSyntaxOff
\newcommand\markdownInfo[1]{\PackageInfo{markdown}{#1}}%
\newcommand\markdownWarning[1]{\PackageWarning{markdown}{#1}}%
\newcommand\markdownError[2]{\PackageError{markdown}{#1}{#2.}}%
@@ -530,6 +292,10 @@
\def\markdownVersionSpace{ }%
\ProvidesPackage{markdown}[\markdownLastModified\markdownVersionSpace v%
\markdownVersion\markdownVersionSpace markdown renderer]%
+\ExplSyntaxOn
+\__markdown_latex_define_renderers:
+\__markdown_latex_define_renderer_prototypes:
+\ExplSyntaxOff
\let\markdownInputPlainTeX\markdownInput
\renewcommand\markdownInput[2][]{%
\begingroup
@@ -590,16 +356,11 @@
\define@key{markdownOptions}{rendererPrototypes}{%
\setkeys{markdownRendererPrototypes}{#1}%
\def\KV@prefix{KV@markdownOptions@}}%
+\define@key{markdownOptions}{code}{#1}%
\ifmarkdownLaTeXPlain\else
-\RequirePackage{ifthen}
-
-\ifx\markdownOptionTightLists\undefined
- \@ifclassloaded{beamer}{}{%
- \RequirePackage{paralist}}%
-\else
- \ifthenelse{\equal{\markdownOptionTightLists}{false}}{}{%
- \RequirePackage{paralist}}%
-\fi
+\markdownIfOption{tightLists}{
+ \@ifclassloaded{beamer}{}{\RequirePackage{paralist}}%
+}{}
\@ifpackageloaded{paralist}{
\markdownSetup{rendererPrototypes={
ulBeginTight = {\begin{compactitem}},
@@ -616,7 +377,7 @@
olEndTight = {\markdownRendererOlEnd},
dlBeginTight = {\markdownRendererDlBegin},
dlEndTight = {\markdownRendererDlEnd}}}}
-\RequirePackage{amsmath}
+\RequirePackage{amsmath,ifthen}
\@ifpackageloaded{unicode-math}{
\markdownSetup{rendererPrototypes={
untickedBox = {$\mdlgwhtsquare$},
@@ -1122,70 +883,6 @@
\fi\markdownLaTeXRenderTableCell}
\fi
\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
- {
- \seq_if_empty:NF
- \g__markdown_jekyll_data_datatypes_seq
- {
- \seq_get_right:NN
- \g__markdown_jekyll_data_datatypes_seq
- \l_tmpa_tl
- \tl_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:
- }
\keys_define:nn
{ markdown/jekyllData }
{
@@ -1193,64 +890,6 @@
date .code:n = { \date{#1} },
title .code:n = { \title{#1} },
}
-\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:
- }
-\markdownSetup{
- rendererPrototypes = {
- jekyllDataSequenceBegin = {
- \markdown_jekyll_data_push:nN
- { #1 }
- \c__markdown_jekyll_data_sequence_tl
- },
- jekyllDataMappingBegin = {
- \markdown_jekyll_data_push:nN
- { #1 }
- \c__markdown_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 }
- },
- },
-}
\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
\markdownSetup{
rendererPrototypes = {
@@ -1271,7 +910,6 @@
},
},
}
-
\ExplSyntaxOff
\newcommand\markdownMakeOther{%
\count0=128\relax