summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/markdown/markdown.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/markdown/markdown.sty')
-rw-r--r--Master/texmf-dist/tex/latex/markdown/markdown.sty248
1 files changed, 244 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/markdown/markdown.sty b/Master/texmf-dist/tex/latex/markdown/markdown.sty
index fa84c468857..1c54f4848cb 100644
--- a/Master/texmf-dist/tex/latex/markdown/markdown.sty
+++ b/Master/texmf-dist/tex/latex/markdown/markdown.sty
@@ -138,6 +138,8 @@
\def\markdownOptionFootnotes{#1}}%
\define@key{markdownOptions}{fencedCode}[true]{%
\def\markdownOptionFencedCode{#1}}%
+\define@key{markdownOptions}{jekyllData}[true]{%
+ \def\markdownOptionJekyllData{#1}}%
\define@key{markdownOptions}{hashEnumerators}[true]{%
\def\markdownOptionHashEnumerators{#1}}%
\define@key{markdownOptions}{headerAttributes}[true]{%
@@ -164,6 +166,8 @@
\def\markdownOptionStripIndent{#1}}%
\define@key{markdownOptions}{tableCaptions}[true]{%
\def\markdownOptionTableCaptions{#1}}%
+\define@key{markdownOptions}{taskLists}[true]{%
+ \def\markdownOptionTaskLists{#1}}%
\define@key{markdownOptions}{texComments}[true]{%
\def\markdownOptionTeXComments{#1}}%
\define@key{markdownOptions}{tightLists}[true]{%
@@ -276,6 +280,26 @@
\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}{%
@@ -300,6 +324,12 @@
\renewcommand\markdownRendererTable[3]{#1}}%
\define@key{markdownRenderers}{inlineHtmlComment}{%
\renewcommand\markdownRendererInlineHtmlComment[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}{interblockSeparator}{%
\renewcommand\markdownRendererInterblockSeparatorPrototype{#1}}%
\define@key{markdownRendererPrototypes}{lineBreak}{%
@@ -396,6 +426,26 @@
\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}{%
@@ -420,6 +470,12 @@
\renewcommand\markdownRendererTablePrototype[3]{#1}}%
\define@key{markdownRendererPrototypes}{inlineHtmlComment}{%
\renewcommand\markdownRendererInlineHtmlCommentPrototype[1]{#1}}%
+\define@key{markdownRendererPrototypes}{tickedBox}{%
+ \renewcommand\markdownRendererTickedBoxPrototype{#1}}%
+\define@key{markdownRendererPrototypes}{halfTickedBox}{%
+ \renewcommand\markdownRendererHalfTickedBoxPrototype{#1}}%
+\define@key{markdownRendererPrototypes}{untickedBox}{%
+ \renewcommand\markdownRendererUntickedBoxPrototype{#1}}%
\newcommand\markdownInfo[1]{\PackageInfo{markdown}{#1}}%
\newcommand\markdownWarning[1]{\PackageWarning{markdown}{#1}}%
\newcommand\markdownError[2]{\PackageError{markdown}{#1}{#2.}}%
@@ -458,13 +514,14 @@
\def\KV@prefix{KV@markdownOptions@}}%
\ifmarkdownLaTeXPlain\else
\RequirePackage{ifthen}
-\@ifundefined{markdownOptionTightLists}{%
+
+\ifx\markdownOptionTightLists\undefined
\@ifclassloaded{beamer}{}{%
\RequirePackage{paralist}}%
-}{%
+\else
\ifthenelse{\equal{\markdownOptionTightLists}{false}}{}{%
\RequirePackage{paralist}}%
-}%
+\fi
\@ifpackageloaded{paralist}{
\markdownSetup{rendererPrototypes={
ulBeginTight = {\begin{compactitem}},
@@ -481,6 +538,8 @@
olEndTight = {\markdownRendererOlEnd},
dlBeginTight = {\markdownRendererDlBegin},
dlEndTight = {\markdownRendererDlEnd}}}}
+\RequirePackage{amsmath}
+\RequirePackage{amssymb}
\RequirePackage{csvsimple}
\RequirePackage{fancyvrb}
\RequirePackage{graphicx}
@@ -517,7 +576,6 @@
\label{fig:#1}%
\end{figure}},
ulBegin = {\begin{itemize}},
- ulItem = {\item{}},
ulEnd = {\end{itemize}},
olBegin = {\begin{enumerate}},
olItem = {\item{}},
@@ -527,6 +585,9 @@
dlItem = {\item[#1]},
dlEnd = {\end{description}},
emphasis = {\emph{#1}},
+ tickedBox = {$\boxtimes$},
+ halfTickedBox = {$\boxdot$},
+ untickedBox = {$\square$},
blockQuoteBegin = {\begin{quotation}},
blockQuoteEnd = {\end{quotation}},
inputVerbatim = {\VerbatimInput{#1}},
@@ -566,6 +627,32 @@
headingFive = {\paragraph{#1}\leavevmode},
headingSix = {\subparagraph{#1}\leavevmode}}}
}%
+\markdownSetup{
+ rendererPrototypes = {
+ ulItem = {%
+ \futurelet\markdownLaTeXCheckbox\markdownLaTeXUlItem
+ },
+ },
+}
+\def\markdownLaTeXUlItem{%
+ \ifx\markdownLaTeXCheckbox\markdownRendererTickedBox
+ \item[\markdownLaTeXCheckbox]%
+ \expandafter\@gobble
+ \else
+ \ifx\markdownLaTeXCheckbox\markdownRendererHalfTickedBox
+ \item[\markdownLaTeXCheckbox]%
+ \expandafter\expandafter\expandafter\@gobble
+ \else
+ \ifx\markdownLaTeXCheckbox\markdownRendererUntickedBox
+ \item[\markdownLaTeXCheckbox]%
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\@gobble
+ \else
+ \item{}%
+ \fi
+ \fi
+ \fi
+}
\newcount\markdownLaTeXCitationsCounter
\RequirePackage{gobble}
@@ -868,6 +955,159 @@
\expandafter\@gobble
\fi\markdownLaTeXRenderTableCell}
\fi
+\RequirePackage{expl3}
+\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 }
+ {
+ author .code:n = { \author{#1} },
+ 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 = {
+ jekyllDataEnd = {
+ \IfFormatAtLeastTF
+ { 2020-10-01 }
+ { \AddToHook{begindocument/end}{\maketitle} }
+ {
+ \ifx\@onlypreamble\@notprerr
+ % We are in the document
+ \maketitle
+ \else
+ % We are in the preamble
+ \RequirePackage{etoolbox}
+ \AfterEndPreamble{\maketitle}
+ \fi
+ }
+ },
+ },
+}
+
+\ExplSyntaxOff
\newcommand\markdownMakeOther{%
\count0=128\relax
\loop