summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-09-06 21:30:37 +0000
committerKarl Berry <karl@freefriends.org>2016-09-06 21:30:37 +0000
commitb17c2558bca9c4b79e1b9352a7cee8c940542e1b (patch)
treee4e3fb16c5a40c5702fd85af92da59157d791948 /Master/texmf-dist
parent3a322c171ab33afe5d5481ca124f9c2b3d3e1fc9 (diff)
markdown (6sep16)
git-svn-id: svn://tug.org/texlive/trunk@42000 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/generic/markdown/markdown.pdfbin318364 -> 322918 bytes
-rw-r--r--Master/texmf-dist/source/generic/markdown/markdown.dtx108
-rw-r--r--Master/texmf-dist/tex/generic/markdown/markdown.tex6
-rw-r--r--Master/texmf-dist/tex/luatex/markdown/markdown.lua44
4 files changed, 96 insertions, 62 deletions
diff --git a/Master/texmf-dist/doc/generic/markdown/markdown.pdf b/Master/texmf-dist/doc/generic/markdown/markdown.pdf
index 8ef9dee5525..338ca1c1363 100644
--- a/Master/texmf-dist/doc/generic/markdown/markdown.pdf
+++ b/Master/texmf-dist/doc/generic/markdown/markdown.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/generic/markdown/markdown.dtx b/Master/texmf-dist/source/generic/markdown/markdown.dtx
index e400439b93d..4a78e77069c 100644
--- a/Master/texmf-dist/source/generic/markdown/markdown.dtx
+++ b/Master/texmf-dist/source/generic/markdown/markdown.dtx
@@ -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,53 +183,60 @@ modules['markdown'] = metadata
% 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>
%<*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 @@ local md5 = require("md5")
% \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 @@ local md5 = require("md5")
% \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 @@ defaultOptions.tightLists = true
% \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 @@ defaultOptions.tightLists = true
% 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 @@ function M.writer.new(options)
% \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 @@ function M.reader.new(writer, options)
% \begin{macrocode}
local percent = P("%")
local at = P("@")
+ local comma = P(",")
local asterisk = P("*")
local dash = P("-")
local plus = P("+")
@@ -2546,7 +2553,7 @@ function M.reader.new(writer, options)
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 @@ function M.reader.new(writer, options)
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 @@ function M.reader.new(writer, options)
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,16 +2734,17 @@ function M.reader.new(writer, options)
% \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
+ bracketed
+ inticks
+ (anyescaped
- - (rbracket + semicolon + blankline^2))
+ - (rbracket + blankline^2))
- (spnl * dash^-1 * at))^0)
local citation_body_postnote
@@ -2757,14 +2758,22 @@ function M.reader.new(writer, options)
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 @@ function M.reader.new(writer, options)
+ 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 @@ function M.reader.new(writer, options)
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}
diff --git a/Master/texmf-dist/tex/generic/markdown/markdown.tex b/Master/texmf-dist/tex/generic/markdown/markdown.tex
index 12fcc8df129..532fc114507 100644
--- a/Master/texmf-dist/tex/generic/markdown/markdown.tex
+++ b/Master/texmf-dist/tex/generic/markdown/markdown.tex
@@ -45,15 +45,15 @@
%%
%% 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
\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
diff --git a/Master/texmf-dist/tex/luatex/markdown/markdown.lua b/Master/texmf-dist/tex/luatex/markdown/markdown.lua
index 6a194bbf7ea..c62b5ed8b95 100644
--- a/Master/texmf-dist/tex/luatex/markdown/markdown.lua
+++ b/Master/texmf-dist/tex/luatex/markdown/markdown.lua
@@ -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 M.reader.new(writer, options)
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 @@ function M.reader.new(writer, options)
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 @@ function M.reader.new(writer, options)
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 @@ function M.reader.new(writer, options)
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,16 +657,17 @@ function M.reader.new(writer, options)
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
+ bracketed
+ inticks
+ (anyescaped
- - (rbracket + semicolon + blankline^2))
+ - (rbracket + blankline^2))
- (spnl * dash^-1 * at))^0)
local citation_body_postnote
@@ -686,14 +681,22 @@ function M.reader.new(writer, options)
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 @@ function M.reader.new(writer, options)
+ 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 @@ function M.reader.new(writer, options)
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)