diff options
author | Karl Berry <karl@freefriends.org> | 2016-08-29 21:19:56 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-08-29 21:19:56 +0000 |
commit | 835ae450df95b8a97500efebbe995d9950c4e2b2 (patch) | |
tree | 2f9de4b0d4669f42f478401ce48926bed745aca0 /Master/texmf-dist/tex/generic | |
parent | 8d7f98b66885b8a8f5e0cccb43f7c97060affb01 (diff) |
markdown (29aug16)
git-svn-id: svn://tug.org/texlive/trunk@41950 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/markdown/markdown.tex | 146 |
1 files changed, 97 insertions, 49 deletions
diff --git a/Master/texmf-dist/tex/generic/markdown/markdown.tex b/Master/texmf-dist/tex/generic/markdown/markdown.tex index 247290d0b3b..12fcc8df129 100644 --- a/Master/texmf-dist/tex/generic/markdown/markdown.tex +++ b/Master/texmf-dist/tex/generic/markdown/markdown.tex @@ -45,29 +45,37 @@ %% %% The names of the source files used are shown above. %% -\def\markdownLastModified{2016/08/14}% -\def\markdownVersion{1.0.2}% +\def\markdownLastModified{2016/08/20}% +\def\markdownVersion{2.1.0}% \let\markdownBegin\relax \let\markdownEnd\relax \let\markdownInput\relax \def\markdownOptionHelperScriptFileName{\jobname.markdown.lua}% \def\markdownOptionInputTempFileName{\jobname.markdown.in}% \def\markdownOptionOutputTempFileName{\jobname.markdown.out}% -\def\markdownOptionCacheDir{_markdown-\jobname}% +\def\markdownOptionCacheDir{_markdown_\jobname}% \let\markdownOptionBlankBeforeBlockquote\undefined +\let\markdownOptionBlankBeforeCodeFence\undefined \let\markdownOptionBlankBeforeHeading\undefined +\let\markdownOptionCitations\undefined +\let\markdownOptionCitationNbsps\undefined \let\markdownOptionDefinitionLists\undefined +\let\markdownOptionFootnotes\undefined +\let\markdownOptionFencedCode\undefined \let\markdownOptionHashEnumerators\undefined \let\markdownOptionHybrid\undefined -\let\markdownOptionFootnotes\undefined \let\markdownOptionPreserveTabs\undefined \let\markdownOptionSmartEllipses\undefined \let\markdownOptionStartNumber\undefined \let\markdownOptionTightLists\undefined +\def\markdownRendererInterblockSeparator{% + \markdownRendererInterblockSeparatorPrototype}% \def\markdownRendererLineBreak{% \markdownRendererLineBreakPrototype}% \def\markdownRendererEllipsis{% \markdownRendererEllipsisPrototype}% +\def\markdownRendererNbsp{% + \markdownRendererNbspPrototype}% \def\markdownRendererLeftBrace{% \markdownRendererLeftBracePrototype}% \def\markdownRendererRightBrace{% @@ -102,6 +110,8 @@ \markdownRendererUlBeginTightPrototype}% \def\markdownRendererUlItem{% \markdownRendererUlItemPrototype}% +\def\markdownRendererUlItemEnd{% + \markdownRendererUlItemEndPrototype}% \def\markdownRendererUlEnd{% \markdownRendererUlEndPrototype}% \def\markdownRendererUlEndTight{% @@ -112,6 +122,8 @@ \markdownRendererOlBeginTightPrototype}% \def\markdownRendererOlItem{% \markdownRendererOlItemPrototype}% +\def\markdownRendererOlItemEnd{% + \markdownRendererOlItemEndPrototype}% \def\markdownRendererOlItemWithNumber{% \markdownRendererOlItemWithNumberPrototype}% \def\markdownRendererOlEnd{% @@ -124,6 +136,8 @@ \markdownRendererDlBeginTightPrototype}% \def\markdownRendererDlItem{% \markdownRendererDlItemPrototype}% +\def\markdownRendererDlItemEnd{% + \markdownRendererDlItemEndPrototype}% \def\markdownRendererDlDefinitionBegin{% \markdownRendererDlDefinitionBeginPrototype}% \def\markdownRendererDlDefinitionEnd{% @@ -142,6 +156,8 @@ \markdownRendererBlockQuoteEndPrototype}% \def\markdownRendererInputVerbatim{% \markdownRendererInputVerbatimPrototype}% +\def\markdownRendererInputFencedCode{% + \markdownRendererInputFencedCodePrototype}% \def\markdownRendererHeadingOne{% \markdownRendererHeadingOnePrototype}% \def\markdownRendererHeadingTwo{% @@ -158,8 +174,14 @@ \markdownRendererHorizontalRulePrototype}% \def\markdownRendererFootnote{% \markdownRendererFootnotePrototype}% +\def\markdownRendererCite{% + \markdownRendererCitePrototype}% +\def\markdownRendererTextCite{% + \markdownRendererTextCitePrototype}% +\def\markdownRendererInterblockSeparatorPrototype{}% \def\markdownRendererLineBreakPrototype{}% \def\markdownRendererEllipsisPrototype{}% +\def\markdownRendererNbspPrototype{}% \def\markdownRendererLeftBracePrototype{}% \def\markdownRendererRightBracePrototype{}% \def\markdownRendererDollarSignPrototype{}% @@ -171,40 +193,46 @@ \def\markdownRendererBackslashPrototype{}% \def\markdownRendererTildePrototype{}% \def\markdownRendererPipePrototype{}% -\long\def\markdownRendererCodeSpanPrototype#1{}% -\long\def\markdownRendererLinkPrototype#1#2#3#4{}% -\long\def\markdownRendererImagePrototype#1#2#3#4{}% +\def\markdownRendererCodeSpanPrototype#1{}% +\def\markdownRendererLinkPrototype#1#2#3#4{}% +\def\markdownRendererImagePrototype#1#2#3#4{}% \def\markdownRendererUlBeginPrototype{}% \def\markdownRendererUlBeginTightPrototype{}% \def\markdownRendererUlItemPrototype{}% +\def\markdownRendererUlItemEndPrototype{}% \def\markdownRendererUlEndPrototype{}% \def\markdownRendererUlEndTightPrototype{}% \def\markdownRendererOlBeginPrototype{}% \def\markdownRendererOlBeginTightPrototype{}% \def\markdownRendererOlItemPrototype{}% -\long\def\markdownRendererOlItemWithNumberPrototype#1{}% +\def\markdownRendererOlItemWithNumberPrototype#1{}% +\def\markdownRendererOlItemEndPrototype{}% \def\markdownRendererOlEndPrototype{}% \def\markdownRendererOlEndTightPrototype{}% \def\markdownRendererDlBeginPrototype{}% \def\markdownRendererDlBeginTightPrototype{}% -\long\def\markdownRendererDlItemPrototype#1{}% +\def\markdownRendererDlItemPrototype#1{}% +\def\markdownRendererDlItemEndPrototype{}% \def\markdownRendererDlDefinitionBeginPrototype{}% \def\markdownRendererDlDefinitionEndPrototype{}% \def\markdownRendererDlEndPrototype{}% \def\markdownRendererDlEndTightPrototype{}% -\long\def\markdownRendererEmphasisPrototype#1{}% -\long\def\markdownRendererStrongEmphasisPrototype#1{}% +\def\markdownRendererEmphasisPrototype#1{}% +\def\markdownRendererStrongEmphasisPrototype#1{}% \def\markdownRendererBlockQuoteBeginPrototype{}% \def\markdownRendererBlockQuoteEndPrototype{}% -\long\def\markdownRendererInputVerbatimPrototype#1{}% -\long\def\markdownRendererHeadingOnePrototype#1{}% -\long\def\markdownRendererHeadingTwoPrototype#1{}% -\long\def\markdownRendererHeadingThreePrototype#1{}% -\long\def\markdownRendererHeadingFourPrototype#1{}% -\long\def\markdownRendererHeadingFivePrototype#1{}% -\long\def\markdownRendererHeadingSixPrototype#1{}% +\def\markdownRendererInputVerbatimPrototype#1{}% +\def\markdownRendererInputFencedCodePrototype#1#2{}% +\def\markdownRendererHeadingOnePrototype#1{}% +\def\markdownRendererHeadingTwoPrototype#1{}% +\def\markdownRendererHeadingThreePrototype#1{}% +\def\markdownRendererHeadingFourPrototype#1{}% +\def\markdownRendererHeadingFivePrototype#1{}% +\def\markdownRendererHeadingSixPrototype#1{}% \def\markdownRendererHorizontalRulePrototype{}% -\long\def\markdownRendererFootnotePrototype#1{}% +\def\markdownRendererFootnotePrototype#1{}% +\def\markdownRendererCitePrototype#1{}% +\def\markdownRendererTextCitePrototype#1{}% \def\markdownInfo#1{}% \def\markdownWarning#1{}% \def\markdownError#1{}% @@ -235,8 +263,10 @@ \def\markdownError#1#2{% \errhelp{#2.}% \errmessage{(l.\the\inputlineno) markdown.tex error: #1}}% +\def\markdownRendererInterblockSeparatorPrototype{\par}% \def\markdownRendererLineBreakPrototype{\hfil\break}% \let\markdownRendererEllipsisPrototype\dots +\def\markdownRendererNbspPrototype{~}% \def\markdownRendererLeftBracePrototype{\char`{}% \def\markdownRendererRightBracePrototype{\char`}}% \def\markdownRendererDollarSignPrototype{\char`$}% @@ -248,63 +278,82 @@ \def\markdownRendererBackslashPrototype{\char`\\}% \def\markdownRendererTildePrototype{\char`~}% \def\markdownRendererPipePrototype{|}% -\long\def\markdownRendererCodeSpanPrototype#1{{\tt#1}}% -\long\def\markdownRendererLinkPrototype#1#2#3#4{#2}% -\long\def\markdownRendererImagePrototype#1#2#3#4{#2}% +\def\markdownRendererCodeSpanPrototype#1{{\tt#1}}% +\def\markdownRendererLinkPrototype#1#2#3#4{#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\markdownRendererOlItemPrototype{}% -\long\def\markdownRendererOlItemWithNumberPrototype#1{}% +\def\markdownRendererOlItemWithNumberPrototype#1{}% +\def\markdownRendererOlItemEndPrototype{}% \def\markdownRendererOlEndPrototype{}% \def\markdownRendererOlEndTightPrototype{}% \def\markdownRendererDlBeginPrototype{}% \def\markdownRendererDlBeginTightPrototype{}% -\long\def\markdownRendererDlItemPrototype#1{#1}% +\def\markdownRendererDlItemPrototype#1{#1}% +\def\markdownRendererDlItemEndPrototype{}% \def\markdownRendererDlDefinitionBeginPrototype{}% \def\markdownRendererDlDefinitionEndPrototype{\par}% \def\markdownRendererDlEndPrototype{}% \def\markdownRendererDlEndTightPrototype{}% -\long\def\markdownRendererEmphasisPrototype#1{{\it#1}}% -\long\def\markdownRendererStrongEmphasisPrototype#1{{\it#1}}% +\def\markdownRendererEmphasisPrototype#1{{\it#1}}% +\def\markdownRendererStrongEmphasisPrototype#1{{\it#1}}% \def\markdownRendererBlockQuoteBeginPrototype{\par\begingroup\it}% \def\markdownRendererBlockQuoteEndPrototype{\endgroup\par}% -\long\def\markdownRendererInputVerbatimPrototype#1{% -\par{\tt\input"#1"\relax}\par}% -\long\def\markdownRendererHeadingOnePrototype#1{#1}% -\long\def\markdownRendererHeadingTwoPrototype#1{#1}% -\long\def\markdownRendererHeadingThreePrototype#1{#1}% -\long\def\markdownRendererHeadingFourPrototype#1{#1}% -\long\def\markdownRendererHeadingFivePrototype#1{#1}% -\long\def\markdownRendererHeadingSixPrototype#1{#1}% +\def\markdownRendererInputVerbatimPrototype#1{% + \par{\tt\input"#1"\relax}\par}% +\def\markdownRendererInputFencedCodePrototype#1#2{% + \markdownRendererInputVerbatimPrototype{#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\markdownRendererHorizontalRulePrototype{}% -\long\def\markdownRendererFootnotePrototype#1{#1}% +\def\markdownRendererFootnotePrototype#1{#1}% +\def\markdownRendererCitePrototype#1{}% +\def\markdownRendererTextCitePrototype#1{}% \def\markdownLuaOptions{{% \ifx\markdownOptionBlankBeforeBlockquote\undefined\else blankBeforeBlockquote = \markdownOptionBlankBeforeBlockquote, \fi +\ifx\markdownOptionBlankBeforeCodeFence\undefined\else + blankBeforeCodeFence = \markdownOptionBlankBeforeCodeFence, +\fi \ifx\markdownOptionBlankBeforeHeading\undefined\else blankBeforeHeading = \markdownOptionBlankBeforeHeading, \fi \ifx\markdownOptionCacheDir\undefined\else cacheDir = "\markdownOptionCacheDir", \fi +\ifx\markdownOptionCitations\undefined\else + citations = \markdownOptionCitations, +\fi +\ifx\markdownOptionCitationNbsps\undefined\else + citationNbsps = \markdownOptionCitationNbsps, +\fi \ifx\markdownOptionDefinitionLists\undefined\else definitionLists = \markdownOptionDefinitionLists, \fi +\ifx\markdownOptionFootnotes\undefined\else + footnotes = \markdownOptionFootnotes, +\fi +\ifx\markdownOptionFencedCode\undefined\else + fencedCode = \markdownOptionFencedCode, +\fi \ifx\markdownOptionHashEnumerators\undefined\else hashEnumerators = \markdownOptionHashEnumerators, \fi \ifx\markdownOptionHybrid\undefined\else hybrid = \markdownOptionHybrid, \fi -\ifx\markdownOptionFootnotes\undefined\else - footnotes = \markdownOptionFootnotes, -\fi \ifx\markdownOptionPreserveTabs\undefined\else preserveTabs = \markdownOptionPreserveTabs, \fi @@ -335,19 +384,19 @@ local convert = md.new(\markdownLuaOptions) \markdownInfo{Using mode 1: Shell escape via os.execute}% \fi \csname newwrite\endcsname\markdownLuaExecuteFileStream -\ifnum\markdownMode=0\relax - \ifx\pdfshellescape\undefined - \ifx\shellescape\undefined +\ifx\pdfshellescape\undefined + \ifx\shellescape\undefined + \ifnum\markdownMode=0\relax \def\markdownExecuteShellEscape{1}% \else - \let\markdownExecuteShellEscape\shellescape + \def\markdownExecuteShellEscape{% + \directlua{tex.sprint(status.shell_escape or "1")}}% \fi \else - \let\markdownExecuteShellEscape\pdfshellescape + \let\markdownExecuteShellEscape\shellescape \fi \else - \def\markdownExecuteShellEscape{% - \directlua{tex.sprint(status.shell_escape)}}% + \let\markdownExecuteShellEscape\pdfshellescape \fi \ifnum\markdownMode=0\relax \def\markdownExecuteDirect#1{\immediate\write18{#1}}% @@ -403,7 +452,6 @@ local convert = md.new(\markdownLuaOptions) |else% |def^^M{% |markdownInfo{The ending token sequence was found}% - |immediate|write|markdownLuaExecuteFileStream{}% |immediate|closeout|markdownLuaExecuteFileStream% |endgroup% |markdownInput|markdownOptionInputTempFileName% @@ -443,8 +491,8 @@ local convert = md.new(\markdownLuaOptions) "([%(%)%.%%%+%-%*%?%[%]%^%$])", "%%%1") |markdownLuaRegisterIBCallback{function(line) if line:match(ending_sequence) then - |markdownLuaUnregisterIBCallback - local input = table.concat(buffer, "\n") .. "\n\n" + |markdownLuaUnregisterIBCallback; + local input = table.concat(buffer, "\n") .. "\n" local output = convert(input) return [[\markdownInfo{The ending token sequence was found}]] .. output .. [[\markdownReadAndConvertAfter]] @@ -463,7 +511,7 @@ local convert = md.new(\markdownLuaOptions) |markdownInfo{Including markdown document "#1"}% |markdownLuaExecute{% |markdownPrepare - local input = assert(io.open("#1","r")):read("*a") .. "\n\n" + local input = assert(io.open("#1","r")):read("*a") print(convert(input:gsub("\r\n?", "\n")))}}% |endgroup \endinput |