texlive[42000] Master/texmf-dist: markdown (6sep16)

commits+karl at tug.org commits+karl at tug.org
Tue Sep 6 23:30:38 CEST 2016


Revision: 42000
          http://tug.org/svn/texlive?view=revision&revision=42000
Author:   karl
Date:     2016-09-06 23:30:37 +0200 (Tue, 06 Sep 2016)
Log Message:
-----------
markdown (6sep16)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/markdown/markdown.pdf
    trunk/Master/texmf-dist/source/generic/markdown/markdown.dtx
    trunk/Master/texmf-dist/tex/generic/markdown/markdown.tex
    trunk/Master/texmf-dist/tex/luatex/markdown/markdown.lua

Modified: trunk/Master/texmf-dist/doc/generic/markdown/markdown.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/generic/markdown/markdown.dtx
===================================================================
--- trunk/Master/texmf-dist/source/generic/markdown/markdown.dtx	2016-09-06 21:30:22 UTC (rev 41999)
+++ trunk/Master/texmf-dist/source/generic/markdown/markdown.dtx	2016-09-06 21:30:37 UTC (rev 42000)
@@ -74,9 +74,10 @@
 \begin{filecontents}{markdown.bib}
   @book{luatex16,
     author    = {{Lua\TeX{} development team}},
-    title     = {Lua\TeX{} reference manual (0.95.0)},
+    title     = {Lua\TeX{} reference manual (0.98.3)},
+    date      = {2016-08-23},
     url       = {http://www.luatex.org/svn/trunk/manual/luatex.pdf},
-    urldate   = {2016-05-12}}
+    urldate   = {2016-08-30}}
   @book{latex16,
     author    = {Braams, Johannes and Carlisle, David and Jeffrey, Alan and
                  Lamport, Leslie and Mittelbach, Frank and Rowley, Chris and
@@ -146,7 +147,7 @@
 % \fi
 %  \begin{macrocode}
 local metadata = {
-    version   = "2.1.0",
+    version   = "2.1.1",
     comment   = "A module for the conversion from markdown to plain TeX",
     author    = "John MacFarlane, Hans Hagen, Vít Novotný",
     copyright = "2009-2016 John MacFarlane, Hans Hagen; 2016 Vít Novotný",
@@ -182,29 +183,35 @@
 % This section gives an overview of all resources required by the package.
 %
 % \subsubsection{Lua Prerequisites}\label{sec:luaprerequisites}
-% The Lua part of the package requires the following Lua modules:
+% The Lua part of the package requires that the following Lua modules are
+% available from within the Lua\TeX{} engine:
 % \begin{description}
-%   \item[\pkg{LPeg}] A pattern-matching library for the writing of recursive
-%     descent parsers via the Parsing Expression Grammars (\acro{peg}s). It is
-%     used by the \pkg{Lunamark} library to parse the markdown input.
+%   \item[\pkg{LPeg${}\geq{}$0.10}] A pattern-matching library for the writing
+%     of recursive descent parsers via the Parsing Expression Grammars
+%     (\acro{peg}s). It is used by the \pkg{Lunamark} library to parse the
+%     markdown input. \pkg{LPeg${}\geq{}$0.10} is included in
+%     Lua\TeX${}\geq{}$0.72.0 (\TeX Live${}\geq{}2013$).
 %  \begin{macrocode}
 local lpeg = require("lpeg")
 %    \end{macrocode}
 %   \item[\pkg{Selene Unicode}] A library that provides support for the
 %     processing of wide strings. It is used by the \pkg{Lunamark} library to
-%     cast image, link, and footnote tags to the lower case.
+%     cast image, link, and footnote tags to the lower case. \pkg{Selene
+%     Unicode} is included in all releases of Lua\TeX{} (\TeX
+%     Live${}\geq{}2008$).
 %  \begin{macrocode}
 local unicode = require("unicode")
 %    \end{macrocode}
 %   \item[\pkg{MD5}] A library that provides \acro{md5} crypto functions. It is
 %     used by the \pkg{Lunamark} library to compute the digest of the input for
-%     caching purposes. 
+%     caching purposes. \pkg{MD5} is included in all releases of Lua\TeX{}
+%     (\TeX Live${}\geq{}2008$).
 %  \begin{macrocode}
 local md5 = require("md5")
 %    \end{macrocode}
 % \end{description}
-% All the abovelisted modules are statically linked into the Lua\TeX{} engine
-% (see \cite[Section~3.3]{luatex16}).
+% All the abovelisted modules are statically linked into the current version of
+% the Lua\TeX{} engine (see \cite[Section~3.3]{luatex16}).
 %
 % \iffalse
 %</lua>
@@ -211,24 +218,25 @@
 %<*tex>
 % \fi
 % \subsubsection{Plain \TeX{} Prerequisites}\label{sec:texprerequisites}
-% The plain \TeX{} part of the package requires the following Lua module:
+% The plain \TeX{} part of the package requires that the plain \TeX{}
+% format (or its superset) is loaded, all the Lua prerequisites (see
+% Section \ref{sec:luaprerequisites}) and the following Lua module:
 % \begin{description}
 %   \item[\pkg{Lua File System}] A library that provides access to the
 %     filesystem via \acro{os}-specific syscalls. It is used by the plain
 %     \TeX{} code to create the cache directory specified by the
 %     \m{markdownOptionCacheDir} macro before interfacing with the
-%     \pkg{Lunamark} library.
+%     \pkg{Lunamark} library. \pkg{Lua File System} is included in all releases
+%     of Lua\TeX{} (\TeX Live${}\geq{}2008$).
 %
 %     The plain \TeX{} code makes use of the \luam{isdir} method that was added
-%     to the module by the Lua\TeX{} engine developers (see
-%     \cite[Section~3.2]{luatex16}). This method is not present in the base
-%     library.
+%     to the \pkg{Lua File System} library by the Lua\TeX{} engine developers
+%     (see \cite[Section~3.2]{luatex16}).
 % \end{description}
 % The \pkg{Lua File System} module is statically linked into the Lua\TeX{}
 % engine (see \cite[Section~3.3]{luatex16}).
 %
-% The plain \TeX{} part of the package also requires that the plain \TeX{}
-% format (or its superset) is loaded and that either the Lua\TeX{}
+% The plain \TeX{} part of the package also requires that either the Lua\TeX{}
 % \m{directlua} primitive or the shell access file stream 18 is available.
 %
 % \iffalse
@@ -237,13 +245,12 @@
 % \fi
 % \subsubsection{\LaTeX{} Prerequisites}\label{sec:latexprerequisites}
 % The \LaTeX{} part of the package requires that the \Hologo{LaTeX2e} format is
-% loaded and also, since it uses the plain \TeX{} implementation, all the plain
-% \TeX{} prerequisites (see Section \ref{sec:texprerequisites}).
+% loaded,
 %  \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}%
 %    \end{macrocode}
-%
-% The following \Hologo{LaTeX2e} packages are also required:
+% all the plain \TeX{} prerequisites (see Section \ref{sec:texprerequisites}),
+% and the following \Hologo{LaTeX2e} packages:
 % \begin{description}
 %   \item[\pkg{keyval}] A package that enables the creation of parameter sets.
 %     This package is used to provide the \m{markdownSetup} macro, the package
@@ -276,9 +283,8 @@
 % \fi
 % \subsubsection{\Hologo{ConTeXt} prerequisites}
 % The \Hologo{ConTeXt} part of the package requires that either the Mark II or
-% the Mark IV format is loaded and also, since it uses the plain \TeX{}
-% implementation, all the plain \TeX{} prerequisites (see Section
-% \ref{sec:texprerequisites}).
+% the Mark IV format is loaded and all the plain \TeX{} prerequisites (see
+% Section \ref{sec:texprerequisites}).
 %
 % \section{User Guide}\label{sec:interfaces}
 % This part of the manual describes the interfaces exposed by the package
@@ -575,8 +581,8 @@
 % \ref{sec:luaoptions}) used during the conversion from markdown to plain
 % \TeX{}, and for changing the way markdown the tokens are rendered.
 %  \begin{macrocode}
-\def\markdownLastModified{2016/08/20}%
-\def\markdownVersion{2.1.0}%
+\def\markdownLastModified{2016/09/06}%
+\def\markdownVersion{2.1.1}%
 %    \end{macrocode}
 %
 % The plain \TeX{} interface is implemented by the \t`markdown.tex` file that
@@ -702,7 +708,7 @@
 % package. The same limitations apply here as in the case of the
 % \m{markdownOptionHelperScriptFileName} macro.
 %  \begin{macrocode}
-\def\markdownOptionCacheDir{_markdown_\jobname}%
+\def\markdownOptionCacheDir{./_markdown_\jobname}%
 %    \end{macrocode}
 %
 % \paragraph{Lua Interface Options}
@@ -2400,9 +2406,9 @@
 % \begin{itemize}
 %   \item\t`suppress_author` -- If the value of the key is true, then the
 %     author of the work should be omitted in the citation, when applicable.
-%   \item\t`prenote` -- The value of the key is either \t`nil` or a string
+%   \item\t`prenote` -- The value of the key is either \t`nil` or a rope
 %     that should be inserted before the citation.
-%   \item\t`postnote` -- The value of the key is either \t`nil` or a string
+%   \item\t`postnote` -- The value of the key is either \t`nil` or a rope
 %     that should be inserted after the citation.
 %   \item\t`name` -- The value of this key is the citation name.
 % \end{itemize}
@@ -2516,6 +2522,7 @@
 %  \begin{macrocode}
   local percent                = P("%")
   local at                     = P("@")
+  local comma                  = P(",")
   local asterisk               = P("*")
   local dash                   = P("-")
   local plus                   = P("+")
@@ -2546,7 +2553,7 @@
   local letter                 = R("AZ","az")
   local alphanumeric           = R("AZ","az","09")
   local keyword                = letter * alphanumeric^0
-  local punctuation            = S("!?,.:;")
+  local internal_punctuation   = S(":;,.#$%&-+?<>~/")
 
   local doubleasterisks        = P("**")
   local doubleunderscores      = P("__")
@@ -2573,9 +2580,6 @@
   local normalchar             = any -
                                  (specialchar + spacing + tightblocksep)
   local optionalspace          = spacechar^0
-  local optionalspaceor = function(pattern)
-    return                      (spacechar + pattern)^0
-  end
   local eof                    = - any
   local nonindentspace         = space^-3 * - spacechar
   local indent                 = space^-3 * tab
@@ -2589,10 +2593,6 @@
   local optionallyindentedline = indent^-1 /"" * C(linechar^1 * newline^-1)
   local sp                     = spacing^0
   local spnl                   = optionalspace * (newline * optionalspace)^-1
-  local spnlor = function(pattern)
-    local optional = optionalspaceor(pattern)
-    return                       optional * (newline * optional)^-1
-  end
   local line                   = linechar^0 * newline
                                + linechar^1 * eof
   local nonemptyline           = line - blankline
@@ -2734,9 +2734,10 @@
 %    \end{macrocode}
 % \paragraph{Citation \acro{peg} Patterns}
 %  \begin{macrocode}
-  local citation_name = (Cs(dash^-1)
-                      * at * Cs((anyescaped
-                           - (rbracket + spacing + punctuation + semicolon))^1))
+  local citation_name = Cs(dash^-1) * at
+                      * Cs(alphanumeric
+                          * (alphanumeric + internal_punctuation
+                              - comma - semicolon)^0)
 
   local citation_body_prenote
                       = Cs((alphanumeric^1
@@ -2743,7 +2744,7 @@
                            + bracketed
                            + inticks
                            + (anyescaped
-                               - (rbracket + semicolon + blankline^2))
+                               - (rbracket + blankline^2))
                            - (spnl * dash^-1 * at))^0)
 
   local citation_body_postnote
@@ -2757,14 +2758,22 @@
   local citation_body_chunk
                       = citation_body_prenote
                       * spnl * citation_name
-                      * spnlor(punctuation - (semicolon + rbracket))
+                      * (comma * spnl)^-1
                       * citation_body_postnote
 
   local citation_body = citation_body_chunk
                       * (semicolon * spnl * citation_body_chunk)^0
 
+  local citation_headless_body_postnote
+                      = Cs((alphanumeric^1
+                           + bracketed
+                           + inticks
+                           + (anyescaped
+                               - (rbracket + at + semicolon + blankline^2))
+                           - (spnl * rbracket))^0)
+
   local citation_headless_body
-                      = citation_body_postnote
+                      = citation_headless_body_postnote
                       * (sp * semicolon * spnl * citation_body_chunk)^0
 %    \end{macrocode}
 % \paragraph{Footnote \acro{peg} Patterns}
@@ -2922,6 +2931,16 @@
                   + spacechar^1 * Endline^-1 * eof / ""
                   + spacechar^1 * Endline^-1 * optionalspace / writer.space
 
+  local NonbreakingEndline
+                  = newline * -( -- newline, but not before...
+                        blankline -- paragraph break
+                      + tightblocksep  -- nested list
+                      + eof       -- end of document
+                      + bqstart
+                      + headerstart
+                      + fencestart
+                    ) * spacechar^0 / writer.nbsp
+
   local NonbreakingSpace
                   = spacechar^2 * Endline / writer.linebreak
                   + spacechar^1 * Endline^-1 * eof / ""
@@ -3345,6 +3364,7 @@
   inlines_no_link = Ct(inlines_no_link_t)
 
   local inlines_nbsp_t = util.table_copy(inlines_t)
+  inlines_nbsp_t.Endline = NonbreakingEndline
   inlines_nbsp_t.Space = NonbreakingSpace
   inlines_nbsp = Ct(inlines_nbsp_t)
 %    \end{macrocode}

Modified: trunk/Master/texmf-dist/tex/generic/markdown/markdown.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/markdown/markdown.tex	2016-09-06 21:30:22 UTC (rev 41999)
+++ trunk/Master/texmf-dist/tex/generic/markdown/markdown.tex	2016-09-06 21:30:37 UTC (rev 42000)
@@ -45,8 +45,8 @@
 %% 
 %% The names of the source files used are shown above.
 %% 
-\def\markdownLastModified{2016/08/20}%
-\def\markdownVersion{2.1.0}%
+\def\markdownLastModified{2016/09/06}%
+\def\markdownVersion{2.1.1}%
 \let\markdownBegin\relax
 \let\markdownEnd\relax
 \let\markdownInput\relax
@@ -53,7 +53,7 @@
 \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

Modified: trunk/Master/texmf-dist/tex/luatex/markdown/markdown.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/markdown/markdown.lua	2016-09-06 21:30:22 UTC (rev 41999)
+++ trunk/Master/texmf-dist/tex/luatex/markdown/markdown.lua	2016-09-06 21:30:37 UTC (rev 42000)
@@ -58,7 +58,7 @@
 -- those in the standard .ins files.
 -- 
 local metadata = {
-    version   = "2.1.0",
+    version   = "2.1.1",
     comment   = "A module for the conversion from markdown to plain TeX",
     author    = "John MacFarlane, Hans Hagen, Vít Novotný",
     copyright = "2009-2016 John MacFarlane, Hans Hagen; 2016 Vít Novotný",
@@ -459,6 +459,7 @@
     function() return inlines_nbsp end)
   local percent                = P("%")
   local at                     = P("@")
+  local comma                  = P(",")
   local asterisk               = P("*")
   local dash                   = P("-")
   local plus                   = P("+")
@@ -489,7 +490,7 @@
   local letter                 = R("AZ","az")
   local alphanumeric           = R("AZ","az","09")
   local keyword                = letter * alphanumeric^0
-  local punctuation            = S("!?,.:;")
+  local internal_punctuation   = S(":;,.#$%&-+?<>~/")
 
   local doubleasterisks        = P("**")
   local doubleunderscores      = P("__")
@@ -516,9 +517,6 @@
   local normalchar             = any -
                                  (specialchar + spacing + tightblocksep)
   local optionalspace          = spacechar^0
-  local optionalspaceor = function(pattern)
-    return                      (spacechar + pattern)^0
-  end
   local eof                    = - any
   local nonindentspace         = space^-3 * - spacechar
   local indent                 = space^-3 * tab
@@ -532,10 +530,6 @@
   local optionallyindentedline = indent^-1 /"" * C(linechar^1 * newline^-1)
   local sp                     = spacing^0
   local spnl                   = optionalspace * (newline * optionalspace)^-1
-  local spnlor = function(pattern)
-    local optional = optionalspaceor(pattern)
-    return                       optional * (newline * optional)^-1
-  end
   local line                   = linechar^0 * newline
                                + linechar^1 * eof
   local nonemptyline           = line - blankline
@@ -663,9 +657,10 @@
 
   local optionaltitle = spnl * title * spacechar^0
                       + Cc("")
-  local citation_name = (Cs(dash^-1)
-                      * at * Cs((anyescaped
-                           - (rbracket + spacing + punctuation + semicolon))^1))
+  local citation_name = Cs(dash^-1) * at
+                      * Cs(alphanumeric
+                          * (alphanumeric + internal_punctuation
+                              - comma - semicolon)^0)
 
   local citation_body_prenote
                       = Cs((alphanumeric^1
@@ -672,7 +667,7 @@
                            + bracketed
                            + inticks
                            + (anyescaped
-                               - (rbracket + semicolon + blankline^2))
+                               - (rbracket + blankline^2))
                            - (spnl * dash^-1 * at))^0)
 
   local citation_body_postnote
@@ -686,14 +681,22 @@
   local citation_body_chunk
                       = citation_body_prenote
                       * spnl * citation_name
-                      * spnlor(punctuation - (semicolon + rbracket))
+                      * (comma * spnl)^-1
                       * citation_body_postnote
 
   local citation_body = citation_body_chunk
                       * (semicolon * spnl * citation_body_chunk)^0
 
+  local citation_headless_body_postnote
+                      = Cs((alphanumeric^1
+                           + bracketed
+                           + inticks
+                           + (anyescaped
+                               - (rbracket + at + semicolon + blankline^2))
+                           - (spnl * rbracket))^0)
+
   local citation_headless_body
-                      = citation_body_postnote
+                      = citation_headless_body_postnote
                       * (sp * semicolon * spnl * citation_body_chunk)^0
   local rawnotes = {}
 
@@ -830,6 +833,16 @@
                   + spacechar^1 * Endline^-1 * eof / ""
                   + spacechar^1 * Endline^-1 * optionalspace / writer.space
 
+  local NonbreakingEndline
+                  = newline * -( -- newline, but not before...
+                        blankline -- paragraph break
+                      + tightblocksep  -- nested list
+                      + eof       -- end of document
+                      + bqstart
+                      + headerstart
+                      + fencestart
+                    ) * spacechar^0 / writer.nbsp
+
   local NonbreakingSpace
                   = spacechar^2 * Endline / writer.linebreak
                   + spacechar^1 * Endline^-1 * eof / ""
@@ -1214,6 +1227,7 @@
   inlines_no_link = Ct(inlines_no_link_t)
 
   local inlines_nbsp_t = util.table_copy(inlines_t)
+  inlines_nbsp_t.Endline = NonbreakingEndline
   inlines_nbsp_t.Space = NonbreakingSpace
   inlines_nbsp = Ct(inlines_nbsp_t)
   function self.convert(input)



More information about the tex-live-commits mailing list