summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/markdown
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/generic/markdown')
-rw-r--r--Master/texmf-dist/source/generic/markdown/docstrip.cfg4
-rw-r--r--Master/texmf-dist/source/generic/markdown/markdown.dtx566
-rw-r--r--Master/texmf-dist/source/generic/markdown/markdown.ins1
3 files changed, 410 insertions, 161 deletions
diff --git a/Master/texmf-dist/source/generic/markdown/docstrip.cfg b/Master/texmf-dist/source/generic/markdown/docstrip.cfg
index 9dc5f652309..959a3a21c3b 100644
--- a/Master/texmf-dist/source/generic/markdown/docstrip.cfg
+++ b/Master/texmf-dist/source/generic/markdown/docstrip.cfg
@@ -22,7 +22,7 @@
-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE^^J%
-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.^^J%
--^^J%
--- Copyright (C) 2016-2024 Vít Starý Novotný^^J%
+-- Copyright (C) 2016-2024 Vít Starý Novotný, Andrej Genčur^^J%
--^^J%
-- This work may be distributed and/or modified under the^^J%
-- conditions of the LaTeX Project Public License, either version 1.3^^J%
@@ -62,7 +62,7 @@
\let\luapostamble\empty
\declarepreamble\texpreamble
-Copyright (C) 2016-2024 Vít Starý Novotný
+Copyright (C) 2016-2024 Vít Starý Novotný, Andrej Genčur
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3c
diff --git a/Master/texmf-dist/source/generic/markdown/markdown.dtx b/Master/texmf-dist/source/generic/markdown/markdown.dtx
index 6ad42a46b26..97fa8d6b56f 100644
--- a/Master/texmf-dist/source/generic/markdown/markdown.dtx
+++ b/Master/texmf-dist/source/generic/markdown/markdown.dtx
@@ -122,7 +122,7 @@
---
title: A Markdown Interpreter for \TeX
url: https://github.com/witiko/markdown
-authors: [Vít Starý Novotný]
+authors: [Vít Starý Novotný, Andrej Genčur]
email: witiko@mail.muni.cz
revision: \markdownVersion
date: \markdownLastModified
@@ -796,6 +796,7 @@ abbr {
%<*themes-witiko-markdown-techdoc>
\ProvidesPackage{markdownthemewitiko_markdown_techdoc}[2022/12/13]
\RequirePackage{etoolbox}
+\gdef\ltd@title@author{\@gobble}%
\markdownSetup{
renderers = {
head*Four = {\paragraph{#1}\leavevmode},
@@ -804,6 +805,7 @@ abbr {
codeSpan = {\inline{#1}},
jekyllData(End) = {%
\AfterEndPreamble{%
+ \hypersetup{pdfauthor=\ltd@title@author}%
\printtitlepage
\tableofcontents
{\def\addcontentsline##1##2##3{}\listoffigures}%
@@ -812,8 +814,7 @@ abbr {
},
jekyllDataRenderers = {
/authors/* = {%
- \gdef\ltd@title@author{#1}%
- \hypersetup{pdfauthor={#1}}%
+ \expandafter\gdef\expandafter\ltd@title@author\expandafter{\ltd@title@author, #1}%
},
title = {%
\gdef\ltd@title@title{#1}%
@@ -875,7 +876,7 @@ abbr {
---
title: Markdown Package User Manual
-author: Vít Starý Novotný
+author: Vít Starý Novotný, Andrej Genčur
date: \markdownVersion{} \markdownLastModified{}
---
@@ -890,7 +891,7 @@ Introduction
The [Markdown package][pkg] converts [CommonMark][] markup to \TeX{} commands. The
functionality is provided both as a Lua module and as plain \TeX{}, \LaTeX{}, and
\Hologo{ConTeXt} macro packages that can be used to directly typeset \TeX{} documents
-containing markdown markup. Unlike other convertors, the Markdown package
+containing markdown markup. Unlike other converters, the Markdown package
does not require any external programs, and makes it easy to redefine how each
and every markdown element is rendered. Creative abuse of the markdown
syntax is encouraged. 😉
@@ -928,9 +929,9 @@ documentation][techdoc].
local metadata = {
version = "(((VERSION)))",
comment = "A module for the conversion from markdown to plain TeX",
- author = "John MacFarlane, Hans Hagen, Vít Starý Novotný",
+ author = "John MacFarlane, Hans Hagen, Vít Starý Novotný, Andrej Genčur",
copyright = {"2009-2016 John MacFarlane, Hans Hagen",
- "2016-2023 Vít Starý Novotný"},
+ "2016-2024 Vít Starý Novotný, Andrej Genčur"},
license = "LPPL 1.3c"
}
@@ -965,20 +966,28 @@ requirements.
Installation
------------
-If Markdown is not included in your \TeX{} distribution, you will need to
-install it.
+If the Markdown package is not included in your \TeX{} distribution, you will
+need to install it.
-First, download the package from the repository using Git:
+From [Releases][], download [an archive `markdown.zip` for this version of the
+Markdown package (\markdownShortVersion{})][this-release] or a different version
+that you wish to install. Then, unzip the archive. If you downloaded an archive
+for a different version of the Markdown package, you should now locate a file
+named `markdown.html` with the user manual for that version, open it, and
+follow the installation steps in it rather than the steps from this manual.
+
+ [releases]: https://github.com/witiko/markdown/releases (Releases - witiko/markdown)
+ [this-release]: https://github.com/witiko/markdown/releases/download/\markdownShortVersion{}/markdown.zip (Release \markdownShortVersion{} - witiko/markdown)
+
+Alternatively, download the package from the repository using Git, enter the
+directory named `markdown` and run the `make base` command using GNU Make:
``` sh
git clone https://github.com/witiko/markdown
-``````
-Next, enter the directory named `markdown` and run the `make base` command using
-GNU Make:
-``` sh
cd markdown
make base
``````
-This should produce the following files:
+
+Either of the two abovelisted approaches should produce the following files:
* `markdown.lua`: The Lua module
* `libraries/markdown-tinyyaml.lua`: An external library for reading \acro{yaml}
@@ -1039,6 +1048,8 @@ This is where the individual files should be placed:
* `./markdownthemewitiko_markdown_defaults.sty`
* `./t-markdownthemewitiko_markdown_defaults.tex`
+The file `markdown.tex` *must* be placed in a directory named `markdown`.
+
%</manual>
%<*lua>
% \fi
@@ -1138,6 +1149,17 @@ end)()
%: A package that implements Unicode case-folding in \TeX{} Live${}\geq{}2020$.
%
% \end{markdown}
+% \iffalse
+%</lua>
+%<*depends>
+% \fi
+% \begin{macrocode}
+hard lua-uni-algos
+% \end{macrocode}
+% \iffalse
+%</depends>
+%<*lua>
+% \fi
% \begin{macrocode}
local uni_algos = require("lua-uni-algos")
% \end{macrocode}
@@ -1156,6 +1178,13 @@ local uni_algos = require("lua-uni-algos")
% \end{markdown}
% \iffalse
%</lua>
+%<*depends>
+% \fi
+% \begin{macrocode}
+# hard lua-tinyyaml # TODO: Uncomment after TeX Live 2022 has been deprecated.
+% \end{macrocode}
+% \iffalse
+%</depends>
%<*tex>
% \fi
% \par
@@ -1175,18 +1204,33 @@ local uni_algos = require("lua-uni-algos")
% such as options, renderers, and renderer prototypes.
%
% \end{markdown}
-% \begin{macrocode}
+% \iffalse
%</tex>
+%<*depends>
+% \fi
+% \begin{macrocode}
+hard l3kernel
+% \end{macrocode}
+% \iffalse
+%</depends>
%<*context>
+% \fi
+% \begin{macrocode}
\unprotect
+% \end{macrocode}
+% \iffalse
%</context>
%<*context,tex>
+% \fi
+% \begin{macrocode}
\ifx\ExplSyntaxOn\undefined
\input expl3-generic
\fi
+% \end{macrocode}
+% \iffalse
%</context,tex>
%<*tex>
-% \end{macrocode}
+% \fi
% \begin{markdown}
%
% \pkg{lt3luabridge}
@@ -1195,6 +1239,20 @@ local uni_algos = require("lua-uni-algos")
% with other TeX engines that provide the *shell escape* capability,
% which allows them to execute code with the system's shell.
%
+% \end{markdown}
+% \iffalse
+%</tex>
+%<*depends>
+% \fi
+% \begin{macrocode}
+hard lt3luabridge
+% \end{macrocode}
+% \iffalse
+%</depends>
+%<*tex>
+% \fi
+% \begin{markdown}
+%
% The plain \TeX{} part of the package also requires the following Lua module:
%
% \pkg{Lua File System}
@@ -1239,10 +1297,13 @@ local uni_algos = require("lua-uni-algos")
%<*themes-witiko-dot,latex-themes-witiko-graphicx-http>
% \fi
% \begin{macrocode}
-\NeedsTeXFormat{LaTeX2e}%
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{expl3}
% \end{macrocode}
% \iffalse
%</themes-witiko-dot,latex-themes-witiko-graphicx-http>
+%</latex>
+%<*depends>
% \fi
% \begin{markdown}
% a \TeX{} engine that extends \Hologo{eTeX}, and all the plain \TeX{}
@@ -1259,10 +1320,23 @@ local uni_algos = require("lua-uni-algos")
%
%: A package that provides the `\url` macro for the typesetting of links.
%
+% \end{markdown}
+% \begin{macrocode}
+soft url
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{graphicx}
%
%: A package that provides the `\includegraphics` macro for the typesetting
-% of images.
+% of images.Furthermore, it also provides a key-value interface that is
+% used in the default renderer prototypes for image attribute contexts.
+%
+% \end{markdown}
+% \begin{macrocode}
+soft graphics
+% \end{macrocode}
+% \begin{markdown}
%
% \pkg{paralist}
%
@@ -1271,45 +1345,85 @@ local uni_algos = require("lua-uni-algos")
% ordered lists, and definition lists as well as the rendering of
% fancy lists.
%
+% \end{markdown}
+% \begin{macrocode}
+soft paralist
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{ifthen}
%
%: A package that provides a concise syntax for the inspection of macro
% values. It is used in the `witiko/dot` \LaTeX{} theme (see Section
% <#sec:latexthemes>).
%
+% \end{markdown}
+% \begin{macrocode}
+soft latex
+soft epstopdf-pkg # required by `latex`
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{fancyvrb}
%
%: A package that provides the `\VerbatimInput` macros for the verbatim
% inclusion of files containing code.
%
+% \end{markdown}
+% \begin{macrocode}
+soft fancyvrb
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{csvsimple}
%
%: A package that provides the `\csvautotabular` macro for typesetting
% \acro{csv} files in the default renderer prototypes for iA\\,Writer
% content blocks.
%
+% \end{markdown}
+% \begin{macrocode}
+soft csvsimple
+soft pgf # required by `csvsimple`, which loads `pgfkeys.sty`
+soft tools # required by `csvsimple`, which loads `shellesc.sty`
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{gobble}
%
%: A package that provides the `\@gobblethree` \TeX{} command that
% is used in the default renderer prototype for citations. The package
% is included in \TeX Live${}\geq{}2016$.
%
+% \end{markdown}
+% \begin{macrocode}
+soft gobble
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{amsmath} and \pkg{amssymb}
%
%: Packages that provide symbols used for drawing ticked and unticked
% boxes.
%
+% \end{markdown}
+% \begin{macrocode}
+soft amsmath
+soft amsfonts
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{catchfile}
%
%: A package that catches the contents of a file and puts it in a macro. It
% is used in the `witiko/graphicx/http` \LaTeX{} theme, see Section
% <#sec:latexthemes>.
%
-% \pkg{graphicx}
-%
-%: A package that builds upon the \pkg{graphics} package, which is part of
-% the \LaTeXe{} kernel. It provides a key-value interface that is used in
-% the default renderer prototypes for image attribute contexts.
+% \end{markdown}
+% \begin{macrocode}
+soft catchfile
+% \end{macrocode}
+% \begin{markdown}
%
% \pkg{grffile}
%
@@ -1320,6 +1434,12 @@ local uni_algos = require("lua-uni-algos")
% the `witiko/dot` and `witiko/graphicx/http` \LaTeX{} themes, see Section
% <#sec:latexthemes>.
%
+% \end{markdown}
+% \begin{macrocode}
+soft grffile
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{etoolbox}
%
%: A package that is used to polyfill the general hook management system in
@@ -1327,10 +1447,23 @@ local uni_algos = require("lua-uni-algos")
% <#sec:latex-yaml-metadata>, and also in the default renderer prototype
% for identifier attributes.
%
+% \end{markdown}
+% \begin{macrocode}
+soft etoolbox
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{soulutf8}
%
%: A package that is used in the default renderer prototype for
% strike-throughs and marked text.
+% <!-- TODO: 1,$s/soulutf8/soul/g in TeX Live 2023. -->
+%
+% \end{markdown}
+% \begin{macrocode}
+soft soul
+% \end{macrocode}
+% \begin{markdown}
%
% \pkg{ltxcmds}
%
@@ -1338,6 +1471,12 @@ local uni_algos = require("lua-uni-algos")
% \pkg{listings} packages are loaded in the default renderer prototype
% for fenced code blocks.
%
+% \end{markdown}
+% \begin{macrocode}
+soft ltxcmds
+% \end{macrocode}
+% \begin{markdown}
+%
% \pkg{verse}
%
%: A package that is used in the default renderer prototypes for
@@ -1345,10 +1484,13 @@ local uni_algos = require("lua-uni-algos")
%
% \end{markdown}
% \begin{macrocode}
-\RequirePackage{expl3}
+soft verse
% \end{macrocode}
+% \begin{markdown}
+%
+% \end{markdown}
% \iffalse
-%</latex>
+%</depends>
%<*context>
% \fi
% \par
@@ -1691,9 +1833,6 @@ In this section, I will describe the individual parts of the Markdown package.
Each part will be shown by example, leaving the implementation details to the
[technical documentation][techdoc].
- [techdoc]: https://mirrors.ctan.org/macros/generic/markdown/markdown.pdf
- (A Markdown Interpreter for \TeX{})
-
/markdown-interfaces.md
/markdown-options.md
/markdown-tokens.md
@@ -2502,11 +2641,12 @@ defaultOptions.eagerCache = false
: Every call to the function \luamref{new}`(options)` will produce a new
conversion function that will not be cached. This is slower than
caching conversion functions and may expose bugs related to memory
- leaks in the creation of conversion functions, see also issue [#226][1].
+ leaks in the creation of conversion functions, see also issue
+ [#226][issue-226].
This was the default behavior until version 3.0.0 of the Markdown package.
- [1]: https://github.com/witiko/markdown/pull/226#issuecomment-1599641634
+ [issue-226]: https://github.com/witiko/markdown/pull/226#issuecomment-1599641634
% \end{markdown}
% \iffalse
@@ -7229,7 +7369,7 @@ defaultOptions.html = true
: false
: Enable the escaping of special plain \TeX{} characters outside verbatim
- environments, so that they are not interpretted by \TeX{}. This is
+ environments, so that they are not interpreted by \TeX{}. This is
encouraged when typesetting automatically generated content or
markdown documents that were not prepared with this package in mind.
@@ -8182,10 +8322,6 @@ following text:
> Here is a note reference,[^1] and another.[^longnote]
>
-> [^1]: Here is the note.
->
-> [^longnote]: Here's one with multiple blocks.
->
> Subsequent paragraphs are indented to show that they
> belong to the previous note.
>
@@ -8236,10 +8372,6 @@ following text:
> Here is a note reference,[^1] and another.[^longnote]
>
-> [^1]: Here is the note.
->
-> [^longnote]: Here's one with multiple blocks.
->
> Subsequent paragraphs are indented to show that they
> belong to the previous note.
>
@@ -8528,7 +8660,7 @@ defaultOptions.rawAttribute = false
%
: true
- : Enable [relative references][1] in autolinks:
+ : Enable [relative references][rfc3986] in autolinks:
``` md
I conclude in Section <#conclusion>.
@@ -8544,7 +8676,7 @@ defaultOptions.rawAttribute = false
: Disable relative references in autolinks.
- [1]: https://datatracker.ietf.org/doc/html/rfc3986#section-4.2
+ [rfc3986]: https://datatracker.ietf.org/doc/html/rfc3986#section-4.2
% \end{markdown}
% \iffalse
@@ -10486,9 +10618,9 @@ luatex document.tex
A PDF document named `document.pdf` should be produced and contain the
following text:
-> \\(E=mc^2\\)
+> \(E=mc^2\)
>
-> \\[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\\]
+> \[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\]
##### Lua CLI Example {.unnumbered}
@@ -10528,13 +10660,13 @@ script file using [Kpathsea][].
A PDF document named `document.pdf` should be produced and contain the
following text:
-> \\\(E=mc^2\\)
->
-> \\\[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\\]
->
> \\(E=mc^2\\)
>
> \\[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\\]
+>
+> \(E=mc^2\)
+>
+> \[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\]
##### Plain \TeX{} Example {.unnumbered}
@@ -10559,9 +10691,9 @@ luatex document.tex
A PDF document named `document.pdf` should be produced and contain the
following text:
-> \\(E=mc^2\\)
+> \(E=mc^2\)
>
-> \\[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\\]
+> \[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\]
##### \LaTeX{} Example {.unnumbered}
@@ -10587,9 +10719,9 @@ lualatex document.tex
A PDF document named `document.pdf` should be produced and contain the
following text:
-> \\(E=mc^2\\)
+> \(E=mc^2\)
>
-> \\[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\\]
+> \[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\]
##### \Hologo{ConTeXt} Example {.unnumbered}
@@ -10615,9 +10747,9 @@ context --luatex document.tex
A PDF document named `document.pdf` should be produced and contain the
following text:
-> \\(E=mc^2\\)
+> \(E=mc^2\)
>
-> \\[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\\]
+> \[\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\]
%</manual-options>
%<*tex>
@@ -11322,7 +11454,7 @@ for i = 1, #arg do
end
% \end{macrocode}
% \begin{markdown}
-% The first argument that matches none of the above patters is assumed to be
+% The first argument that matches none of the above patterns is assumed to be
% the input filename. The input filename should correspond to the Markdown
% document that is going to be converted to a \TeX{} document.
% \end{markdown}
@@ -11331,7 +11463,7 @@ for i = 1, #arg do
input_filename = arg[i]
% \end{macrocode}
% \begin{markdown}
-% The first argument that matches none of the above patters is assumed to be
+% The first argument that matches none of the above patterns is assumed to be
% the output filename. The output filename should correspond to the \TeX{}
% document that will result from the conversion.
% \end{markdown}
@@ -11856,47 +11988,10 @@ For more information, see the examples for the \Opt{finalizeCache} option.
%
% \end{markdown}
% \begin{macrocode}
-\cs_generate_variant:Nn
- \@@_add_plain_tex_option:nnn
- { nnV }
-% \end{macrocode}
-% \begin{markdown}
-%
-% Use the \pkg{lt3luabridge} library to determine the default value of the
-% \mref{markdownOptionOutputDir} macro by using the environmental variable
-% `TEXMF_OUTPUT_DIRECTORY` that is available since TeX~Live 2024.
-%
-% \end{markdown}
-% \begin{macrocode}
-\ExplSyntaxOff
-\input lt3luabridge.tex
-\ExplSyntaxOn
-\bool_if:nTF
- {
- \cs_if_exist_p:N
- \luabridge_tl_set:Nn &&
- (
- \int_compare_p:nNn
- { \g_luabridge_method_int }
- =
- { \c_luabridge_method_directlua_int } ||
- \sys_if_shell_unrestricted_p:
- )
- }
- {
- \luabridge_tl_set:Nn
- \l_tmpa_tl
- { print(os.getenv("TEXMF_OUTPUT_DIRECTORY") or ".") }
- }
- {
- \tl_set:Nn
- \l_tmpa_tl
- { . }
- }
-\@@_add_plain_tex_option:nnV
+\@@_add_plain_tex_option:nnn
{ outputDir }
{ path }
- \l_tmpa_tl
+ { . }
% \end{macrocode}
% \iffalse
%</tex>
@@ -12172,22 +12267,73 @@ A PDF document named `document.pdf` should be produced and contain the text
% \end{macrocode}
% \begin{markdown}
%
-% Do not override options defined before loading the package.
+% Use the \pkg{lt3luabridge} library to determine the default value of the
+% \mref{markdownOptionOutputDir} macro by using the environmental variable
+% `TEXMF_OUTPUT_DIRECTORY` that is available since TeX~Live 2024.
%
% \end{markdown}
% \begin{macrocode}
- \@@_option_tl_to_csname:nN
+ \str_if_eq:nnTF
{ #1 }
- \l_tmpa_tl
- \cs_if_exist:cF
- { \l_tmpa_tl }
+ { outputDir }
+ { \@@_define_option_command_output_dir: }
{
- \@@_get_default_option_value:nN
- { #1 }
- \l_tmpa_tl
- \@@_set_option_value:nV
+% \end{macrocode}
+% \begin{markdown}
+%
+% Do not override options defined before loading the package.
+%
+% \end{markdown}
+% \begin{macrocode}
+ \@@_option_tl_to_csname:nN
{ #1 }
\l_tmpa_tl
+ \cs_if_exist:cF
+ { \l_tmpa_tl }
+ {
+ \@@_get_default_option_value:nN
+ { #1 }
+ \l_tmpa_tl
+ \@@_set_option_value:nV
+ { #1 }
+ \l_tmpa_tl
+ }
+ }
+ }
+\ExplSyntaxOff
+\input lt3luabridge.tex
+\ExplSyntaxOn
+\cs_new:Nn
+ \@@_define_option_command_output_dir:
+ {
+ \cs_if_free:NT
+ \markdownOptionOutputDir
+ {
+ \bool_if:nTF
+ {
+ \cs_if_exist_p:N
+ \luabridge_tl_set:Nn &&
+ (
+ \int_compare_p:nNn
+ { \g_luabridge_method_int }
+ =
+ { \c_luabridge_method_directlua_int } ||
+ \sys_if_shell_unrestricted_p:
+ )
+ }
+ {
+ \luabridge_tl_set:Nn
+ \l_tmpa_tl
+ { print(os.getenv("TEXMF_OUTPUT_DIRECTORY") or ".") }
+ \tl_gset:NV
+ \markdownOptionOutputDir
+ \l_tmpa_tl
+ }
+ {
+ \tl_gset:Nn
+ \markdownOptionOutputDir
+ { . }
+ }
}
}
\cs_new:Nn
@@ -14039,7 +14185,7 @@ following text:
#### Code Block Renderers
The \mdef{markdownRendererInputVerbatim} macro represents a code
block. The macro receives a single argument that corresponds to the
-filename of a file contaning the code block contents.
+filename of a file containing the code block contents.
% \end{markdown}
%
@@ -14073,7 +14219,7 @@ filename of a file contaning the code block contents.
The \mdef{markdownRendererInputFencedCode} macro represents a fenced code
block. This macro will only be produced, when the \Opt{fencedCode} option is
enabled. The macro receives three arguments that correspond to the filename of
-a file contaning the code block contents, the fully escaped code fence infostring
+a file containing the code block contents, the fully escaped code fence infostring
that can be directly typeset, and the raw code fence infostring that can be used
outside typesetting.
@@ -15289,7 +15435,7 @@ following text:
% \begin{markdown}
#### Ellipsis Renderer
-The \mdef{markdownRendererEllipsis} macro replaces any occurance of ASCII
+The \mdef{markdownRendererEllipsis} macro replaces any occurrence of ASCII
ellipses in the input text. This macro will only be produced, when the
\Opt{smartEllipses} option is enabled. The macro receives no arguments.
@@ -18435,7 +18581,7 @@ following text:
#### Raw Content Renderers
The \mdef{markdownRendererInputRawInline} macro represents an inline raw span.
-The macro receives two arguments: the filename of a file contaning the inline
+The macro receives two arguments: the filename of a file containing the inline
raw span contents and the raw attribute that designates the format of the
inline raw span. This macro will only be produced, when the \Opt{rawAttribute}
option is enabled.
@@ -18470,7 +18616,7 @@ option is enabled.
% \begin{markdown}
The \mdef{markdownRendererInputRawBlock} macro represents a raw block. The
-macro receives two arguments: the filename of a file contaning the raw block
+macro receives two arguments: the filename of a file containing the raw block
and the raw attribute that designates the format of the raw block. This macro
will only be produced, when the \Opt{rawAttribute} and \Opt{fencedCode} options
are enabled.
@@ -19368,7 +19514,7 @@ following content:
\markdownSetup{
renderers = {
table = {%
- This is a table with caption \emph{#1} that is #3 colums wide
+ This is a table with caption \emph{#1} that is #3 columns wide
and #2 rows long.
\rowCounter=0%
\def\rowTotal{#2}%
@@ -19397,7 +19543,7 @@ A PDF document named `document.pdf` should be produced and contain the
following text:
> This is a table with caption *Demonstration of pipe table syntax* that is 4
-> colums wide and 4 rows long. As for the alignment, column number 1 is
+> columns wide and 4 rows long. As for the alignment, column number 1 is
> right-aligned, column number 2 is left-aligned, column number 3 has default
> alignment, and column number 4 is centered. In row 1, column number 1 says
> *Right*, column number 2 says *Left*, column number 3 says *Default*, and
@@ -19454,7 +19600,7 @@ following content:
\input markdown
\def\markdownOptionTexMathDollars{true}
\def\markdownRendererInlineMath#1{$#1\dots$}
-\def\markdownRendererDisplayMath#1{$$#1\eqno(1)$$}
+\def\markdownRendererDisplayMath#1{$$#1\nonumber$$}
\markdownBegin
$E=mc^2$
@@ -19471,7 +19617,7 @@ following text:
> $E=mc^2\dots$
>
-> $$\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\eqno(1)$$
+> $$\hat{f} \left ( \xi \right )= \int_{-\infty}^{\infty} f\left ( x \right ) e^{-i2\pi \xi x} dx\nonumber$$
##### \LaTeX{} Example {.unnumbered}
@@ -20256,7 +20402,7 @@ following text:
%#### Generating Plain \TeX{} Token Renderer Macros and Key-Values {#plain-tex-renderers}
%
% We define the command \mdef{@@_define_renderers:} that defines plain \TeX{}
-% macros for token renderers. Futhermore, the `\markdownSetup` macro also accepts
+% macros for token renderers. Furthermore, the `\markdownSetup` macro also accepts
% the `renderers` key, whose value must be a list of key-values, where the keys
% correspond to the markdown token renderer macros and the values are new
% definitions of these token renderers.
@@ -20974,7 +21120,7 @@ following text:
%#### Generating Plain \TeX{} Token Renderer Prototype Macros and Key-Values {#plain-tex-renderer-prototypes}
%
% We define the command \mdef{@@_define_renderer_prototypes:} that defines plain \TeX{}
-% macros for token renderer prototypes. Futhermore, the `\markdownSetup` macro also accepts
+% macros for token renderer prototypes. Furthermore, the `\markdownSetup` macro also accepts
% the `rendererPrototype` key, whose value must be a list of key-values, where the keys
% correspond to the markdown token renderer prototype macros and the values are new
% definitions of these token renderer prototypes.
@@ -21600,7 +21746,7 @@ following code in our \LaTeX{} document:
We can also set all plain \TeX{} options directly from \LaTeX{}. For example,
to set the `\markdownOptionInputTempFileName` plain \TeX{} option to
-`helper-script.lua`, we would inclde the following code in our \LaTeX{}
+`helper-script.lua`, we would include the following code in our \LaTeX{}
document:
``` tex
@@ -22559,7 +22705,7 @@ end
% Given a table `char_escapes` mapping escapable characters to escaped
% strings and optionally a table `string_escapes` mapping escapable strings
% to escaped strings, the \luamdef{util.escaper} method returns an escaper
-% function that escapes all occurances of escapable strings and characters (in
+% function that escapes all occurrences of escapable strings and characters (in
% this order).
%
% The method uses \pkg{LPeg}, which is faster than the Lua `string.gsub`
@@ -22588,7 +22734,7 @@ function util.escaper(char_escapes, string_escapes)
% \begin{markdown}
% If `string_escapes` is provided, turn `escapable` into the
% $$\sum^^B{(`k`, `v`)\in`string_escapes`}`P(k) / v` + `escapable`$$
-% capture that replaces any occurance of the string `k` with the string
+% capture that replaces any occurrence of the string `k` with the string
% `v` for each $(`k`, `v`)\in`string_escapes`$. Note that the pattern
% summation is not commutative and its operands are inspected in the
% summation order during the matching. As a corrolary, the strings always
@@ -27660,19 +27806,21 @@ parsers.link_text = parsers.lbracket
- (parsers.newline + parsers.lbracket + parsers.rbracket + parsers.blankline^2))))^0)
* parsers.rbracket
+parsers.link_label_body = -#(parsers.sp * parsers.rbracket)
+ * #((parsers.any - parsers.rbracket)^-999 * parsers.rbracket)
+ * Cs((parsers.alphanumeric^1
+ + parsers.inticks
+ + parsers.autolink
+ + V("InlineHtml")
+ + ( parsers.backslash * parsers.backslash)
+ + ( parsers.backslash * (parsers.lbracket + parsers.rbracket)
+ + V("NoSoftLineBreakSpace")
+ + V("NoSoftLineBreakEndline")
+ + (parsers.any
+ - (parsers.newline + parsers.lbracket + parsers.rbracket + parsers.blankline^2))))^1)
+
parsers.link_label = parsers.lbracket
- * -#(parsers.sp * parsers.rbracket)
- * #((parsers.any - parsers.rbracket)^-999 * parsers.rbracket)
- * Cs((parsers.alphanumeric^1
- + parsers.inticks
- + parsers.autolink
- + V("InlineHtml")
- + ( parsers.backslash * parsers.backslash)
- + ( parsers.backslash * (parsers.lbracket + parsers.rbracket)
- + V("NoSoftLineBreakSpace")
- + V("NoSoftLineBreakEndline")
- + (parsers.any
- - (parsers.newline + parsers.lbracket + parsers.rbracket + parsers.blankline^2))))^1)
+ * parsers.link_label_body
* parsers.rbracket
parsers.inparens_url = P{ parsers.lparent
@@ -28562,6 +28710,9 @@ function M.reader.new(writer, options)
-- List of references defined in the document
local references
+ -- List of note references defined in the document
+ parsers.rawnotes = {}
+
% \end{macrocode}
% \par
% \begin{markdown}
@@ -28599,6 +28750,19 @@ function M.reader.new(writer, options)
return references[self.normalize_tag(tag)]
end
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% The \luamdef{reader->lookup_note_reference} method looks up a
+% note reference with label `tag`.
+%
+% \end{markdown}
+% \begin{macrocode}
+ function self.lookup_note_reference(tag)
+ return parsers.rawnotes[self.normalize_tag(tag)]
+ end
+
parsers.title_s_direct_ref = parsers.squote
* Cs((parsers.html_entities
+ (parsers.anyescaped - parsers.squote - parsers.blankline^2))^0)
@@ -28669,15 +28833,49 @@ function M.reader.new(writer, options)
+ #parsers.link_text
* Cg(Cc("link_text"), "link_type")
+ parsers.note_opening = #(parsers.circumflex * parsers.link_text)
+ * Cg(Cc("note_inline"), "link_type")
+
+ parsers.raw_note_opening = #( parsers.lbracket
+ * parsers.circumflex
+ * parsers.link_label_body
+ * parsers.rbracket)
+ * Cg(Cc("raw_note"), "link_type")
+
+ local inline_note_element = Cg(Cc("note"), "element")
+ * parsers.note_opening
+ * Cg(parsers.circumflex * parsers.lbracket, "content")
+
+ local image_element = Cg(Cc("image"), "element")
+ * parsers.image_opening
+ * Cg(parsers.exclamation * parsers.lbracket, "content")
+
+ local note_element = Cg(Cc("note"), "element")
+ * parsers.raw_note_opening
+ * Cg(parsers.lbracket * parsers.circumflex, "content")
+
+ local link_element = Cg(Cc("link"), "element")
+ * parsers.link_opening
+ * Cg(parsers.lbracket, "content")
+
+ local opening_elements = parsers.fail
+
+ if options.inlineNotes then
+ opening_elements = opening_elements + inline_note_element
+ end
+
+ opening_elements = opening_elements + image_element
+
+ if options.notes then
+ opening_elements = opening_elements + note_element
+ end
+
+ opening_elements = opening_elements + link_element
+
parsers.link_image_opening = Ct( Cg(Cc("delimiter"), "type")
* Cg(Cc(true), "is_opening")
* Cg(Cc(false), "is_closing")
- * ( Cg(Cc("image"), "element")
- * parsers.image_opening
- * Cg(parsers.exclamation * parsers.lbracket, "content")
- + Cg(Cc("link"), "element")
- * parsers.link_opening
- * Cg(parsers.lbracket, "content")))
+ * opening_elements)
parsers.link_image_closing = Ct( Cg(Cc("delimiter"), "type")
* Cg(Cc("link"), "element")
@@ -28750,7 +28948,7 @@ function M.reader.new(writer, options)
local value = t[i]
if value.type == "delimiter" and
value.is_opening and
- (value.element == "link" or value.element == "image")
+ (value.element == "link" or value.element == "image" or value.element == "note")
and not value.removed then
if value.is_active then
return i
@@ -28893,6 +29091,15 @@ function M.reader.new(writer, options)
rendered = writer.image(mapped, reference.url, reference.title, reference.attributes)
end
+ if (t[opening_index].element == "note") then
+ if (t[opening_index].link_type == "note_inline") then
+ rendered = writer.note(mapped)
+ end
+ if (t[opening_index].link_type == "raw_note") then
+ rendered = writer.note(reference)
+ end
+ end
+
t[opening_index].rendered = rendered
delete_parsed_content_in_range(t, opening_index + 1, closing_index)
empty_content_in_range(t, opening_index, closing_index)
@@ -28958,7 +29165,7 @@ function M.reader.new(writer, options)
% \end{macrocode}
% \begin{markdown}
%
-% Resolve an inline link [a](b "c") from the delimiters at `opening_index` and `closing_index`
+% Resolve an inline link `[a](b "c")` from the delimiters at `opening_index` and `closing_index`
% within a delimiter table `t`. Here, compared to other types of links, no reference definition is needed.
%
% \end{markdown}
@@ -28971,7 +29178,20 @@ function M.reader.new(writer, options)
% \end{macrocode}
% \begin{markdown}
%
-% Resolve a shortcut link [a] from the delimiters at `opening_index` and `closing_index` within a delimiter table `t`.
+% Resolve an inline note `^[a]` from the delimiters at `opening_index` and `closing_index`
+% within a delimiter table `t`.
+%
+% \end{markdown}
+% \begin{macrocode}
+ local function resolve_note_inline_link(t, opening_index, closing_index)
+ local inline_content = resolve_inline_following_content(t, closing_index, false, false)
+ render_link_or_image(t, opening_index, closing_index, closing_index, inline_content)
+ end
+
+% \end{macrocode}
+% \begin{markdown}
+%
+% Resolve a shortcut link `[a]` from the delimiters at `opening_index` and `closing_index` within a delimiter table `t`.
% Continue if a tag `a` is not found in the references.
%
% \end{markdown}
@@ -28990,7 +29210,25 @@ function M.reader.new(writer, options)
% \end{macrocode}
% \begin{markdown}
%
-% Resolve a full link [a][b] from the delimiters at `opening_index` and `closing_index` within a delimiter table `t`.
+% Resolve a note `[^a]` from the delimiters at `opening_index` and `closing_index` within a delimiter table `t`.
+% Continue if a tag `a` is not found in the rawnotes.
+%
+% \end{markdown}
+% \begin{macrocode}
+ local function resolve_raw_note_link(t, opening_index, closing_index)
+ local content = collect_link_content(t, opening_index + 1, closing_index - 1)
+ local r = self.lookup_note_reference(content)
+
+ if r then
+ local parsed_ref = self.parser_functions.parse_blocks_nested(r)
+ render_link_or_image(t, opening_index, closing_index, closing_index, parsed_ref)
+ end
+ end
+
+% \end{macrocode}
+% \begin{markdown}
+%
+% Resolve a full link `[a][b]` from the delimiters at `opening_index` and `closing_index` within a delimiter table `t`.
% Continue if a tag `b` is not found in the references.
%
% \end{markdown}
@@ -29011,7 +29249,7 @@ function M.reader.new(writer, options)
% \end{macrocode}
% \begin{markdown}
%
-% Resolve a collapsed link [a][] from the delimiters at `opening_index` and `closing_index`
+% Resolve a collapsed link `[a][]` from the delimiters at `opening_index` and `closing_index`
% within a delimiter table `t`.
% Continue if a tag `a` is not found in the references.
%
@@ -29045,9 +29283,10 @@ function M.reader.new(writer, options)
end
for i,value in ipairs(t) do
- if not value.is_closing or
- value.type ~= "delimiter" or
- not (value.element == "link" or value.element == "image") then
+ if not value.is_closing
+ or value.type ~= "delimiter"
+ or not (value.element == "link" or value.element == "image" or value.element == "note")
+ or value.removed then
goto continue
end
@@ -29073,6 +29312,12 @@ function M.reader.new(writer, options)
if (link_type == "collapsed") then
resolve_collapsed_link(t, opener_position, i)
end
+ if (link_type == "note_inline") then
+ resolve_note_inline_link(t, opener_position, i)
+ end
+ if (link_type == "raw_note") then
+ resolve_raw_note_link(t, opener_position, i)
+ end
::continue::
end
@@ -30348,7 +30593,7 @@ M.extensions.citations = function(citation_nbsps)
)
* citation_name
* (parsers.internal_punctuation - parsers.semicolon)^-1
- * ( parsers.spnlc
+ * ( parsers.spnlc / function(_) return end
* citation_body_postnote
+ Cc("")
* parsers.spnlc
@@ -31781,6 +32026,8 @@ M.extensions.notes = function(notes, inline_notes)
local parsers = self.parsers
local writer = self.writer
+ local rawnotes = parsers.rawnotes
+
if inline_notes then
local InlineNote
= parsers.circumflex
@@ -31799,8 +32046,6 @@ M.extensions.notes = function(notes, inline_notes)
= #(parsers.lbracket * parsers.circumflex)
* parsers.link_label / strip_first_char
- local rawnotes = {}
-
-- like indirect_link
local function lookup_note(ref)
return writer.defer_call(function()
@@ -33119,7 +33364,7 @@ end
%### Themes {#themes-implementation}
%
% This section implements the theme-loading mechanism and the built-in themes
-% provided with the Markdown package. Futhermore, this section also implements
+% provided with the Markdown package. Furthermore, this section also implements
% the built-in plain \TeX{} themes provided with the Markdown package.
%
% \end{markdown}
@@ -34063,6 +34308,9 @@ end
}
}
}
+ \str_gset:NV
+ \g_luabridge_output_dirname_str
+ \markdownOptionOutputDir
\luabridge_now:e
{ #1 }
}
@@ -34358,7 +34606,7 @@ end
% \LaTeX{} Implementation {#lateximplementation}
%-------------------------
%
-% The \LaTeX{} implemenation makes use of the fact that, apart from some subtle
+% The \LaTeX{} implementation makes use of the fact that, apart from some subtle
% differences, \LaTeX{} implements the majority of the plain \TeX{}
% format~[@latex17, Section 9]. As a consequence, we can directly reuse the
% existing plain \TeX{} implementation.
@@ -34587,7 +34835,7 @@ end
%### Themes {#latex-themes-implementation}
%
% This section overrides the plain \TeX{} implementation of the theme-loading
-% mechanism from Section <#sec:themes-implementation>. Futhermore, this section
+% mechanism from Section <#sec:themes-implementation>. Furthermore, this section
% also implements the built-in \LaTeX{} themes provided with the Markdown package.
%
% \end{markdown}
@@ -35112,21 +35360,15 @@ end
\tl_set:Nn
\l_@@_latex_fancy_list_item_label_delimiter_style_tl
{ #2 }
- \tl_set:Nn
- \l_tmpa_tl
- {
- \plpartopsep=\partopsep
- \pltopsep=\topsep
- }
\@@_if_option:nTF
{ startNumber }
{
- \tl_put_right:Nn
+ \tl_set:Nn
\l_tmpa_tl
{ \begin{compactenum} }
}
{
- \tl_put_right:Nn
+ \tl_set:Nn
\l_tmpa_tl
{ \begin{compactenum}[ }
\tl_put_right:Nx
@@ -35136,6 +35378,12 @@ end
\l_tmpa_tl
{ ] }
}
+ \tl_put_left:Nn
+ \l_tmpa_tl
+ {
+ \plpartopsep=\partopsep
+ \pltopsep=\topsep
+ }
\tl_use:N
\l_tmpa_tl
},
@@ -36314,7 +36562,7 @@ end
%### Themes {#context-themes-implementation}
%
% This section overrides the plain \TeX{} implementation of the theme-loading
-% mechanism from Section <#sec:themes-implementation>. Futhermore, this section
+% mechanism from Section <#sec:themes-implementation>. Furthermore, this section
% also implements the built-in \Hologo{ConTeXt} themes provided with the
% Markdown package.
%
diff --git a/Master/texmf-dist/source/generic/markdown/markdown.ins b/Master/texmf-dist/source/generic/markdown/markdown.ins
index 8e777f4217c..4261ddfdd44 100644
--- a/Master/texmf-dist/source/generic/markdown/markdown.ins
+++ b/Master/texmf-dist/source/generic/markdown/markdown.ins
@@ -25,5 +25,6 @@
\file{markdown.css}{\from{markdown.dtx}{manual-css}}
\file{markdown-figure-block-diagram.tex}{\from{markdown.dtx}{techdoc-block-diagram}}
\file{markdown.bib}{\from{markdown.dtx}{techdoc-bibliography}}
+ \file{DEPENDS.txt}{\from{markdown.dtx}{depends}}
}
\endbatchfile