summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/generic/markdown/markdown.css25
-rw-r--r--Master/texmf-dist/doc/generic/markdown/markdown.html5670
-rw-r--r--Master/texmf-dist/doc/generic/markdown/markdown.md3324
-rw-r--r--Master/texmf-dist/doc/generic/markdown/markdown.pdfbin398905 -> 412653 bytes
-rw-r--r--Master/texmf-dist/scripts/markdown/markdown-cli.lua8
-rw-r--r--Master/texmf-dist/source/generic/markdown/docstrip.cfg4
-rw-r--r--Master/texmf-dist/source/generic/markdown/markdown.dtx5419
-rw-r--r--Master/texmf-dist/source/generic/markdown/markdown.ins3
-rw-r--r--Master/texmf-dist/tex/context/third/markdown/t-markdown.tex2
-rw-r--r--Master/texmf-dist/tex/generic/markdown/markdown.tex24
-rw-r--r--Master/texmf-dist/tex/latex/markdown/markdown.sty196
-rw-r--r--Master/texmf-dist/tex/luatex/markdown/markdown.lua253
12 files changed, 9136 insertions, 5792 deletions
diff --git a/Master/texmf-dist/doc/generic/markdown/markdown.css b/Master/texmf-dist/doc/generic/markdown/markdown.css
index 2e2f4fb6c44..5abe7013b44 100644
--- a/Master/texmf-dist/doc/generic/markdown/markdown.css
+++ b/Master/texmf-dist/doc/generic/markdown/markdown.css
@@ -323,3 +323,28 @@ table td {
}
}
+.tex sub, .latex sub, .latex sup {
+ text-transform: uppercase;
+}
+
+.tex sub, .latex sub {
+ vertical-align: -0.1ex;
+ margin-left: -0.1667em;
+ margin-right: -0.125em;
+}
+
+.tex, .latex, .tex sub, .latex sub {
+ font-size: 1em;
+}
+
+.latex sup {
+ font-size: 0.85em;
+ vertical-align: -0.35em;
+ margin-left: -0.36em;
+ margin-right: -0.15em;
+}
+
+abbr {
+ font-variant: small-caps;
+}
+
diff --git a/Master/texmf-dist/doc/generic/markdown/markdown.html b/Master/texmf-dist/doc/generic/markdown/markdown.html
index 523805f0347..203c1be5121 100644
--- a/Master/texmf-dist/doc/generic/markdown/markdown.html
+++ b/Master/texmf-dist/doc/generic/markdown/markdown.html
@@ -1,150 +1,149 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="Content-Style-Type" content="text/css" />
+ <meta charset="utf-8" />
<meta name="generator" content="pandoc" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="Vít Novotný" />
<title>Markdown Package User Manual</title>
- <style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
-div.sourceCode { overflow-x: auto; }
-table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
- margin: 0; padding: 0; vertical-align: baseline; border: none; }
-table.sourceCode { width: 100%; line-height: 100%; }
-td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
-td.sourceCode { padding-left: 5px; }
-code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
-code > span.dt { color: #902000; } /* DataType */
-code > span.dv { color: #40a070; } /* DecVal */
-code > span.bn { color: #40a070; } /* BaseN */
-code > span.fl { color: #40a070; } /* Float */
-code > span.ch { color: #4070a0; } /* Char */
-code > span.st { color: #4070a0; } /* String */
-code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
-code > span.ot { color: #007020; } /* Other */
-code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
-code > span.fu { color: #06287e; } /* Function */
-code > span.er { color: #ff0000; font-weight: bold; } /* Error */
-code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
-code > span.cn { color: #880000; } /* Constant */
-code > span.sc { color: #4070a0; } /* SpecialChar */
-code > span.vs { color: #4070a0; } /* VerbatimString */
-code > span.ss { color: #bb6688; } /* SpecialString */
-code > span.im { } /* Import */
-code > span.va { color: #19177c; } /* Variable */
-code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
-code > span.op { color: #666666; } /* Operator */
-code > span.bu { } /* BuiltIn */
-code > span.ex { } /* Extension */
-code > span.pp { color: #bc7a00; } /* Preprocessor */
-code > span.at { color: #7d9029; } /* Attribute */
-code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
-code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
-code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
-code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ span.underline{text-decoration: underline;}
+ div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
- <link rel="stylesheet" href="markdown.css" type="text/css" />
+ <style type="text/css">
+a.sourceLine { display: inline-block; line-height: 1.25; }
+a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
+a.sourceLine:empty { height: 1.2em; position: absolute; }
+.sourceCode { overflow: visible; }
+code.sourceCode { white-space: pre; position: relative; }
+div.sourceCode { margin: 1em 0; }
+pre.sourceCode { margin: 0; }
+@media screen {
+div.sourceCode { overflow: auto; }
+}
+@media print {
+code.sourceCode { white-space: pre-wrap; }
+a.sourceLine { text-indent: -1em; padding-left: 1em; }
+}
+pre.numberSource a.sourceLine
+ { position: relative; }
+pre.numberSource a.sourceLine:empty
+ { position: absolute; }
+pre.numberSource a.sourceLine::before
+ { content: attr(data-line-number);
+ position: absolute; left: -5em; text-align: right; vertical-align: baseline;
+ border: none; pointer-events: all;
+ -webkit-touch-callout: none; -webkit-user-select: none;
+ -khtml-user-select: none; -moz-user-select: none;
+ -ms-user-select: none; user-select: none;
+ padding: 0 4px; width: 4em;
+ color: #aaaaaa;
+ }
+pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
+div.sourceCode
+ { }
+@media screen {
+a.sourceLine::before { text-decoration: underline; }
+}
+code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+code span.at { color: #7d9029; } /* Attribute */
+code span.bn { color: #40a070; } /* BaseN */
+code span.bu { } /* BuiltIn */
+code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+code span.ch { color: #4070a0; } /* Char */
+code span.cn { color: #880000; } /* Constant */
+code span.co { color: #60a0b0; font-style: italic; } /* Comment */
+code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+code span.dt { color: #902000; } /* DataType */
+code span.dv { color: #40a070; } /* DecVal */
+code span.er { color: #ff0000; font-weight: bold; } /* Error */
+code span.ex { } /* Extension */
+code span.fl { color: #40a070; } /* Float */
+code span.fu { color: #06287e; } /* Function */
+code span.im { } /* Import */
+code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
+code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+code span.op { color: #666666; } /* Operator */
+code span.ot { color: #007020; } /* Other */
+code span.pp { color: #bc7a00; } /* Preprocessor */
+code span.sc { color: #4070a0; } /* SpecialChar */
+code span.ss { color: #bb6688; } /* SpecialString */
+code span.st { color: #4070a0; } /* String */
+code span.va { color: #19177c; } /* Variable */
+code span.vs { color: #4070a0; } /* VerbatimString */
+code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+ </style>
+ <link rel="stylesheet" href="markdown.css" />
+ <!--[if lt IE 9]>
+ <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
+ <![endif]-->
</head>
<body>
-<div id="header">
+<header>
<h1 class="title">Markdown Package User Manual</h1>
-<h2 class="author">Vít Novotný</h2>
-</div>
-<div id="TOC">
+<p class="author">Vít Novotný</p>
+<p class="date">v2.7.0 (2019/04/04)</p>
+</header>
+<nav id="TOC">
<ul>
<li><a href="#introduction"><span class="toc-section-number">1</span> Introduction</a><ul>
<li><a href="#requirements"><span class="toc-section-number">1.1</span> Requirements</a></li>
<li><a href="#installation"><span class="toc-section-number">1.2</span> Installation</a><ul>
-<li><a href="#local-installation"><span class="toc-section-number">1.2.1</span> Local installation</a></li>
-<li><a href="#portable-installation"><span class="toc-section-number">1.2.2</span> Portable installation</a></li>
-</ul></li>
-<li><a href="#first-document"><span class="toc-section-number">1.3</span> First document</a><ul>
-<li><a href="#using-lua"><span class="toc-section-number">1.3.1</span> Using Lua</a><ul>
-<li><a href="#using-the-lua-module"><span class="toc-section-number">1.3.1.1</span> Using the Lua module</a></li>
-<li><a href="#using-the-lua-cli"><span class="toc-section-number">1.3.1.2</span> Using the Lua CLI</a></li>
+<li><a href="#local-installation"><span class="toc-section-number">1.2.1</span> Local Installation</a></li>
+<li><a href="#portable-installation"><span class="toc-section-number">1.2.2</span> Portable Installation</a></li>
</ul></li>
-<li><a href="#using-plain-tex"><span class="toc-section-number">1.3.2</span> Using plain TeX</a></li>
-<li><a href="#using-latex"><span class="toc-section-number">1.3.3</span> Using LaTeX</a></li>
-<li><a href="#using-context"><span class="toc-section-number">1.3.4</span> Using ConTeXt</a></li>
+<li><a href="#first-document"><span class="toc-section-number">1.3</span> First Document</a><ul>
+<li><a href="#using-lua"><span class="toc-section-number">1.3.1</span> Using Lua</a></li>
+<li><a href="#using-plain-tex"><span class="toc-section-number">1.3.2</span> Using Plain <span class="tex">T<sub>e</sub>X</span></a></li>
+<li><a href="#using-latex"><span class="toc-section-number">1.3.3</span> Using <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span></a></li>
+<li><a href="#using-context"><span class="toc-section-number">1.3.4</span> Using Con<span class="tex">T<sub>e</sub>X</span>t</a></li>
</ul></li>
</ul></li>
<li><a href="#examples"><span class="toc-section-number">2</span> Examples</a><ul>
-<li><a href="#lua"><span class="toc-section-number">2.1</span> Lua</a><ul>
-<li><a href="#interfaces"><span class="toc-section-number">2.1.1</span> Interfaces</a><ul>
-<li><a href="#the-lua-module"><span class="toc-section-number">2.1.1.1</span> The Lua module</a></li>
-<li><a href="#the-lua-cli"><span class="toc-section-number">2.1.1.2</span> The Lua CLI</a></li>
-</ul></li>
-<li><a href="#options"><span class="toc-section-number">2.1.2</span> Options</a><ul>
-<li><a href="#file-and-directory-names"><span class="toc-section-number">2.1.2.1</span> File and Directory Names</a><ul>
-<li><a href="#option-cachedir"><span class="toc-section-number">2.1.2.1.1</span> Option <code>cacheDir</code></a></li>
-</ul></li>
-<li><a href="#parser-options"><span class="toc-section-number">2.1.2.2</span> Parser Options</a><ul>
-<li><a href="#option-blankbeforeblockquote"><span class="toc-section-number">2.1.2.2.1</span> Option <code>blankBeforeBlockquote</code></a></li>
-<li><a href="#option-blankbeforecodefence"><span class="toc-section-number">2.1.2.2.2</span> Option <code>blankBeforeCodeFence</code></a></li>
-<li><a href="#option-blankbeforeheading"><span class="toc-section-number">2.1.2.2.3</span> Option <code>blankBeforeHeading</code></a></li>
-<li><a href="#option-breakableblockquotes"><span class="toc-section-number">2.1.2.2.4</span> Option <code>breakableBlockquotes</code></a></li>
-<li><a href="#option-citationnbsps"><span class="toc-section-number">2.1.2.2.5</span> Option <code>citationNbsps</code></a></li>
-<li><a href="#option-citations"><span class="toc-section-number">2.1.2.2.6</span> Option <code>citations</code></a></li>
-<li><a href="#option-codespans"><span class="toc-section-number">2.1.2.2.7</span> Option <code>codeSpans</code></a></li>
-<li><a href="#option-contentblocks"><span class="toc-section-number">2.1.2.2.8</span> Option <code>contentBlocks</code></a></li>
-<li><a href="#option-contentblockslanguagemap"><span class="toc-section-number">2.1.2.2.9</span> Option <code>contentBlocksLanguageMap</code></a></li>
-<li><a href="#option-definitionlists"><span class="toc-section-number">2.1.2.2.10</span> Option <code>definitionLists</code></a></li>
-<li><a href="#option-fencedcode"><span class="toc-section-number">2.1.2.2.11</span> Option <code>fencedCode</code></a></li>
-<li><a href="#option-footnotes"><span class="toc-section-number">2.1.2.2.12</span> Option <code>footnotes</code></a></li>
-<li><a href="#option-hashenumerators"><span class="toc-section-number">2.1.2.2.13</span> Option <code>hashEnumerators</code></a></li>
-<li><a href="#option-html"><span class="toc-section-number">2.1.2.2.14</span> Option <code>html</code></a></li>
-<li><a href="#option-hybrid"><span class="toc-section-number">2.1.2.2.15</span> Option <code>hybrid</code></a></li>
-<li><a href="#option-inlinefootnotes"><span class="toc-section-number">2.1.2.2.16</span> Option <code>inlineFootnotes</code></a></li>
-<li><a href="#option-preservetabs"><span class="toc-section-number">2.1.2.2.17</span> Option <code>preserveTabs</code></a></li>
-<li><a href="#option-smartellipses"><span class="toc-section-number">2.1.2.2.18</span> Option <code>smartEllipses</code></a></li>
-<li><a href="#option-startnumber"><span class="toc-section-number">2.1.2.2.19</span> Option <code>startNumber</code></a></li>
-<li><a href="#option-tightlists"><span class="toc-section-number">2.1.2.2.20</span> Option <code>tightLists</code></a></li>
-<li><a href="#option-underscores"><span class="toc-section-number">2.1.2.2.21</span> Option <code>underscores</code></a></li>
+<li><a href="#interfaces"><span class="toc-section-number">2.1</span> Interfaces</a><ul>
+<li><a href="#lua"><span class="toc-section-number">2.1.1</span> Lua</a></li>
+<li><a href="#plain-tex"><span class="toc-section-number">2.1.2</span> Plain <span class="tex">T<sub>e</sub>X</span></a></li>
+<li><a href="#latex"><span class="toc-section-number">2.1.3</span> <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span></a></li>
+<li><a href="#context"><span class="toc-section-number">2.1.4</span> Con<span class="tex">T<sub>e</sub>X</span>t</a></li>
</ul></li>
+<li><a href="#options"><span class="toc-section-number">2.2</span> Options</a><ul>
+<li><a href="#lua-1"><span class="toc-section-number">2.2.1</span> Lua</a></li>
+<li><a href="#plain-tex-1"><span class="toc-section-number">2.2.2</span> Plain <span class="tex">T<sub>e</sub>X</span></a></li>
</ul></li>
-</ul></li>
-<li><a href="#plain-tex"><span class="toc-section-number">2.2</span> Plain TeX</a><ul>
-<li><a href="#interfaces-1"><span class="toc-section-number">2.2.1</span> Interfaces</a></li>
-<li><a href="#options-1"><span class="toc-section-number">2.2.2</span> Options</a></li>
-<li><a href="#token-renderers"><span class="toc-section-number">2.2.3</span> Token renderers</a></li>
-</ul></li>
-<li><a href="#latex"><span class="toc-section-number">2.3</span> LaTeX</a><ul>
-<li><a href="#interfaces-2"><span class="toc-section-number">2.3.1</span> Interfaces</a></li>
-<li><a href="#options-2"><span class="toc-section-number">2.3.2</span> Options</a></li>
-<li><a href="#token-renderers-1"><span class="toc-section-number">2.3.3</span> Token renderers</a></li>
-</ul></li>
-<li><a href="#context"><span class="toc-section-number">2.4</span> ConTeXt</a><ul>
-<li><a href="#interfaces-3"><span class="toc-section-number">2.4.1</span> Interfaces</a></li>
-<li><a href="#options-3"><span class="toc-section-number">2.4.2</span> Options</a></li>
-<li><a href="#token-renderers-2"><span class="toc-section-number">2.4.3</span> Token renderers</a></li>
+<li><a href="#markdown-tokens"><span class="toc-section-number">2.3</span> Markdown Tokens</a><ul>
+<li><a href="#token-renderers"><span class="toc-section-number">2.3.1</span> Token Renderers</a></li>
+<li><a href="#token-renderer-prototypes"><span class="toc-section-number">2.3.2</span> Token Renderer Prototypes</a></li>
</ul></li>
</ul></li>
</ul>
-</div>
+</nav>
<p><link href="https://afeld.github.io/emoji-css/emoji.css" rel="stylesheet" /></p>
<h1 id="introduction"><span class="header-section-number">1</span> Introduction</h1>
-<p>The <a href="https://ctan.org/pkg/markdown" title="CTAN: Package markdown">Markdown package</a> converts <a href="https://daringfireball.net/projects/markdown/basics/" title="Daring Fireball: Markdown Basics">markdown</a> markup to TeX commands. The functionality is provided both as a Lua module, and as plain TeX, LaTeX, and ConTeXt macro packages that can be used to directly typeset TeX documents containing markdown markup. Unlike other convertors, the Markdown package makes it easy to redefine how each and every markdown element is rendered. Creative abuse of the markdown syntax is encouraged. <i class="em em-wink"></i></p>
-<p>This document is a user manual for the <a href="https://ctan.org/pkg/markdown" title="CTAN: Package markdown">Markdown package</a>. It provides beginner tutorials and code examples. For an in-depth description of the package requirements, interfaces, and implementation, please refer to the <a href="http://mirrors.ctan.org/macros/generic/markdown/markdown.pdf" title="A Markdown Interpreter for TeX">technical documentation</a>.</p>
+<p>The <a href="https://ctan.org/pkg/markdown" title="CTAN: Package markdown">Markdown package</a> converts <a href="https://daringfireball.net/projects/markdown/basics/" title="Daring Fireball: Markdown Basics">markdown</a> markup to <span class="tex">T<sub>e</sub>X</span> commands. The functionality is provided both as a Lua module and as plain <span class="tex">T<sub>e</sub>X</span>, <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span>, and Con<span class="tex">T<sub>e</sub>X</span>t macro packages that can be used to directly typeset documents containing markdown markup. Unlike other convertors, the Markdown package makes it easy to redefine how each and every markdown element is rendered. Creative abuse of the markdown syntax is encouraged. <i class="em em-wink"></i></p>
+<p>This document is a user manual for the <a href="https://ctan.org/pkg/markdown" title="CTAN: Package markdown">Markdown package</a>. It provides tutorials and code examples. For an in-depth description of the package requirements, interfaces, and implementation, please refer to the <a href="http://mirrors.ctan.org/macros/generic/markdown/markdown.pdf" title="A Markdown Interpreter for &lt;span class=&quot;tex&quot;&gt;T&lt;sub&gt;e&lt;/sub&gt;X&lt;/span&gt;">technical documentation</a>.</p>
<h2 id="requirements"><span class="header-section-number">1.1</span> Requirements</h2>
-<p>The package requires a working TeX distribution. <a href="https://www.tug.org/texlive/" title="TeX Live - TeX Users Group">TeX Live</a> ≥ 2013 is known to work and so are recent installation of <a href="https://miktex.org/" title="Home - MiKTeXorg">MikTeX</a>. If you are using a minimal installation of a TeX distribution, please consult the <a href="http://mirrors.ctan.org/macros/generic/markdown/markdown.pdf" title="A Markdown Interpreter for TeX">technical documentation</a> for a detailed list of required packages.</p>
+<p>The package requires a working <span class="tex">T<sub>e</sub>X</span> distribution. <a href="https://www.tug.org/texlive/" title="TeX Live - TeX Users Group"><span class="tex">T<sub>e</sub>X</span> Live</a> ≥ 2013 is known to work and so are recent installation of <a href="https://miktex.org/" title="Home - MiKTeXorg">Mik<span class="tex">T<sub>e</sub>X</span></a>. If you are using a minimal installation of a <span class="tex">T<sub>e</sub>X</span> distribution, please consult the <a href="http://mirrors.ctan.org/macros/generic/markdown/markdown.pdf" title="A Markdown Interpreter for &lt;span class=&quot;tex&quot;&gt;T&lt;sub&gt;e&lt;/sub&gt;X&lt;/span&gt;">technical documentation</a> for a detailed list of required packages.</p>
<h2 id="installation"><span class="header-section-number">1.2</span> Installation</h2>
-<p>The package comes pre-installed with <a href="https://www.tug.org/texlive/" title="TeX Live - TeX Users Group">TeX Live</a> ≥ 2016 and with recent installations of <a href="https://miktex.org/" title="Home - MiKTeXorg">MikTeX</a>. Unless you explicitly wish to use the latest version of the package, you are encouraged to skip this step.</p>
+<p>The package comes pre-installed with <a href="https://www.tug.org/texlive/" title="TeX Live - TeX Users Group"><span class="tex">T<sub>e</sub>X</span> Live</a> ≥ 2016 and with recent installations of <a href="https://miktex.org/" title="Home - MiKTeXorg">MikTeX</a>. Unless you explicitly wish to use the latest version of the package, you are encouraged to skip this step.</p>
<p>To install the package, first download the package from the repository using Git:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="fu">git</span> clone https://github.com/witiko/markdown</code></pre></div>
-<p>Next, enter the directory named <code>markdown</code> and interpret the file named <code>markdown.ins</code> file using a Unicode-aware TeX engine, such as XeTeX or LuaTeX:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="bu">cd</span> markdown
-<span class="ex">luatex</span> markdown.ins</code></pre></div>
+<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="fu">git</span> clone https://github.com/witiko/markdown</a></code></pre></div>
+<p>Next, enter the directory named <code>markdown</code> and interpret the file named <code>markdown.ins</code> file using a Unicode-aware <span class="tex">T<sub>e</sub>X</span> engine, such as XeTeX or LuaTeX:</p>
+<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="bu">cd</span> markdown</a>
+<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="ex">luatex</span> markdown.ins</a></code></pre></div>
<p>This should produce the following files:</p>
<ul>
-<li><code>markdown.lua</code> – the Lua module,</li>
-<li><code>markdown-cli.lua</code> – the Lua command-line interface,</li>
-<li><code>markdown.tex</code> – the plain TeX macro package,</li>
-<li><code>markdown.sty</code> – the LaTeX package, and</li>
-<li><code>t-markdown.tex</code> – the ConTeXt module.</li>
+<li><code>markdown.lua</code>, the Lua module,</li>
+<li><code>markdown-cli.lua</code>, the Lua command-line interface,</li>
+<li><code>markdown.tex</code>, the plain <span class="tex">T<sub>e</sub>X</span> macro package,</li>
+<li><code>markdown.sty</code>, the <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> package, and</li>
+<li><code>t-markdown.tex</code>, the Con<span class="tex">T<sub>e</sub>X</span>t module.</li>
</ul>
-<h3 id="local-installation"><span class="header-section-number">1.2.1</span> Local installation</h3>
-<p>To perform a local installation, place the above files into your TeX directory structure. This is generally where the individual files should be placed:</p>
+<h3 id="local-installation"><span class="header-section-number">1.2.1</span> Local Installation</h3>
+<p>To perform a local installation, place the above files into your <span class="tex">T<sub>e</sub>X</span> directory structure. This is generally where the individual files should be placed:</p>
<ul>
<li><code>&lt;TEXMF&gt;/tex/luatex/markdown/markdown.lua</code></li>
<li><code>&lt;TEXMF&gt;/scripts/markdown/markdown-cli.lua</code></li>
@@ -152,223 +151,335 @@ code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Inf
<li><code>&lt;TEXMF&gt;/tex/latex/markdown/markdown.sty</code></li>
<li><code>&lt;TEXMF&gt;/tex/context/third/markdown/t-markdown.tex</code></li>
</ul>
-<p>where <code>&lt;TEXMF&gt;</code> corresponds to a root of your TeX distribution, such as <code>/usr/share/texmf</code> and <code>~/texmf</code> on UN*X systems or <code>C:\Users\&lt;YOUR␣USERNAME&gt;\texmf</code> on Windows systems. When in doubt, consult the manual of your TeX distribution.</p>
-<h3 id="portable-installation"><span class="header-section-number">1.2.2</span> Portable installation</h3>
-<p>Alternatively, you can also store the above files in the same folder as your TeX document and distribute them together. This way your document can be portably typeset on legacy TeX distributions.</p>
-<h2 id="first-document"><span class="header-section-number">1.3</span> First document</h2>
-<p>In this section, we will take the necessary steps to typeset our first markdown document in TeX. This will serve as our first hands-on experience with the package and also as a reassurance that the package has been correctly installed.</p>
+<p>where <code>&lt;TEXMF&gt;</code> corresponds to a root of your <span class="tex">T<sub>e</sub>X</span> distribution, such as <code>/usr/share/texmf</code> and <code>~/texmf</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf</code> on Windows systems. When in doubt, consult the manual of your <span class="tex">T<sub>e</sub>X</span> distribution.</p>
+<h3 id="portable-installation"><span class="header-section-number">1.2.2</span> Portable Installation</h3>
+<p>Alternatively, you can also store the above files in the same folder as your <span class="tex">T<sub>e</sub>X</span> document and distribute them together. This way your document can be portably typeset on legacy <span class="tex">T<sub>e</sub>X</span> distributions.</p>
+<h2 id="first-document"><span class="header-section-number">1.3</span> First Document</h2>
+<p>In this section, we will take the necessary steps to typeset our first markdown document in <span class="tex">T<sub>e</sub>X</span>. This will serve as our first hands-on experience with the package and also as a reassurance that the package has been correctly installed.</p>
<h3 id="using-lua"><span class="header-section-number">1.3.1</span> Using Lua</h3>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> hello
-<span class="fu">\bye</span></code></pre></div>
-<h4 id="using-the-lua-module"><span class="header-section-number">1.3.1.1</span> Using the Lua module</h4>
+<div class="sourceCode" id="cb3"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="fu">\input</span> hello</a>
+<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="fu">\bye</span></a></code></pre></div>
+<h4 id="using-the-lua-module"><span class="header-section-number">1.3.1.1</span> Using the Lua Module</h4>
<p>Using a text editor, create a text document named <code>hello.lua</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode lua"><code class="sourceCode lua"><span class="ot">#</span>!<span class="ot">/</span>usr<span class="ot">/</span>bin<span class="ot">/</span>env texlua
-<span class="kw">local</span> kpse <span class="ot">=</span> <span class="fu">require</span><span class="ot">(</span><span class="st">&quot;kpse&quot;</span><span class="ot">)</span>
-kpse<span class="ot">.</span>set_program_name<span class="ot">(</span><span class="st">&quot;luatex&quot;</span><span class="ot">)</span>
-<span class="kw">local</span> markdown <span class="ot">=</span> <span class="fu">require</span><span class="ot">(</span><span class="st">&quot;markdown&quot;</span><span class="ot">)</span>
-<span class="kw">local</span> convert <span class="ot">=</span> markdown<span class="ot">.</span>new<span class="ot">()</span>
-<span class="fu">print</span><span class="ot">(</span>convert<span class="ot">(</span><span class="st">&quot;Hello *world*!&quot;</span><span class="ot">))</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> hello.lua <span class="op">&gt;</span> hello.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb4"><pre class="sourceCode lua"><code class="sourceCode lua"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="ot">#</span>!<span class="ot">/</span>usr<span class="ot">/</span>bin<span class="ot">/</span>env texlua</a>
+<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="kw">local</span> kpse <span class="ot">=</span> <span class="fu">require</span><span class="ot">(</span><span class="st">&quot;kpse&quot;</span><span class="ot">)</span></a>
+<a class="sourceLine" id="cb4-3" data-line-number="3">kpse<span class="ot">.</span>set_program_name<span class="ot">(</span><span class="st">&quot;luatex&quot;</span><span class="ot">)</span></a>
+<a class="sourceLine" id="cb4-4" data-line-number="4"><span class="kw">local</span> markdown <span class="ot">=</span> <span class="fu">require</span><span class="ot">(</span><span class="st">&quot;markdown&quot;</span><span class="ot">)</span></a>
+<a class="sourceLine" id="cb4-5" data-line-number="5"><span class="kw">local</span> convert <span class="ot">=</span> markdown<span class="ot">.</span>new<span class="ot">()</span></a>
+<a class="sourceLine" id="cb4-6" data-line-number="6"><span class="fu">print</span><span class="ot">(</span>convert<span class="ot">(</span><span class="st">&quot;Hello *world*!&quot;</span><span class="ot">))</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="ex">texlua</span> hello.lua <span class="op">&gt;</span> hello.tex</a>
+<a class="sourceLine" id="cb5-2" data-line-number="2"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” Invoking pdfTeX should have the same effect:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> hello.lua <span class="op">&gt;</span> hello.tex
-<span class="ex">pdftex</span> document.tex</code></pre></div>
-<h4 id="using-the-lua-cli"><span class="header-section-number">1.3.1.2</span> Using the Lua CLI</h4>
+<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="ex">texlua</span> hello.lua <span class="op">&gt;</span> hello.tex</a>
+<a class="sourceLine" id="cb6-2" data-line-number="2"><span class="ex">pdftex</span> document.tex</a></code></pre></div>
+<h4 id="using-the-lua-command-line-interface"><span class="header-section-number">1.3.1.2</span> Using the Lua Command-Line Interface</h4>
<p>Using a text editor, create a text document named <code>hello.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">Hello *world*!</code></pre></div>
+<div class="sourceCode" id="cb7"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb7-1" data-line-number="1">Hello *world*!</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> -- hello.md hello.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
-<p>where <code>&lt;CLI␣PATHNAME&gt;</code> corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\&lt;YOUR␣USERNAME&gt;\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
+<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- hello.md hello.tex</a>
+<a class="sourceLine" id="cb8-2" data-line-number="2"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” Invoking pdfTeX should have the same effect:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> -- hello.md hello.tex
-<span class="ex">pdftex</span> document.tex</code></pre></div>
-<h3 id="using-plain-tex"><span class="header-section-number">1.3.2</span> Using plain TeX</h3>
+<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- hello.md hello.tex</a>
+<a class="sourceLine" id="cb9-2" data-line-number="2"><span class="ex">pdftex</span> document.tex</a></code></pre></div>
+<h3 id="using-plain-tex"><span class="header-section-number">1.3.2</span> Using Plain <span class="tex">T<sub>e</sub>X</span></h3>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\markdownBegin</span>
-Hello *world*!
-<span class="fu">\markdownEnd</span>
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb10"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb10-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb10-2" data-line-number="2"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb10-3" data-line-number="3">Hello *world*!</a>
+<a class="sourceLine" id="cb10-4" data-line-number="4"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb10-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb11-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” Invoking pdfTeX should have the same effect:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">pdftex</span> --shell-escape document.tex</code></pre></div>
-<h3 id="using-latex"><span class="header-section-number">1.3.3</span> Using LaTeX</h3>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-Hello *world*!
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb12"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb12-1" data-line-number="1"><span class="ex">pdftex</span> --shell-escape document.tex</a></code></pre></div>
+<h3 id="using-latex"><span class="header-section-number">1.3.3</span> Using <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span></h3>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb13"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb13-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb13-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb13-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb13-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb13-5" data-line-number="5">Hello *world*!</a>
+<a class="sourceLine" id="cb13-6" data-line-number="6"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb13-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb14"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb14-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” Invoking pdfTeX should have the same effect:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">pdflatex</span> --shell-escape document.tex</code></pre></div>
+<div class="sourceCode" id="cb15"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb15-1" data-line-number="1"><span class="ex">pdflatex</span> --shell-escape document.tex</a></code></pre></div>
<hr />
<p>As the next step, try typesetting the example documents distributed along with the Markdown package:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="fu">git</span> clone https://github.com/witiko/markdown
-<span class="bu">cd</span> markdown/examples
-<span class="ex">lualatex</span> latex.tex</code></pre></div>
+<div class="sourceCode" id="cb16"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb16-1" data-line-number="1"><span class="fu">git</span> clone https://github.com/witiko/markdown</a>
+<a class="sourceLine" id="cb16-2" data-line-number="2"><span class="bu">cd</span> markdown/examples</a>
+<a class="sourceLine" id="cb16-3" data-line-number="3"><span class="ex">lualatex</span> latex.tex</a></code></pre></div>
<p>A PDF document named <code>latex.pdf</code> should be produced. Open the text documents <code>latex.tex</code> and <code>example.md</code> in a text editor to see how the example documents are structured. Try changing the documents and typesetting them as follows:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> latex.tex</code></pre></div>
+<div class="sourceCode" id="cb17"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb17-1" data-line-number="1"><span class="ex">lualatex</span> latex.tex</a></code></pre></div>
<p>to see the effect of your changes.</p>
-<h3 id="using-context"><span class="header-section-number">1.3.4</span> Using ConTeXt</h3>
+<h3 id="using-context"><span class="header-section-number">1.3.4</span> Using Con<span class="tex">T<sub>e</sub>X</span>t</h3>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\starttext</span>
-<span class="fu">\startmarkdown</span>
-Hello *world*!
-<span class="fu">\stopmarkdown</span>
-<span class="fu">\stoptext</span></code></pre></div>
+<div class="sourceCode" id="cb18"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb18-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb18-2" data-line-number="2"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb18-3" data-line-number="3"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb18-4" data-line-number="4">Hello *world*!</a>
+<a class="sourceLine" id="cb18-5" data-line-number="5"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb18-6" data-line-number="6"><span class="fu">\stoptext</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb19"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb19-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” Invoking pdfTeX should have the same effect:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texexec</span> --passon=--shell-escape document.tex</code></pre></div>
+<div class="sourceCode" id="cb20"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb20-1" data-line-number="1"><span class="ex">texexec</span> --passon=--shell-escape document.tex</a></code></pre></div>
<hr />
<p>As the next step, try typesetting the example documents distributed along with the Markdown package:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="fu">git</span> clone https://github.com/witiko/markdown
-<span class="bu">cd</span> markdown/examples
-<span class="ex">context</span> context.tex</code></pre></div>
+<div class="sourceCode" id="cb21"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb21-1" data-line-number="1"><span class="fu">git</span> clone https://github.com/witiko/markdown</a>
+<a class="sourceLine" id="cb21-2" data-line-number="2"><span class="bu">cd</span> markdown/examples</a>
+<a class="sourceLine" id="cb21-3" data-line-number="3"><span class="ex">context</span> context.tex</a></code></pre></div>
<p>A PDF document named <code>context.pdf</code> should be produced. Open the text documents <code>context.tex</code> and <code>example.md</code> in a text editor to see how the example documents are structured. Try changing the documents and typesetting them as follows:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> context.tex</code></pre></div>
+<div class="sourceCode" id="cb22"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb22-1" data-line-number="1"><span class="ex">context</span> context.tex</a></code></pre></div>
<p>to see the effect of your changes.</p>
<h1 id="examples"><span class="header-section-number">2</span> Examples</h1>
-<p>This section will show how to use the package by example.</p>
-<h2 id="lua"><span class="header-section-number">2.1</span> Lua</h2>
-<p>The Lua part of the package makes it possible to convert a markdown document into TeX commands and typeset it later when convenient. Although the typical user will not find this terribly useful and will instead use the plain TeX, LaTeX, and ConTeXt macro packages to convert and typeset the markdown documents in a single step, they will still benefit from learning the options that control the behavior of the Lua parser.</p>
-<h3 id="interfaces"><span class="header-section-number">2.1.1</span> Interfaces</h3>
-<p>The Lua part of the package exposes two interfaces – the <code>markdown</code> Lua module, and the Lua command-line interface (CLI).</p>
-<h4 id="the-lua-module"><span class="header-section-number">2.1.1.1</span> The Lua module</h4>
-<p>The <code>markdown</code> Lua module exposes the <code>new(options)</code> method, which creates a converter function from markdown to TeX. The properties of the converter function are specified by the Lua table <code>options</code>. The parameter is optional; when unspecified, the behaviour will be the same as if <code>options</code> were an empty table.</p>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\input</span> example
-<span class="fu">\bye</span></code></pre></div>
+<p>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 <a href="http://mirrors.ctan.org/macros/generic/markdown/markdown.pdf" title="A Markdown Interpreter for &lt;span class=&quot;tex&quot;&gt;T&lt;sub&gt;e&lt;/sub&gt;X&lt;/span&gt;">technical documentation</a>.</p>
+<h2 id="interfaces"><span class="header-section-number">2.1</span> Interfaces</h2>
+<p>In this section, I will describe the individual interfaces exposed by the Markdown package starting with the low-level Lua interfaces and all the way up to the <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> and Con<span class="tex">T<sub>e</sub>X</span>t interfaces intended for the ordinary user.</p>
+<h3 id="lua"><span class="header-section-number">2.1.1</span> Lua</h3>
+<p>The Lua programming language is what drives the conversion from markdown to <span class="tex">T<sub>e</sub>X</span> in the Markdown package. Based on the <a href="https://github.com/jgm/lunamark" title="Lua library for conversion between markup formats">Lunamark</a> Lua library by John MacFarlane, the Lua implementation is largely independent on <span class="tex">T<sub>e</sub>X</span>, and can be used separately from typesetting a document. Lua provides two interfaces: a Lua module and a command-line interface (CLI).</p>
+<h4 id="lua-module"><span class="header-section-number">2.1.1.1</span> Lua Module</h4>
+<p>A Lua module is a software library that can be used from in other programs. The <code>markdown</code> Lua module makes it possible to convert markdown to <span class="tex">T<sub>e</sub>X</span> from within Lua<span class="tex">T<sub>e</sub>X</span> documents and Lua scripts.</p>
+<p>The <code>markdown</code> Lua module exposes the <code>new(</code>⟨<em>options</em>⟩<code>)</code> method, which creates a converter function from markdown to <span class="tex">T<sub>e</sub>X</span>. The properties of the converter function are specified by the Lua table <code>options</code>. The parameter is optional; when unspecified, the behaviour will be the same as if ⟨<em>options</em>⟩ were an empty table.</p>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb23"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb23-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb23-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb23-3" data-line-number="3"><span class="fu">\input</span> example</a>
+<a class="sourceLine" id="cb23-4" data-line-number="4"><span class="fu">\bye</span></a></code></pre></div>
<p>Using a text editor, create a text document named <code>example.lua</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode lua"><code class="sourceCode lua"><span class="ot">#</span>!<span class="ot">/</span>usr<span class="ot">/</span>bin<span class="ot">/</span>env texlua
-<span class="kw">local</span> kpse <span class="ot">=</span> <span class="fu">require</span><span class="ot">(</span><span class="st">&quot;kpse&quot;</span><span class="ot">)</span>
-kpse<span class="ot">.</span>set_program_name<span class="ot">(</span><span class="st">&quot;luatex&quot;</span><span class="ot">)</span>
-<span class="kw">local</span> markdown <span class="ot">=</span> <span class="fu">require</span><span class="ot">(</span><span class="st">&quot;markdown&quot;</span><span class="ot">)</span>
-<span class="kw">local</span> convert_safe <span class="ot">=</span> markdown<span class="ot">.</span>new<span class="ot">()</span>
-<span class="kw">local</span> convert_unsafe <span class="ot">=</span> markdown<span class="ot">.</span>new<span class="ot">({</span>hybrid <span class="ot">=</span> <span class="kw">true</span><span class="ot">})</span>
-<span class="kw">local</span> input <span class="ot">=</span> <span class="st">[[$\sqrt{-1}$ *equals* $i$.]]</span>
-<span class="fu">print</span><span class="ot">(</span>convert_safe<span class="ot">(</span>input<span class="ot">)</span> <span class="ot">..</span> <span class="st">&quot; &quot;</span> <span class="ot">..</span> convert_unsafe<span class="ot">(</span>input<span class="ot">))</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> example.lua <span class="op">&gt;</span> example.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
-<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “$\sqrt{-1}$ <em>equals</em> $i$. √-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.” Invoking pdfTeX should have the same effect:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> example.lua <span class="op">&gt;</span> example.tex
-<span class="ex">pdftex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb24"><pre class="sourceCode lua"><code class="sourceCode lua"><a class="sourceLine" id="cb24-1" data-line-number="1"><span class="ot">#</span>!<span class="ot">/</span>usr<span class="ot">/</span>bin<span class="ot">/</span>env texlua</a>
+<a class="sourceLine" id="cb24-2" data-line-number="2"><span class="kw">local</span> kpse <span class="ot">=</span> <span class="fu">require</span><span class="ot">(</span><span class="st">&quot;kpse&quot;</span><span class="ot">)</span></a>
+<a class="sourceLine" id="cb24-3" data-line-number="3">kpse<span class="ot">.</span>set_program_name<span class="ot">(</span><span class="st">&quot;luatex&quot;</span><span class="ot">)</span></a>
+<a class="sourceLine" id="cb24-4" data-line-number="4"><span class="kw">local</span> markdown <span class="ot">=</span> <span class="fu">require</span><span class="ot">(</span><span class="st">&quot;markdown&quot;</span><span class="ot">)</span></a>
+<a class="sourceLine" id="cb24-5" data-line-number="5"><span class="kw">local</span> input<span class="ot">,</span> convert_safe<span class="ot">,</span> convert_unsafe<span class="ot">,</span> paragraph</a>
+<a class="sourceLine" id="cb24-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb24-7" data-line-number="7">input <span class="ot">=</span> <span class="st">[[$\sqrt{-1}$ *equals* $i$.]]</span></a>
+<a class="sourceLine" id="cb24-8" data-line-number="8">convert_safe <span class="ot">=</span> markdown<span class="ot">.</span>new<span class="ot">()</span></a>
+<a class="sourceLine" id="cb24-9" data-line-number="9">convert_unsafe <span class="ot">=</span> markdown<span class="ot">.</span>new<span class="ot">({</span>hybrid <span class="ot">=</span> <span class="kw">true</span><span class="ot">})</span></a>
+<a class="sourceLine" id="cb24-10" data-line-number="10">paragraph <span class="ot">=</span> <span class="st">[[\par]]</span></a>
+<a class="sourceLine" id="cb24-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb24-12" data-line-number="12"><span class="fu">print</span><span class="ot">(</span></a>
+<a class="sourceLine" id="cb24-13" data-line-number="13"> convert_safe<span class="ot">(</span>input<span class="ot">)</span> <span class="ot">..</span> paragraph <span class="ot">..</span></a>
+<a class="sourceLine" id="cb24-14" data-line-number="14"> convert_unsafe<span class="ot">(</span>input<span class="ot">)</span></a>
+<a class="sourceLine" id="cb24-15" data-line-number="15"><span class="ot">)</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb25"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb25-1" data-line-number="1"><span class="ex">texlua</span> example.lua <span class="op">&gt;</span> example.tex</a>
+<a class="sourceLine" id="cb25-2" data-line-number="2"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>$\sqrt{-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+</blockquote>
+<p>Invoking pdfTeX should have the same effect:</p>
+<div class="sourceCode" id="cb26"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb26-1" data-line-number="1"><span class="ex">texlua</span> example.lua <span class="op">&gt;</span> example.tex</a>
+<a class="sourceLine" id="cb26-2" data-line-number="2"><span class="ex">pdftex</span> document.tex</a></code></pre></div>
<hr />
<p>Rather than use the <code>texlua</code> interpreter, we can also access the <code>markdown</code> Lua module directly from our document. Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local convert_safe = markdown.new()
- local convert_unsafe = markdown.new({hybrid = true})
- local input = [[<span class="ss">$</span><span class="sc">\noexpand\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.]]
- tex.sprint(convert_safe(input) .. &quot; &quot; .. convert_unsafe(input)) }
-<span class="fu">\bye</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
-<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “$\sqrt {-1}$ <em>equals</em> $i$. √-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.” In this case, we cannot use pdfTeX, because pdfTeX does not define the <code>\directlua</code> TeX command.</p>
-<h4 id="the-lua-cli"><span class="header-section-number">2.1.1.2</span> The Lua CLI</h4>
-<p>The Lua command-line interface (CLI) accepts the same options as the <code>markdown</code> Lua module, but now the options are specified as command-line parameters.</p>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\input</span> safe<span class="fu">\ \input</span> unsafe
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb27"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb27-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb27-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb27-3" data-line-number="3"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb27-4" data-line-number="4"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb27-5" data-line-number="5"> local input, convert_safe, convert_unsafe, paragraph</a>
+<a class="sourceLine" id="cb27-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb27-7" data-line-number="7"> input = [[<span class="ss">$</span><span class="sc">\string\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.]]</a>
+<a class="sourceLine" id="cb27-8" data-line-number="8"> convert_safe = markdown.new()</a>
+<a class="sourceLine" id="cb27-9" data-line-number="9"> convert_unsafe = markdown.new({hybrid = true})</a>
+<a class="sourceLine" id="cb27-10" data-line-number="10"> paragraph = [[<span class="fu">\par</span>]]</a>
+<a class="sourceLine" id="cb27-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb27-12" data-line-number="12"> tex.sprint(</a>
+<a class="sourceLine" id="cb27-13" data-line-number="13"> convert_safe(input) .. paragraph ..</a>
+<a class="sourceLine" id="cb27-14" data-line-number="14"> convert_unsafe(input)</a>
+<a class="sourceLine" id="cb27-15" data-line-number="15"> )</a>
+<a class="sourceLine" id="cb27-16" data-line-number="16">}</a>
+<a class="sourceLine" id="cb27-17" data-line-number="17"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb28"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb28-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>$\sqrt{-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+</blockquote>
+<p>In this case, we cannot use pdfTeX, because pdfTeX does not define the <code>\directlua</code> <span class="tex">T<sub>e</sub>X</span> command.</p>
+<h4 id="lua-command-line-interface"><span class="header-section-number">2.1.1.2</span> Lua Command-Line Interface</h4>
+<p>The Lua command-line interface (CLI) of the Markdown package makes the functionality of the Lua module accessible from the command line. This makes it possible to convert documents from markdown to <span class="tex">T<sub>e</sub>X</span> manually without any knowledge of the Lua programming language.</p>
+<p>The Lua command-line interface accepts the same options as the <code>markdown</code> Lua module, but now the options are specified as command-line parameters.</p>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb29"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb29-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb29-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb29-3" data-line-number="3"><span class="fu">\input</span> safe</a>
+<a class="sourceLine" id="cb29-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb29-5" data-line-number="5"><span class="fu">\input</span> unsafe</a>
+<a class="sourceLine" id="cb29-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div>
<p>Using a text editor, create a text document named <code>example.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">$\sqrt{-1}$ *equals* $i$.</code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> -- example.md safe.tex
-<span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> hybrid=true -- example.md unsafe.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
-<p>where <code>&lt;CLI␣PATHNAME&gt;</code> corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\&lt;YOUR␣USERNAME&gt;\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
-<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “$\sqrt{-1}$ <em>equals</em> $i$. √-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.” Invoking pdfTeX should have the same effect:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> -- example.md safe.tex
-<span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> hybrid=true -- example.md unsafe.tex
-<span class="ex">pdftex</span> document.tex</code></pre></div>
-<h3 id="options"><span class="header-section-number">2.1.2</span> Options</h3>
-<p>This section will cover the options recognized by the Lua interface. The interfaces of the plain TeX, LaTeX, and ConTeXt macro packages recognize these options as well, in addition to their own options.</p>
-<h4 id="file-and-directory-names"><span class="header-section-number">2.1.2.1</span> File and Directory Names</h4>
-<h5 id="option-cachedir"><span class="header-section-number">2.1.2.1.1</span> Option <code>cacheDir</code></h5>
+<div class="sourceCode" id="cb30"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb30-1" data-line-number="1">$\sqrt{-1}$ *equals* $i$.</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb31"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb31-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- example.md safe.tex</a>
+<a class="sourceLine" id="cb31-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ hybrid=true -- example.md unsafe.tex</a>
+<a class="sourceLine" id="cb31-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>$\sqrt{-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+</blockquote>
+<p>Invoking pdfTeX should have the same effect:</p>
+<div class="sourceCode" id="cb32"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb32-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- example.md safe.tex</a>
+<a class="sourceLine" id="cb32-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ hybrid=true -- example.md unsafe.tex</a>
+<a class="sourceLine" id="cb32-3" data-line-number="3"><span class="ex">pdftex</span> document.tex</a></code></pre></div>
+<h3 id="plain-tex"><span class="header-section-number">2.1.2</span> Plain <span class="tex">T<sub>e</sub>X</span></h3>
+<p>The plain <span class="tex">T<sub>e</sub>X</span> interface provides <span class="tex">T<sub>e</sub>X</span> commands that typeset markdown documents by using the Lua interface behind the scenes. Unlike the Lua interface, the plain TeX interface does not provide low-level tools for converting markdown to <span class="tex">T<sub>e</sub>X</span>. Instead, its goal is to provide high-level typesetting capabilities.</p>
+<p>The plain <span class="tex">T<sub>e</sub>X</span> interface accepts the same options as the <code>markdown</code> Lua module, in addition to its own options, but now the options are specified as <span class="tex">T<sub>e</sub>X</span> commands.</p>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb33"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb33-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb33-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb33-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb33-4" data-line-number="4"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb33-5" data-line-number="5"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a>
+<a class="sourceLine" id="cb33-6" data-line-number="6"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb33-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb33-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionHybrid{true}</a>
+<a class="sourceLine" id="cb33-9" data-line-number="9"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb33-10" data-line-number="10"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a>
+<a class="sourceLine" id="cb33-11" data-line-number="11"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb33-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb33-13" data-line-number="13"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb34"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb34-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>$\sqrt{-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+</blockquote>
+<p>Invoking pdfTeX should have the same effect:</p>
+<div class="sourceCode" id="cb35"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb35-1" data-line-number="1"><span class="ex">pdftex</span> --shell-escape document.tex</a></code></pre></div>
+<h3 id="latex"><span class="header-section-number">2.1.3</span> <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span></h3>
+<p>The <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> interface provides the same level of functionality as the plain <span class="tex">T<sub>e</sub>X</span> interface by using the plain <span class="tex">T<sub>e</sub>X</span> interface behind the scenes. Unlike the plain <span class="tex">T<sub>e</sub>X</span> interface, the <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> interface uses familiar <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> idioms, such as package options and environments.</p>
+<p>The <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> interface accepts the same options as the plain <span class="tex">T<sub>e</sub>X</span> interface, but now the options are specified as ⟨<em>key</em>⟩<span class="math inline"> = </span>⟨<em>value</em>⟩ pairs and they are passed either as package options, in the <code>\markdownSetup</code> command, or as parameters for the <code>markdown*</code> <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> environment.</p>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb36"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb36-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb36-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb36-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb36-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb36-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb36-6" data-line-number="6"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a>
+<a class="sourceLine" id="cb36-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb36-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb36-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{hybrid}</a>
+<a class="sourceLine" id="cb36-10" data-line-number="10"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a>
+<a class="sourceLine" id="cb36-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb36-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb36-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb37"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb37-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>$\sqrt{-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+</blockquote>
+<p>Invoking pdfTeX should have the same effect:</p>
+<div class="sourceCode" id="cb38"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb38-1" data-line-number="1"><span class="ex">pdflatex</span> --shell-escape document.tex</a></code></pre></div>
+<h3 id="context"><span class="header-section-number">2.1.4</span> Con<span class="tex">T<sub>e</sub>X</span>t</h3>
+<p>The Con<span class="tex">T<sub>e</sub>X</span>t interface provides the same level of functionality as the plain <span class="tex">T<sub>e</sub>X</span> interface by using the plain <span class="tex">T<sub>e</sub>X</span> interface behind the scenes. Unlike the plain <span class="tex">T<sub>e</sub>X</span> interface, the Con<span class="tex">T<sub>e</sub>X</span>t interface uses familiar Con<span class="tex">T<sub>e</sub>X</span>t idioms, such as environments.</p>
+<p>The Con<span class="tex">T<sub>e</sub>X</span>t interface accepts the same options as the plain <span class="tex">T<sub>e</sub>X</span> interface.</p>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb39"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb39-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb39-2" data-line-number="2"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb39-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb39-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb39-5" data-line-number="5"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a>
+<a class="sourceLine" id="cb39-6" data-line-number="6"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb39-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb39-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionHybrid{true}</a>
+<a class="sourceLine" id="cb39-9" data-line-number="9"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb39-10" data-line-number="10"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a>
+<a class="sourceLine" id="cb39-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb39-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb39-13" data-line-number="13"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb40"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb40-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>$\sqrt{-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+</blockquote>
+<p>Invoking pdfTeX should have the same effect:</p>
+<div class="sourceCode" id="cb41"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb41-1" data-line-number="1"><span class="ex">texexec</span> --passon=--shell-escape document.tex</a></code></pre></div>
+<h2 id="options"><span class="header-section-number">2.2</span> Options</h2>
+<p>In this section, I will describe all the options recognized by the Markdown package.</p>
+<h3 id="lua-1"><span class="header-section-number">2.2.1</span> Lua</h3>
+<p>Lua options control the conversion from markdown to <span class="tex">T<sub>e</sub>X</span>. They are supported by all interfaces of the Markdown package starting with the low-level Lua interfaces and all the way up to the <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> and Con<span class="tex">T<sub>e</sub>X</span>t interfaces.</p>
+<h4 id="option-cachedir"><span class="header-section-number">2.2.1.1</span> Option <code>cacheDir</code></h4>
<dl>
<dt><code>cacheDir</code> (default value: <code>&quot;.&quot;</code>)</dt>
-<dd><p>A path to the directory containing auxiliary cache files. If the last segment of the path does not exist, it will be created by the Lua command-line and plain TeX implementations. The Lua implementation expects that the entire path already exists.</p>
+<dd><p>A path to the directory containing auxiliary cache files. If the last segment of the path does not exist, it will be created by the Lua command-line and plain <span class="tex">T<sub>e</sub>X</span> implementations. The Lua implementation expects that the entire path already exists.</p>
<p>When iteratively writing and typesetting a markdown document, the cache files are going to accumulate over time. You are advised to clean the cache directory every now and then, or to set it to a temporary filesystem (such as <code>/tmp</code> on UN*X systems), which gets periodically emptied.</p>
</dd>
</dl>
-<h6 id="lua-module-example" class="unnumbered">Lua module example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local convert = markdown.new({cacheDir = &quot;cache&quot;})
- local input = &quot;Hello *world*!&quot;
- tex.sprint(convert(input)) }
-<span class="fu">\bye</span></code></pre></div>
+<h5 id="lua-module-example" class="unnumbered">Lua Module Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb42"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb42-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb42-2" data-line-number="2"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb42-3" data-line-number="3"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb42-4" data-line-number="4"> local convert = markdown.new({cacheDir = &quot;cache&quot;})</a>
+<a class="sourceLine" id="cb42-5" data-line-number="5"> local input = &quot;Hello *world*!&quot;</a>
+<a class="sourceLine" id="cb42-6" data-line-number="6"> tex.sprint(convert(input)) }</a>
+<a class="sourceLine" id="cb42-7" data-line-number="7"><span class="fu">\bye</span></a></code></pre></div>
<p>Create an empty directory named <code>cache</code> next to our text document. Then, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb43"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb43-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” Several cache files of the Markdown package will also be produced in the <code>cache</code> directory as we requested using the <code>cacheDir</code> option.</p>
-<h6 id="lua-cli-example" class="unnumbered">Lua CLI example</h6>
+<h5 id="lua-cli-example" class="unnumbered">Lua CLI Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> hello
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb44"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb44-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb44-2" data-line-number="2"><span class="fu">\input</span> hello</a>
+<a class="sourceLine" id="cb44-3" data-line-number="3"><span class="fu">\bye</span></a></code></pre></div>
<p>Using a text editor, create a text document named <code>hello.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">Hello *world*!</code></pre></div>
+<div class="sourceCode" id="cb45"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb45-1" data-line-number="1">Hello *world*!</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> cacheDir=cache -- hello.md hello.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
-<p>where <code>&lt;CLI␣PATHNAME&gt;</code> corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\&lt;YOUR␣USERNAME&gt;\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
+<div class="sourceCode" id="cb46"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb46-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ cacheDir=cache -- hello.md hello.tex</a>
+<a class="sourceLine" id="cb46-2" data-line-number="2"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A directory named <code>cache</code> containing several cache files of the Markdown package will also be produced as we requested using the <code>cacheDir</code> option.</p>
-<h6 id="plain-tex-example" class="unnumbered">Plain TeX example</h6>
+<h5 id="plain-tex-example" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\def</span>\markdownOptionCacheDir{cache}
-<span class="fu">\markdownBegin</span>
-Hello *world*!
-<span class="fu">\markdownEnd</span>
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb47"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb47-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb47-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionCacheDir{cache}</a>
+<a class="sourceLine" id="cb47-3" data-line-number="3"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb47-4" data-line-number="4">Hello *world*!</a>
+<a class="sourceLine" id="cb47-5" data-line-number="5"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb47-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb48"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb48-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A directory named <code>cache</code> containing several cache files of the Markdown package will also be produced as we requested using the <code>cacheDir</code> option.</p>
-<h6 id="latex-example" class="unnumbered">LaTeX example</h6>
+<h5 id="latex-example" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>[cacheDir=cache]{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-Hello *world*!
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
+<div class="sourceCode" id="cb49"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb49-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb49-2" data-line-number="2"><span class="bu">\usepackage</span>[cacheDir=cache]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb49-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb49-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb49-5" data-line-number="5">Hello *world*!</a>
+<a class="sourceLine" id="cb49-6" data-line-number="6"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb49-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb50"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb50-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A directory named <code>cache</code> containing several cache files of the Markdown package will also be produced as we requested using the <code>cacheDir</code> option.</p>
-<h6 id="context-example" class="unnumbered">ConTeXt example</h6>
+<h5 id="context-example" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\def</span>\markdownOptionCacheDir{cache}
-<span class="fu">\starttext</span>
-<span class="fu">\startmarkdown</span>
-Hello *world*!
-<span class="fu">\stopmarkdown</span>
-<span class="fu">\stoptext</span></code></pre></div>
+<div class="sourceCode" id="cb51"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb51-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb51-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionCacheDir{cache}</a>
+<a class="sourceLine" id="cb51-3" data-line-number="3"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb51-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb51-5" data-line-number="5">Hello *world*!</a>
+<a class="sourceLine" id="cb51-6" data-line-number="6"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb51-7" data-line-number="7"><span class="fu">\stoptext</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb52"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb52-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!” A directory named <code>cache</code> containing several cache files of the Markdown package will also be produced as we requested using the <code>cacheDir</code> option.</p>
-<h4 id="parser-options"><span class="header-section-number">2.1.2.2</span> Parser Options</h4>
-<h5 id="option-blankbeforeblockquote"><span class="header-section-number">2.1.2.2.1</span> Option <code>blankBeforeBlockquote</code></h5>
+<h4 id="option-blankbeforeblockquote"><span class="header-section-number">2.2.1.2</span> Option <code>blankBeforeBlockquote</code></h4>
<dl>
<dt><code>blankBeforeBlockquote</code> (default value: <code>false</code>)</dt>
<dd><dl>
@@ -381,27 +492,27 @@ Hello *world*!
</dl>
</dd>
</dl>
-<h6 id="lua-module-example-1" class="unnumbered">Lua module example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local newline = [[^^J^^J]]
- local convert, input
-
- convert = markdown.new()
- input = &quot;A paragraph.&quot; .. newline ..
- &quot;&gt; A quote.&quot; .. newline
- tex.sprint(convert(input))
-
- convert = markdown.new({blankBeforeBlockquote = true})
- input = &quot;A paragraph.&quot; .. newline ..
- &quot;&gt; Not a quote.&quot; .. newline
- tex.sprint(convert(input)) }
-<span class="fu">\bye</span></code></pre></div>
+<h5 id="lua-module-example-1" class="unnumbered">Lua Module Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb53"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb53-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb53-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb53-3" data-line-number="3"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb53-4" data-line-number="4"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb53-5" data-line-number="5"> local newline = [[^^J^^J]]</a>
+<a class="sourceLine" id="cb53-6" data-line-number="6"> local convert, input</a>
+<a class="sourceLine" id="cb53-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb53-8" data-line-number="8"> convert = markdown.new()</a>
+<a class="sourceLine" id="cb53-9" data-line-number="9"> input = &quot;A paragraph.&quot; .. newline ..</a>
+<a class="sourceLine" id="cb53-10" data-line-number="10"> &quot;&gt; A quote.&quot; .. newline</a>
+<a class="sourceLine" id="cb53-11" data-line-number="11"> tex.sprint(convert(input))</a>
+<a class="sourceLine" id="cb53-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb53-13" data-line-number="13"> convert = markdown.new({blankBeforeBlockquote = true})</a>
+<a class="sourceLine" id="cb53-14" data-line-number="14"> input = &quot;A paragraph.&quot; .. newline ..</a>
+<a class="sourceLine" id="cb53-15" data-line-number="15"> &quot;&gt; Not a quote.&quot; .. newline</a>
+<a class="sourceLine" id="cb53-16" data-line-number="16"> tex.sprint(convert(input)) }</a>
+<a class="sourceLine" id="cb53-17" data-line-number="17"><span class="fu">\bye</span></a></code></pre></div>
<p>Then, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb54"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb54-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
@@ -410,21 +521,21 @@ Hello *world*!
</blockquote>
<p>A paragraph &gt; Not a quote.</p>
</blockquote>
-<h6 id="lua-cli-example-1" class="unnumbered">Lua CLI example</h6>
+<h5 id="lua-cli-example-1" class="unnumbered">Lua CLI Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\input</span> optionfalse
-<span class="fu">\input</span> optiontrue
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb55"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb55-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb55-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb55-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a>
+<a class="sourceLine" id="cb55-4" data-line-number="4"><span class="fu">\input</span> optiontrue</a>
+<a class="sourceLine" id="cb55-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div>
<p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">A paragraph.
-&gt;<span class="dt"> A quote?</span></code></pre></div>
+<div class="sourceCode" id="cb56"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb56-1" data-line-number="1">A paragraph.</a>
+<a class="sourceLine" id="cb56-2" data-line-number="2">&gt;<span class="dt"> A quote?</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> -- content.md optionfalse.tex
-<span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> blankBeforeBlockquote=true -- content.md optiontrue.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
-<p>where <code>&lt;CLI␣PATHNAME&gt;</code> corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\&lt;YOUR␣USERNAME&gt;\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
+<div class="sourceCode" id="cb57"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb57-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a>
+<a class="sourceLine" id="cb57-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ blankBeforeBlockquote=true -- content.md optiontrue.tex</a>
+<a class="sourceLine" id="cb57-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
@@ -433,24 +544,24 @@ Hello *world*!
</blockquote>
<p>A paragraph. &gt; A quote?</p>
</blockquote>
-<h6 id="plain-tex-example-1" class="unnumbered">Plain TeX example</h6>
+<h5 id="plain-tex-example-1" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-
-<span class="fu">\markdownBegin</span>
-A paragraph.
-&gt; A quote.
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\def</span>\markdownOptionBlankBeforeBlockquote{true}
-<span class="fu">\markdownBegin</span>
-A paragraph.
-&gt; Not a quote.
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb58"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb58-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb58-2" data-line-number="2"></a>
+<a class="sourceLine" id="cb58-3" data-line-number="3"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb58-4" data-line-number="4">A paragraph.</a>
+<a class="sourceLine" id="cb58-5" data-line-number="5">&gt; A quote.</a>
+<a class="sourceLine" id="cb58-6" data-line-number="6"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb58-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb58-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionBlankBeforeBlockquote{true}</a>
+<a class="sourceLine" id="cb58-9" data-line-number="9"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb58-10" data-line-number="10">A paragraph.</a>
+<a class="sourceLine" id="cb58-11" data-line-number="11">&gt; Not a quote.</a>
+<a class="sourceLine" id="cb58-12" data-line-number="12"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb58-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb58-14" data-line-number="14"><span class="fu">\bye</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb59"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb59-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
@@ -459,25 +570,25 @@ A paragraph.
</blockquote>
<p>A paragraph &gt; Not a quote.</p>
</blockquote>
-<h6 id="latex-example-1" class="unnumbered">LaTeX example</h6>
+<h5 id="latex-example-1" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-A paragraph.
-&gt; A quote.
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{blankBeforeBlockquote}
-A paragraph.
-&gt; Not a quote.
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
+<div class="sourceCode" id="cb60"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb60-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb60-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb60-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb60-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb60-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb60-6" data-line-number="6">A paragraph.</a>
+<a class="sourceLine" id="cb60-7" data-line-number="7">&gt; A quote.</a>
+<a class="sourceLine" id="cb60-8" data-line-number="8"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb60-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb60-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{blankBeforeBlockquote}</a>
+<a class="sourceLine" id="cb60-11" data-line-number="11">A paragraph.</a>
+<a class="sourceLine" id="cb60-12" data-line-number="12">&gt; Not a quote.</a>
+<a class="sourceLine" id="cb60-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb60-14" data-line-number="14"></a>
+<a class="sourceLine" id="cb60-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb61"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb61-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
@@ -486,25 +597,25 @@ A paragraph.
</blockquote>
<p>A paragraph &gt; Not a quote.</p>
</blockquote>
-<h6 id="context-example-1" class="unnumbered">ConTeXt example</h6>
+<h5 id="context-example-1" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\starttext</span>
-
-<span class="fu">\startmarkdown</span>
-A paragraph.
-&gt; A quote.
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\def</span>\markdownOptionBlankBeforeBlockquote{true}
-<span class="fu">\startmarkdown</span>
-A paragraph.
-&gt; Not a quote.
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\stoptext</span></code></pre></div>
+<div class="sourceCode" id="cb62"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb62-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb62-2" data-line-number="2"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb62-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb62-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb62-5" data-line-number="5">A paragraph.</a>
+<a class="sourceLine" id="cb62-6" data-line-number="6">&gt; A quote.</a>
+<a class="sourceLine" id="cb62-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb62-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb62-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionBlankBeforeBlockquote{true}</a>
+<a class="sourceLine" id="cb62-10" data-line-number="10"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb62-11" data-line-number="11">A paragraph.</a>
+<a class="sourceLine" id="cb62-12" data-line-number="12">&gt; Not a quote.</a>
+<a class="sourceLine" id="cb62-13" data-line-number="13"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb62-14" data-line-number="14"></a>
+<a class="sourceLine" id="cb62-15" data-line-number="15"><span class="fu">\stoptext</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb63"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb63-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
@@ -513,7 +624,7 @@ A paragraph.
</blockquote>
<p>A paragraph &gt; Not a quote.</p>
</blockquote>
-<h5 id="option-blankbeforecodefence"><span class="header-section-number">2.1.2.2.2</span> Option <code>blankBeforeCodeFence</code></h5>
+<h4 id="option-blankbeforecodefence"><span class="header-section-number">2.2.1.3</span> Option <code>blankBeforeCodeFence</code></h4>
<dl>
<dt><code>blankBeforeCodeFence</code> (default value: <code>false</code>)</dt>
<dd><dl>
@@ -526,150 +637,150 @@ A paragraph.
</dl>
</dd>
</dl>
-<h6 id="lua-module-example-2" class="unnumbered">Lua module example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local newline = [[^^J^^J]]
- local convert, input
-
- convert = markdown.new({fencedCode = true})
- input = &quot;A paragraph.&quot; .. newline ..
- &quot;```&quot; .. newline ..
- &quot;A code fence.&quot; .. newline ..
- &quot;```&quot; .. newline
- tex.sprint(convert(input))
-
- convert = markdown.new({
- fencedCode = true, blankBeforeCodeFence = true})
- input = &quot;A paragraph.&quot; .. newline ..
- &quot;```&quot; .. newline ..
- &quot;Not a code fence.&quot; .. newline ..
- &quot;```&quot; .. newline
- tex.sprint(convert(input)) }
-<span class="fu">\bye</span></code></pre></div>
+<h5 id="lua-module-example-2" class="unnumbered">Lua Module Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb64"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb64-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb64-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb64-3" data-line-number="3"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb64-4" data-line-number="4"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb64-5" data-line-number="5"> local newline = [[^^J^^J]]</a>
+<a class="sourceLine" id="cb64-6" data-line-number="6"> local convert, input</a>
+<a class="sourceLine" id="cb64-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb64-8" data-line-number="8"> convert = markdown.new({fencedCode = true})</a>
+<a class="sourceLine" id="cb64-9" data-line-number="9"> input = &quot;A paragraph.&quot; .. newline ..</a>
+<a class="sourceLine" id="cb64-10" data-line-number="10"> &quot;```&quot; .. newline ..</a>
+<a class="sourceLine" id="cb64-11" data-line-number="11"> &quot;A code fence.&quot; .. newline ..</a>
+<a class="sourceLine" id="cb64-12" data-line-number="12"> &quot;```&quot; .. newline</a>
+<a class="sourceLine" id="cb64-13" data-line-number="13"> tex.sprint(convert(input))</a>
+<a class="sourceLine" id="cb64-14" data-line-number="14"></a>
+<a class="sourceLine" id="cb64-15" data-line-number="15"> convert = markdown.new({</a>
+<a class="sourceLine" id="cb64-16" data-line-number="16"> fencedCode = true, blankBeforeCodeFence = true})</a>
+<a class="sourceLine" id="cb64-17" data-line-number="17"> input = &quot;A paragraph.&quot; .. newline ..</a>
+<a class="sourceLine" id="cb64-18" data-line-number="18"> &quot;```&quot; .. newline ..</a>
+<a class="sourceLine" id="cb64-19" data-line-number="19"> &quot;Not a code fence.&quot; .. newline ..</a>
+<a class="sourceLine" id="cb64-20" data-line-number="20"> &quot;```&quot; .. newline</a>
+<a class="sourceLine" id="cb64-21" data-line-number="21"> tex.sprint(convert(input)) }</a>
+<a class="sourceLine" id="cb64-22" data-line-number="22"><span class="fu">\bye</span></a></code></pre></div>
<p>Then, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb65"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb65-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
<pre><code>A code fence.</code></pre>
<p>A paragraph. <code>Not a code fence.</code></p>
</blockquote>
-<h6 id="lua-cli-example-2" class="unnumbered">Lua CLI example</h6>
+<h5 id="lua-cli-example-2" class="unnumbered">Lua CLI Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\input</span> optionfalse
-<span class="fu">\input</span> optiontrue
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb67"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb67-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb67-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb67-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a>
+<a class="sourceLine" id="cb67-4" data-line-number="4"><span class="fu">\input</span> optiontrue</a>
+<a class="sourceLine" id="cb67-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div>
<p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">A paragraph.
-```
-A code fence?
-```</code></pre></div>
+<div class="sourceCode" id="cb68"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb68-1" data-line-number="1">A paragraph.</a>
+<a class="sourceLine" id="cb68-2" data-line-number="2">```</a>
+<a class="sourceLine" id="cb68-3" data-line-number="3">A code fence?</a>
+<a class="sourceLine" id="cb68-4" data-line-number="4">```</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> fencedCode=true -- content.md optionfalse.tex
-<span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> fencedCode=true blankBeforeCodeFence=true -- content.md optiontrue.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
-<p>where <code>&lt;CLI␣PATHNAME&gt;</code> corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\&lt;YOUR␣USERNAME&gt;\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
+<div class="sourceCode" id="cb69"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb69-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ fencedCode=true -- content.md optionfalse.tex</a>
+<a class="sourceLine" id="cb69-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ fencedCode=true blankBeforeCodeFence=true -- content.md optiontrue.tex</a>
+<a class="sourceLine" id="cb69-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
<pre><code>A code fence?</code></pre>
<p>A paragraph. <code>A code fence?</code></p>
</blockquote>
-<h6 id="plain-tex-example-2" class="unnumbered">Plain TeX example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\def</span>\markdownOptionFencedCode{true}
-
-<span class="fu">\markdownBegin</span>
-A paragraph.
-```
-A code fence.
-```
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\def</span>\markdownOptionBlankBeforeCodeFence{true}
-<span class="fu">\markdownBegin</span>
-A paragraph.
-```
-Not a code fence.
-```
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\bye</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<h5 id="plain-tex-example-2" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb71"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb71-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb71-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFencedCode{true}</a>
+<a class="sourceLine" id="cb71-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb71-4" data-line-number="4"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb71-5" data-line-number="5">A paragraph.</a>
+<a class="sourceLine" id="cb71-6" data-line-number="6">```</a>
+<a class="sourceLine" id="cb71-7" data-line-number="7">A code fence.</a>
+<a class="sourceLine" id="cb71-8" data-line-number="8">```</a>
+<a class="sourceLine" id="cb71-9" data-line-number="9"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb71-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb71-11" data-line-number="11"><span class="fu">\def</span>\markdownOptionBlankBeforeCodeFence{true}</a>
+<a class="sourceLine" id="cb71-12" data-line-number="12"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb71-13" data-line-number="13">A paragraph.</a>
+<a class="sourceLine" id="cb71-14" data-line-number="14">```</a>
+<a class="sourceLine" id="cb71-15" data-line-number="15">Not a code fence.</a>
+<a class="sourceLine" id="cb71-16" data-line-number="16">```</a>
+<a class="sourceLine" id="cb71-17" data-line-number="17"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb71-18" data-line-number="18"></a>
+<a class="sourceLine" id="cb71-19" data-line-number="19"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb72"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb72-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
<pre><code>A code fence.</code></pre>
<p>A paragraph. <code>Not a code fence.</code></p>
</blockquote>
-<h6 id="latex-example-2" class="unnumbered">LaTeX example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>[fencedCode]{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-A paragraph.
-```
-A code fence.
-```
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{blankBeforeCodeFence}
-A paragraph.
-```
-Not a code fence.
-```
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<h5 id="latex-example-2" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb74"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb74-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb74-2" data-line-number="2"><span class="bu">\usepackage</span>[fencedCode]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb74-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb74-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb74-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb74-6" data-line-number="6">A paragraph.</a>
+<a class="sourceLine" id="cb74-7" data-line-number="7">```</a>
+<a class="sourceLine" id="cb74-8" data-line-number="8">A code fence.</a>
+<a class="sourceLine" id="cb74-9" data-line-number="9">```</a>
+<a class="sourceLine" id="cb74-10" data-line-number="10"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb74-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb74-12" data-line-number="12"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{blankBeforeCodeFence}</a>
+<a class="sourceLine" id="cb74-13" data-line-number="13">A paragraph.</a>
+<a class="sourceLine" id="cb74-14" data-line-number="14">```</a>
+<a class="sourceLine" id="cb74-15" data-line-number="15">Not a code fence.</a>
+<a class="sourceLine" id="cb74-16" data-line-number="16">```</a>
+<a class="sourceLine" id="cb74-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb74-18" data-line-number="18"></a>
+<a class="sourceLine" id="cb74-19" data-line-number="19"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb75"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb75-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
<pre><code>A code fence.</code></pre>
<p>A paragraph. <code>Not a code fence.</code></p>
</blockquote>
-<h6 id="context-example-2" class="unnumbered">ConTeXt example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\def</span>\markdownOptionFencedCode{true}
-<span class="fu">\starttext</span>
-
-<span class="fu">\startmarkdown</span>
-A paragraph.
-```
-A code fence.
-```
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\def</span>\markdownOptionBlankBeforeCodeFence{true}
-<span class="fu">\startmarkdown</span>
-A paragraph.
-```
-Not a code fence.
-```
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\stoptext</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<h5 id="context-example-2" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb77"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb77-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb77-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFencedCode{true}</a>
+<a class="sourceLine" id="cb77-3" data-line-number="3"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb77-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb77-5" data-line-number="5"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb77-6" data-line-number="6">A paragraph.</a>
+<a class="sourceLine" id="cb77-7" data-line-number="7">```</a>
+<a class="sourceLine" id="cb77-8" data-line-number="8">A code fence.</a>
+<a class="sourceLine" id="cb77-9" data-line-number="9">```</a>
+<a class="sourceLine" id="cb77-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb77-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb77-12" data-line-number="12"><span class="fu">\def</span>\markdownOptionBlankBeforeCodeFence{true}</a>
+<a class="sourceLine" id="cb77-13" data-line-number="13"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb77-14" data-line-number="14">A paragraph.</a>
+<a class="sourceLine" id="cb77-15" data-line-number="15">```</a>
+<a class="sourceLine" id="cb77-16" data-line-number="16">Not a code fence.</a>
+<a class="sourceLine" id="cb77-17" data-line-number="17">```</a>
+<a class="sourceLine" id="cb77-18" data-line-number="18"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb77-19" data-line-number="19"></a>
+<a class="sourceLine" id="cb77-20" data-line-number="20"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb78"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb78-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
<pre><code>A code fence.</code></pre>
<p>A paragraph. <code>Not a code fence.</code></p>
</blockquote>
-<h5 id="option-blankbeforeheading"><span class="header-section-number">2.1.2.2.3</span> Option <code>blankBeforeHeading</code></h5>
+<h4 id="option-blankbeforeheading"><span class="header-section-number">2.2.1.4</span> Option <code>blankBeforeHeading</code></h4>
<dl>
<dt><code>blankBeforeHeading</code> (default value: <code>false</code>)</dt>
<dd><dl>
@@ -682,139 +793,139 @@ Not a code fence.
</dl>
</dd>
</dl>
-<h6 id="lua-module-example-3" class="unnumbered">Lua module example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bf #1}\par}
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local newline = [[^^J^^J]]
- local convert, input
-
- convert = markdown.new()
- input = &quot;A paragraph.&quot; .. newline ..
- &quot;A heading.&quot; .. newline ..
- &quot;==========&quot; .. newline
- tex.sprint(convert(input))
-
- convert = markdown.new({blankBeforeHeading = true})
- input = &quot;A paragraph.&quot; .. newline ..
- &quot;Not a heading.&quot; .. newline ..
- &quot;==============&quot; .. newline
- tex.sprint(convert(input)) }
-<span class="fu">\bye</span></code></pre></div>
+<h5 id="lua-module-example-3" class="unnumbered">Lua Module Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb80"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb80-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb80-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb80-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bf #1}\par}</a>
+<a class="sourceLine" id="cb80-4" data-line-number="4"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb80-5" data-line-number="5"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb80-6" data-line-number="6"> local newline = [[^^J^^J]]</a>
+<a class="sourceLine" id="cb80-7" data-line-number="7"> local convert, input</a>
+<a class="sourceLine" id="cb80-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb80-9" data-line-number="9"> convert = markdown.new()</a>
+<a class="sourceLine" id="cb80-10" data-line-number="10"> input = &quot;A paragraph.&quot; .. newline ..</a>
+<a class="sourceLine" id="cb80-11" data-line-number="11"> &quot;A heading.&quot; .. newline ..</a>
+<a class="sourceLine" id="cb80-12" data-line-number="12"> &quot;==========&quot; .. newline</a>
+<a class="sourceLine" id="cb80-13" data-line-number="13"> tex.sprint(convert(input))</a>
+<a class="sourceLine" id="cb80-14" data-line-number="14"></a>
+<a class="sourceLine" id="cb80-15" data-line-number="15"> convert = markdown.new({blankBeforeHeading = true})</a>
+<a class="sourceLine" id="cb80-16" data-line-number="16"> input = &quot;A paragraph.&quot; .. newline ..</a>
+<a class="sourceLine" id="cb80-17" data-line-number="17"> &quot;Not a heading.&quot; .. newline ..</a>
+<a class="sourceLine" id="cb80-18" data-line-number="18"> &quot;==============&quot; .. newline</a>
+<a class="sourceLine" id="cb80-19" data-line-number="19"> tex.sprint(convert(input)) }</a>
+<a class="sourceLine" id="cb80-20" data-line-number="20"><span class="fu">\bye</span></a></code></pre></div>
<p>Then, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb81"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb81-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
<h1 id="a-heading.">A heading.</h1>
<p>A paragraph. Not a heading. ==============</p>
</blockquote>
-<h6 id="lua-cli-example-3" class="unnumbered">Lua CLI example</h6>
+<h5 id="lua-cli-example-3" class="unnumbered">Lua CLI Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\input</span> optionfalse
-<span class="fu">\input</span> optiontrue
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb82"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb82-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb82-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb82-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a>
+<a class="sourceLine" id="cb82-4" data-line-number="4"><span class="fu">\input</span> optiontrue</a>
+<a class="sourceLine" id="cb82-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div>
<p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">A paragraph.
-A heading?
-==========</code></pre></div>
+<div class="sourceCode" id="cb83"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb83-1" data-line-number="1">A paragraph.</a>
+<a class="sourceLine" id="cb83-2" data-line-number="2">A heading?</a>
+<a class="sourceLine" id="cb83-3" data-line-number="3">==========</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> -- content.md optionfalse.tex
-<span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> blankBeforeHeading=true -- content.md optiontrue.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
-<p>where <code>&lt;CLI␣PATHNAME&gt;</code> corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\&lt;YOUR␣USERNAME&gt;\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
+<div class="sourceCode" id="cb84"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb84-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a>
+<a class="sourceLine" id="cb84-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ blankBeforeHeading=true -- content.md optiontrue.tex</a>
+<a class="sourceLine" id="cb84-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
<h1 id="a-heading">A heading?</h1>
<p>A paragraph. A heading? ==========</p>
</blockquote>
-<h6 id="plain-tex-example-3" class="unnumbered">Plain TeX example</h6>
+<h5 id="plain-tex-example-3" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-
-<span class="fu">\markdownBegin</span>
-A paragraph.
-A heading.
-==========
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\def</span>\markdownOptionBlankBeforeHeading{true}
-<span class="fu">\markdownBegin</span>
-A paragraph.
-Not a heading.
-==============
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb85"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb85-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb85-2" data-line-number="2"></a>
+<a class="sourceLine" id="cb85-3" data-line-number="3"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb85-4" data-line-number="4">A paragraph.</a>
+<a class="sourceLine" id="cb85-5" data-line-number="5">A heading.</a>
+<a class="sourceLine" id="cb85-6" data-line-number="6">==========</a>
+<a class="sourceLine" id="cb85-7" data-line-number="7"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb85-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb85-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionBlankBeforeHeading{true}</a>
+<a class="sourceLine" id="cb85-10" data-line-number="10"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb85-11" data-line-number="11">A paragraph.</a>
+<a class="sourceLine" id="cb85-12" data-line-number="12">Not a heading.</a>
+<a class="sourceLine" id="cb85-13" data-line-number="13">==============</a>
+<a class="sourceLine" id="cb85-14" data-line-number="14"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb85-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb85-16" data-line-number="16"><span class="fu">\bye</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb86"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb86-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
<h1 id="a-heading.-1">A heading.</h1>
<p>A paragraph. Not a heading. ==============</p>
</blockquote>
-<h6 id="latex-example-3" class="unnumbered">LaTeX example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-A paragraph.
-A heading.
-==========
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{blankBeforeHeading}
-A paragraph.
-Not a heading.
-==============
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<h5 id="latex-example-3" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb87"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb87-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb87-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb87-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb87-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb87-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb87-6" data-line-number="6">A paragraph.</a>
+<a class="sourceLine" id="cb87-7" data-line-number="7">A heading.</a>
+<a class="sourceLine" id="cb87-8" data-line-number="8">==========</a>
+<a class="sourceLine" id="cb87-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb87-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb87-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{blankBeforeHeading}</a>
+<a class="sourceLine" id="cb87-12" data-line-number="12">A paragraph.</a>
+<a class="sourceLine" id="cb87-13" data-line-number="13">Not a heading.</a>
+<a class="sourceLine" id="cb87-14" data-line-number="14">==============</a>
+<a class="sourceLine" id="cb87-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb87-16" data-line-number="16"></a>
+<a class="sourceLine" id="cb87-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb88"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb88-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
<h1 id="a-heading.-2">A heading.</h1>
<p>A paragraph. Not a heading. ==============</p>
</blockquote>
-<h6 id="context-example-3" class="unnumbered">ConTeXt example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\starttext</span>
-
-<span class="fu">\startmarkdown</span>
-A paragraph.
-A heading.
-==========
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\def</span>\markdownOptionBlankBeforeHeading{true}
-<span class="fu">\startmarkdown</span>
-A paragraph.
-Not a heading.
-==============
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\stoptext</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<h5 id="context-example-3" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb89"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb89-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb89-2" data-line-number="2"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb89-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb89-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb89-5" data-line-number="5">A paragraph.</a>
+<a class="sourceLine" id="cb89-6" data-line-number="6">A heading.</a>
+<a class="sourceLine" id="cb89-7" data-line-number="7">==========</a>
+<a class="sourceLine" id="cb89-8" data-line-number="8"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb89-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb89-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionBlankBeforeHeading{true}</a>
+<a class="sourceLine" id="cb89-11" data-line-number="11"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb89-12" data-line-number="12">A paragraph.</a>
+<a class="sourceLine" id="cb89-13" data-line-number="13">Not a heading.</a>
+<a class="sourceLine" id="cb89-14" data-line-number="14">==============</a>
+<a class="sourceLine" id="cb89-15" data-line-number="15"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb89-16" data-line-number="16"></a>
+<a class="sourceLine" id="cb89-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb90"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb90-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>A paragraph.</p>
<h1 id="a-heading.-3">A heading.</h1>
<p>A paragraph. Not a heading. ==============</p>
</blockquote>
-<h5 id="option-breakableblockquotes"><span class="header-section-number">2.1.2.2.4</span> Option <code>breakableBlockquotes</code></h5>
+<h4 id="option-breakableblockquotes"><span class="header-section-number">2.2.1.5</span> Option <code>breakableBlockquotes</code></h4>
<dl>
<dt><code>breakableBlockquotes</code> (default value: <code>false</code>)</dt>
<dd><dl>
@@ -827,28 +938,28 @@ Not a heading.
</dl>
</dd>
</dl>
-<h6 id="lua-module-example-4" class="unnumbered">Lua module example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bf #1}\par}
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local newline = [[^^J^^J]]
- local convert, input
-
- convert = markdown.new()
- input = &quot;&gt; A single&quot; .. newline .. newline ..
- &quot;&gt; block quote.&quot; .. newline
- tex.sprint(convert(input))
-
- convert = markdown.new({breakableBlockquotes = true})
- input = &quot;&gt; A block quote.&quot; .. newline .. newline ..
- &quot;&gt; Another block quote.&quot; .. newline
- tex.sprint(convert(input)) }
-<span class="fu">\bye</span></code></pre></div>
+<h5 id="lua-module-example-4" class="unnumbered">Lua Module Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb91"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb91-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb91-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb91-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bf #1}\par}</a>
+<a class="sourceLine" id="cb91-4" data-line-number="4"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb91-5" data-line-number="5"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb91-6" data-line-number="6"> local newline = [[^^J^^J]]</a>
+<a class="sourceLine" id="cb91-7" data-line-number="7"> local convert, input</a>
+<a class="sourceLine" id="cb91-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb91-9" data-line-number="9"> convert = markdown.new()</a>
+<a class="sourceLine" id="cb91-10" data-line-number="10"> input = &quot;&gt; A single&quot; .. newline .. newline ..</a>
+<a class="sourceLine" id="cb91-11" data-line-number="11"> &quot;&gt; block quote.&quot; .. newline</a>
+<a class="sourceLine" id="cb91-12" data-line-number="12"> tex.sprint(convert(input))</a>
+<a class="sourceLine" id="cb91-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb91-14" data-line-number="14"> convert = markdown.new({breakableBlockquotes = true})</a>
+<a class="sourceLine" id="cb91-15" data-line-number="15"> input = &quot;&gt; A block quote.&quot; .. newline .. newline ..</a>
+<a class="sourceLine" id="cb91-16" data-line-number="16"> &quot;&gt; Another block quote.&quot; .. newline</a>
+<a class="sourceLine" id="cb91-17" data-line-number="17"> tex.sprint(convert(input)) }</a>
+<a class="sourceLine" id="cb91-18" data-line-number="18"><span class="fu">\bye</span></a></code></pre></div>
<p>Then, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb92"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb92-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<blockquote>
@@ -861,22 +972,22 @@ Not a heading.
<p>Another block quote.</p>
</blockquote>
</blockquote>
-<h6 id="lua-cli-example-4" class="unnumbered">Lua CLI example</h6>
+<h5 id="lua-cli-example-4" class="unnumbered">Lua CLI Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\input</span> optionfalse
-<span class="fu">\input</span> optiontrue
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb93"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb93-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb93-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb93-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a>
+<a class="sourceLine" id="cb93-4" data-line-number="4"><span class="fu">\input</span> optiontrue</a>
+<a class="sourceLine" id="cb93-5" data-line-number="5"><span class="fu">\bye</span></a></code></pre></div>
<p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">&gt;<span class="dt"> A single block quote</span>
-
-<span class="dt">&gt; or two block quotes?</span></code></pre></div>
+<div class="sourceCode" id="cb94"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb94-1" data-line-number="1">&gt;<span class="dt"> A single block quote</span></a>
+<a class="sourceLine" id="cb94-2" data-line-number="2"></a>
+<a class="sourceLine" id="cb94-3" data-line-number="3">&gt;<span class="dt"> or two block quotes?</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> -- content.md optionfalse.tex
-<span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> breakableBlockquotes=true -- content.md optiontrue.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
-<p>where <code>&lt;CLI␣PATHNAME&gt;</code> corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\&lt;YOUR␣USERNAME&gt;\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
+<div class="sourceCode" id="cb95"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb95-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a>
+<a class="sourceLine" id="cb95-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ breakableBlockquotes=true -- content.md optiontrue.tex</a>
+<a class="sourceLine" id="cb95-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<blockquote>
@@ -889,26 +1000,26 @@ Not a heading.
<p>or two block quotes?</p>
</blockquote>
</blockquote>
-<h6 id="plain-tex-example-4" class="unnumbered">Plain TeX example</h6>
+<h5 id="plain-tex-example-4" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-
-<span class="fu">\markdownBegin</span>
-&gt; A single
-
-&gt; block quote.
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\def</span>\markdownOptionBreakableBlockquotes{true}
-<span class="fu">\markdownBegin</span>
-&gt; A block quote.
-
-&gt; Another block quote.
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb96"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb96-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb96-2" data-line-number="2"></a>
+<a class="sourceLine" id="cb96-3" data-line-number="3"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb96-4" data-line-number="4">&gt; A single</a>
+<a class="sourceLine" id="cb96-5" data-line-number="5"></a>
+<a class="sourceLine" id="cb96-6" data-line-number="6">&gt; block quote.</a>
+<a class="sourceLine" id="cb96-7" data-line-number="7"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb96-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb96-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionBreakableBlockquotes{true}</a>
+<a class="sourceLine" id="cb96-10" data-line-number="10"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb96-11" data-line-number="11">&gt; A block quote.</a>
+<a class="sourceLine" id="cb96-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb96-13" data-line-number="13">&gt; Another block quote.</a>
+<a class="sourceLine" id="cb96-14" data-line-number="14"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb96-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb96-16" data-line-number="16"><span class="fu">\bye</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb97"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb97-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<blockquote>
@@ -921,27 +1032,27 @@ Not a heading.
<p>Another block quote.</p>
</blockquote>
</blockquote>
-<h6 id="latex-example-4" class="unnumbered">LaTeX example</h6>
+<h5 id="latex-example-4" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-&gt; A single
-
-&gt; block quote.
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{breakableBlockquotes}
-&gt; A block quote.
-
-&gt; Another block quote.
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
+<div class="sourceCode" id="cb98"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb98-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb98-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb98-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb98-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb98-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb98-6" data-line-number="6">&gt; A single</a>
+<a class="sourceLine" id="cb98-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb98-8" data-line-number="8">&gt; block quote.</a>
+<a class="sourceLine" id="cb98-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb98-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb98-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{breakableBlockquotes}</a>
+<a class="sourceLine" id="cb98-12" data-line-number="12">&gt; A block quote.</a>
+<a class="sourceLine" id="cb98-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb98-14" data-line-number="14">&gt; Another block quote.</a>
+<a class="sourceLine" id="cb98-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb98-16" data-line-number="16"></a>
+<a class="sourceLine" id="cb98-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb99"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb99-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<blockquote>
@@ -954,27 +1065,27 @@ Not a heading.
<p>Another block quote.</p>
</blockquote>
</blockquote>
-<h6 id="context-example-4" class="unnumbered">ConTeXt example</h6>
+<h5 id="context-example-4" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\starttext</span>
-
-<span class="fu">\startmarkdown</span>
-&gt; A single
-
-&gt; block quote.
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\def</span>\markdownOptionBreakableBlockquotes{true}
-<span class="fu">\startmarkdown</span>
-&gt; A block quote.
-
-&gt; Another block quote.
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\stoptext</span></code></pre></div>
+<div class="sourceCode" id="cb100"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb100-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb100-2" data-line-number="2"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb100-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb100-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb100-5" data-line-number="5">&gt; A single</a>
+<a class="sourceLine" id="cb100-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb100-7" data-line-number="7">&gt; block quote.</a>
+<a class="sourceLine" id="cb100-8" data-line-number="8"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb100-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb100-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionBreakableBlockquotes{true}</a>
+<a class="sourceLine" id="cb100-11" data-line-number="11"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb100-12" data-line-number="12">&gt; A block quote.</a>
+<a class="sourceLine" id="cb100-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb100-14" data-line-number="14">&gt; Another block quote.</a>
+<a class="sourceLine" id="cb100-15" data-line-number="15"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb100-16" data-line-number="16"></a>
+<a class="sourceLine" id="cb100-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb101"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb101-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<blockquote>
@@ -987,7 +1098,7 @@ Not a heading.
<p>Another block quote.</p>
</blockquote>
</blockquote>
-<h5 id="option-citationnbsps"><span class="header-section-number">2.1.2.2.5</span> Option <code>citationNbsps</code></h5>
+<h4 id="option-citationnbsps"><span class="header-section-number">2.2.1.6</span> Option <code>citationNbsps</code></h4>
<dl>
<dt><code>citationNbsps</code> (default value: <code>true</code>)</dt>
<dd><dl>
@@ -1000,60 +1111,61 @@ Not a heading.
</dl>
</dd>
</dl>
-<h6 id="latex-example-5" class="unnumbered">LaTeX example</h6>
+<h5 id="latex-example-5" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.bib</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode bib"><code class="sourceCode bibtex"><span class="va">@book</span>{<span class="ot">knuth:tex</span>,
- <span class="dt">author</span> = &quot;<span class="st">Knuth, Donald Ervin</span>&quot;,
- <span class="dt">title</span> = &quot;<span class="st">The </span><span class="ch">\TeX</span><span class="st"> book, volume A of Computers and typesetting</span>&quot;,
- <span class="dt">publisher</span> = &quot;<span class="st">Addison-Wesley</span>&quot;,
- <span class="dt">year</span> = &quot;<span class="st">1984</span>&quot; }</code></pre></div>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-The TeXbook [@knuth:tex, p. 123 and 130] is good.
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{citationNbsps = false}
-The TeXbook [@knuth:tex, p. 123 and 130] is good.
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-
-<span class="bu">\bibliographystyle</span>{<span class="ex">plain</span>}
-<span class="bu">\bibliography</span>{<span class="ex">document.bib</span>}
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
+<div class="sourceCode" id="cb102"><pre class="sourceCode bib"><code class="sourceCode bibtex"><a class="sourceLine" id="cb102-1" data-line-number="1"><span class="va">@book</span>{<span class="ot">knuth:tex</span>,</a>
+<a class="sourceLine" id="cb102-2" data-line-number="2"> <span class="dt">author</span> = &quot;<span class="st">Knuth, Donald Ervin</span>&quot;,</a>
+<a class="sourceLine" id="cb102-3" data-line-number="3"> <span class="dt">title</span> = &quot;<span class="st">The </span><span class="ch">\TeX</span><span class="st"> book, volume A of Computers and typesetting</span>&quot;,</a>
+<a class="sourceLine" id="cb102-4" data-line-number="4"> <span class="dt">publisher</span> = &quot;<span class="st">Addison-Wesley</span>&quot;,</a>
+<a class="sourceLine" id="cb102-5" data-line-number="5"> <span class="dt">year</span> = &quot;<span class="st">1984</span>&quot;</a>
+<a class="sourceLine" id="cb102-6" data-line-number="6">}</a></code></pre></div>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb103"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb103-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb103-2" data-line-number="2"><span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb103-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb103-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb103-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb103-6" data-line-number="6">The TeXbook [@knuth:tex, p. 123 and 130] is good.</a>
+<a class="sourceLine" id="cb103-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb103-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb103-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{citationNbsps = false}</a>
+<a class="sourceLine" id="cb103-10" data-line-number="10">The TeXbook [@knuth:tex, p. 123 and 130] is good.</a>
+<a class="sourceLine" id="cb103-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb103-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb103-13" data-line-number="13"><span class="bu">\bibliographystyle</span>{<span class="ex">plain</span>}</a>
+<a class="sourceLine" id="cb103-14" data-line-number="14"><span class="bu">\bibliography</span>{<span class="ex">document.bib</span>}</a>
+<a class="sourceLine" id="cb103-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
<p>Next, invoke LuaTeX and BibTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex
-<span class="ex">bibtex</span> document.aux
-<span class="ex">lualatex</span> document.tex
-<span class="ex">lualatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb104"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb104-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a>
+<a class="sourceLine" id="cb104-2" data-line-number="2"><span class="ex">bibtex</span> document.aux</a>
+<a class="sourceLine" id="cb104-3" data-line-number="3"><span class="ex">lualatex</span> document.tex</a>
+<a class="sourceLine" id="cb104-4" data-line-number="4"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text, where the middot (<code>·</code>) denotes a non-breakable space:</p>
<blockquote>
<p>The TeXbook [1, p.·123·and·130] is good.</p>
-<p>The TeXbook [1, p. 123 and 130] is good.</p>
+<p>The TeXbook [1, p. 123 and 130] is good.</p>
<h3 id="references">References</h3>
<p>[1] Donald·Ervin Knuth. <em>The TeXbook, volume A of Computers and typesetting.</em> Addison-Wesley, 1984.</p>
</blockquote>
-<h5 id="option-citations"><span class="header-section-number">2.1.2.2.6</span> Option <code>citations</code></h5>
+<h4 id="option-citations"><span class="header-section-number">2.2.1.7</span> Option <code>citations</code></h4>
<dl>
<dt><code>citations</code> (default value: <code>false</code>)</dt>
<dd><dl>
<dt>true</dt>
<dd><p>Enable the pandoc citation syntax extension:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">Here is a simple parenthetical citation [@doe99] and here
-is a string of several [see @doe99, pp. 33-35; also
-@smith04, chap. 1].
-
-A parenthetical citation can have a [prenote @doe99] and
-a [@smith04 postnote]. The name of the author can be
-suppressed by inserting a dash before the name of an
-author as follows [-@smith04].
-
-Here is a simple text citation @doe99 and here is
-a string of several @doe99 [pp. 33-35; also @smith04,
-chap. 1]. Here is one with the name of the author
-suppressed -@doe99.</code></pre></div>
+<div class="sourceCode" id="cb105"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb105-1" data-line-number="1">Here is a simple parenthetical citation [@doe99] and here</a>
+<a class="sourceLine" id="cb105-2" data-line-number="2">is a string of several [see @doe99, pp. 33-35; also</a>
+<a class="sourceLine" id="cb105-3" data-line-number="3">@smith04, chap. 1].</a>
+<a class="sourceLine" id="cb105-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb105-5" data-line-number="5">A parenthetical citation can have a [prenote @doe99] and</a>
+<a class="sourceLine" id="cb105-6" data-line-number="6">a [@smith04 postnote]. The name of the author can be</a>
+<a class="sourceLine" id="cb105-7" data-line-number="7">suppressed by inserting a dash before the name of an</a>
+<a class="sourceLine" id="cb105-8" data-line-number="8">author as follows [-@smith04].</a>
+<a class="sourceLine" id="cb105-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb105-10" data-line-number="10">Here is a simple text citation @doe99 and here is</a>
+<a class="sourceLine" id="cb105-11" data-line-number="11">a string of several @doe99 [pp. 33-35; also @smith04,</a>
+<a class="sourceLine" id="cb105-12" data-line-number="12">chap. 1]. Here is one with the name of the author</a>
+<a class="sourceLine" id="cb105-13" data-line-number="13">suppressed -@doe99.</a></code></pre></div>
</dd>
</dl>
</dd>
@@ -1064,45 +1176,46 @@ suppressed -@doe99.</code></pre></div>
</dl>
</dd>
</dl>
-<h6 id="latex-example-6" class="unnumbered">LaTeX example</h6>
+<h5 id="latex-example-6" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.bib</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode bib"><code class="sourceCode bibtex"><span class="va">@book</span>{<span class="ot">knuth:tex</span>,
- <span class="dt">author</span> = &quot;<span class="st">Knuth, Donald Ervin</span>&quot;,
- <span class="dt">title</span> = &quot;<span class="st">The </span><span class="ch">\TeX</span><span class="st"> book, volume A of Computers and typesetting</span>&quot;,
- <span class="dt">publisher</span> = &quot;<span class="st">Addison-Wesley</span>&quot;,
- <span class="dt">year</span> = &quot;<span class="st">1984</span>&quot; }</code></pre></div>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>[backend=biber]{<span class="ex">biblatex</span>}
-<span class="fu">\addbibresource</span>{document.bib}
-<span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-The TeXbook [@knuth:tex, p. 123 and 130] was written by @knuth:tex.
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="fu">\printbibliography</span>
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
+<div class="sourceCode" id="cb106"><pre class="sourceCode bib"><code class="sourceCode bibtex"><a class="sourceLine" id="cb106-1" data-line-number="1"><span class="va">@book</span>{<span class="ot">knuth:tex</span>,</a>
+<a class="sourceLine" id="cb106-2" data-line-number="2"> <span class="dt">author</span> = &quot;<span class="st">Knuth, Donald Ervin</span>&quot;,</a>
+<a class="sourceLine" id="cb106-3" data-line-number="3"> <span class="dt">title</span> = &quot;<span class="st">The </span><span class="ch">\TeX</span><span class="st"> book, volume A of Computers and typesetting</span>&quot;,</a>
+<a class="sourceLine" id="cb106-4" data-line-number="4"> <span class="dt">publisher</span> = &quot;<span class="st">Addison-Wesley</span>&quot;,</a>
+<a class="sourceLine" id="cb106-5" data-line-number="5"> <span class="dt">year</span> = &quot;<span class="st">1984</span>&quot;</a>
+<a class="sourceLine" id="cb106-6" data-line-number="6">}</a></code></pre></div>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb107"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb107-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb107-2" data-line-number="2"><span class="bu">\usepackage</span>[backend=biber]{<span class="ex">biblatex</span>}</a>
+<a class="sourceLine" id="cb107-3" data-line-number="3"><span class="fu">\addbibresource</span>{document.bib}</a>
+<a class="sourceLine" id="cb107-4" data-line-number="4"><span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb107-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb107-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb107-7" data-line-number="7"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb107-8" data-line-number="8">The TeXbook [@knuth:tex, p. 123 and 130] was written by @knuth:tex.</a>
+<a class="sourceLine" id="cb107-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb107-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb107-11" data-line-number="11"><span class="fu">\printbibliography</span></a>
+<a class="sourceLine" id="cb107-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
<p>Next, invoke LuaTeX and Biber from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex
-<span class="ex">biber</span> document.bcf
-<span class="ex">lualatex</span> document.tex
-<span class="ex">lualatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb108"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb108-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a>
+<a class="sourceLine" id="cb108-2" data-line-number="2"><span class="ex">biber</span> document.bcf</a>
+<a class="sourceLine" id="cb108-3" data-line-number="3"><span class="ex">lualatex</span> document.tex</a>
+<a class="sourceLine" id="cb108-4" data-line-number="4"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>The TeXbook [1, p.·123 and 130] was written by Knuth [1].</p>
<h3 id="references-1">References</h3>
-<p>[1] Donald Ervin Knuth. <em>The TeXbook, volume A of Computers and typesetting.</em> Addison-Wesley, 1984.</p>
+<p>[1] Donald Ervin Knuth. <em>The <span class="tex">T<sub>e</sub>X</span>book, volume A of Computers and typesetting.</em> Addison-Wesley, 1984.</p>
</blockquote>
-<h5 id="option-codespans"><span class="header-section-number">2.1.2.2.7</span> Option <code>codeSpans</code></h5>
+<h4 id="option-codespans"><span class="header-section-number">2.2.1.8</span> Option <code>codeSpans</code></h4>
<dl>
<dt><code>codeSpans</code> (default value: <code>true</code>)</dt>
<dd><dl>
<dt>true</dt>
<dd><p>Enable the code span syntax:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">Use the <span class="bn">`printf()`</span> function.
-`<span class="bn">`There is a literal backtick (`</span>) here.``</code></pre></div>
+<div class="sourceCode" id="cb109"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb109-1" data-line-number="1">Use the <span class="bn">`printf()`</span> function.</a>
+<a class="sourceLine" id="cb109-2" data-line-number="2">`<span class="bn">`There is a literal backtick (`</span>) here.``</a></code></pre></div>
</dd>
</dl>
</dd>
@@ -1114,136 +1227,136 @@ The TeXbook [@knuth:tex, p. 123 and 130] was written by @knuth:tex.
</dl>
</dd>
</dl>
-<h6 id="lua-module-example-5" class="unnumbered">Lua module example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local convert = markdown.new()
- local input =
- &quot;``This is a code span.&#39;&#39; &quot; ..
- &quot;``This is no longer a code span.&#39;&#39;&quot;
- tex.sprint(convert(input)) }
-<span class="fu">\par</span>
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local convert = markdown.new({codeSpans = false})
- local input =
- &quot;``This is a quote.&#39;&#39; &quot; ..
- &quot;``This is another quote.&#39;&#39;&quot;
- tex.sprint(convert(input)) }
-<span class="fu">\bye</span></code></pre></div>
+<h5 id="lua-module-example-5" class="unnumbered">Lua Module Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb111"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb111-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb111-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb111-3" data-line-number="3"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb111-4" data-line-number="4"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb111-5" data-line-number="5"> local convert = markdown.new()</a>
+<a class="sourceLine" id="cb111-6" data-line-number="6"> local input =</a>
+<a class="sourceLine" id="cb111-7" data-line-number="7"> &quot;``This is a code span.&#39;&#39; &quot; ..</a>
+<a class="sourceLine" id="cb111-8" data-line-number="8"> &quot;``This is no longer a code span.&#39;&#39;&quot;</a>
+<a class="sourceLine" id="cb111-9" data-line-number="9"> tex.sprint(convert(input)) }</a>
+<a class="sourceLine" id="cb111-10" data-line-number="10"><span class="fu">\par</span></a>
+<a class="sourceLine" id="cb111-11" data-line-number="11"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb111-12" data-line-number="12"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb111-13" data-line-number="13"> local convert = markdown.new({codeSpans = false})</a>
+<a class="sourceLine" id="cb111-14" data-line-number="14"> local input =</a>
+<a class="sourceLine" id="cb111-15" data-line-number="15"> &quot;``This is a quote.&#39;&#39; &quot; ..</a>
+<a class="sourceLine" id="cb111-16" data-line-number="16"> &quot;``This is another quote.&#39;&#39;&quot;</a>
+<a class="sourceLine" id="cb111-17" data-line-number="17"> tex.sprint(convert(input)) }</a>
+<a class="sourceLine" id="cb111-18" data-line-number="18"><span class="fu">\bye</span></a></code></pre></div>
<p>Then, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb112"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb112-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p><code>This is a code span.''</code>This is no longer a code span.''</p>
+<p><code>This is a code span.''</code>This is no longer a code span.’’</p>
<p>“This is a quote.” “This is another quote.”</p>
</blockquote>
-<h6 id="lua-cli-example-5" class="unnumbered">Lua CLI example</h6>
+<h5 id="lua-cli-example-5" class="unnumbered">Lua CLI Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\input</span> optionfalse
-<span class="fu">\par</span>
-<span class="fu">\input</span> optiontrue
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb113"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb113-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb113-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb113-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a>
+<a class="sourceLine" id="cb113-4" data-line-number="4"><span class="fu">\par</span></a>
+<a class="sourceLine" id="cb113-5" data-line-number="5"><span class="fu">\input</span> optiontrue</a>
+<a class="sourceLine" id="cb113-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div>
<p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">`<span class="bn">`Is this a code span?&#39;&#39; `</span>`Or a quote?&#39;&#39;</code></pre></div>
+<div class="sourceCode" id="cb114"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb114-1" data-line-number="1">`<span class="bn">`Is this a code span?&#39;&#39; `</span>`Or a quote?&#39;&#39;</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> codeSpans=false -- content.md optionfalse.tex
-<span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> -- content.md optiontrue.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
-<p>where <code>&lt;CLI␣PATHNAME&gt;</code> corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\&lt;YOUR␣USERNAME&gt;\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
+<div class="sourceCode" id="cb115"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb115-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ codeSpans=false -- content.md optionfalse.tex</a>
+<a class="sourceLine" id="cb115-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optiontrue.tex</a>
+<a class="sourceLine" id="cb115-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>“Is this a code span?” “Or a quote?”</p>
-<p><code>Is this a code span?''</code>Or a quote?''</p>
+<p><code>Is this a code span?''</code>Or a quote?’’</p>
</blockquote>
-<h6 id="plain-tex-example-5" class="unnumbered">Plain TeX example</h6>
+<h5 id="plain-tex-example-5" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-
-<span class="fu">\markdownBegin</span>
-``This is a code span.&#39;&#39;
-``This is no longer a code span.&#39;&#39;
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\def</span>\markdownOptionCodeSpans{false}
-<span class="fu">\markdownBegin</span>
-``This is a quote.&#39;&#39;
-``This is another quote.&#39;&#39;
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb116"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb116-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb116-2" data-line-number="2"></a>
+<a class="sourceLine" id="cb116-3" data-line-number="3"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb116-4" data-line-number="4">``This is a code span.&#39;&#39;</a>
+<a class="sourceLine" id="cb116-5" data-line-number="5">``This is no longer a code span.&#39;&#39;</a>
+<a class="sourceLine" id="cb116-6" data-line-number="6"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb116-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb116-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionCodeSpans{false}</a>
+<a class="sourceLine" id="cb116-9" data-line-number="9"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb116-10" data-line-number="10">``This is a quote.&#39;&#39;</a>
+<a class="sourceLine" id="cb116-11" data-line-number="11">``This is another quote.&#39;&#39;</a>
+<a class="sourceLine" id="cb116-12" data-line-number="12"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb116-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb116-14" data-line-number="14"><span class="fu">\bye</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb117"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb117-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p><code>This is a code span.''</code>This is no longer a code span.''</p>
+<p><code>This is a code span.''</code>This is no longer a code span.’’</p>
<p>“This is a quote.” “This is another quote.”</p>
</blockquote>
-<h6 id="latex-example-7" class="unnumbered">LaTeX example</h6>
+<h5 id="latex-example-7" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-``This is a code span.&#39;&#39;
-``This is no longer a code span.&#39;&#39;
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{codeSpans=false}
-``This is a quote.&#39;&#39;
-``This is another quote.&#39;&#39;
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
+<div class="sourceCode" id="cb118"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb118-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb118-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb118-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb118-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb118-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb118-6" data-line-number="6">``This is a code span.&#39;&#39;</a>
+<a class="sourceLine" id="cb118-7" data-line-number="7">``This is no longer a code span.&#39;&#39;</a>
+<a class="sourceLine" id="cb118-8" data-line-number="8"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb118-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb118-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{codeSpans=false}</a>
+<a class="sourceLine" id="cb118-11" data-line-number="11">``This is a quote.&#39;&#39;</a>
+<a class="sourceLine" id="cb118-12" data-line-number="12">``This is another quote.&#39;&#39;</a>
+<a class="sourceLine" id="cb118-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb118-14" data-line-number="14"></a>
+<a class="sourceLine" id="cb118-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb119"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb119-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p><code>This is a code span.''</code>This is no longer a code span.''</p>
+<p><code>This is a code span.''</code>This is no longer a code span.’’</p>
<p>“This is a quote.” “This is another quote.”</p>
</blockquote>
-<h6 id="context-example-5" class="unnumbered">ConTeXt example</h6>
+<h5 id="context-example-5" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\starttext</span>
-
-<span class="fu">\startmarkdown</span>
-``This is a code span.&#39;&#39;
-``This is no longer a code span.&#39;&#39;
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\def</span>\markdownOptionCodeSpans{false}
-<span class="fu">\startmarkdown</span>
-``This is a quote.&#39;&#39;
-``This is another quote.&#39;&#39;
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\stoptext</span></code></pre></div>
+<div class="sourceCode" id="cb120"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb120-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb120-2" data-line-number="2"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb120-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb120-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb120-5" data-line-number="5">``This is a code span.&#39;&#39;</a>
+<a class="sourceLine" id="cb120-6" data-line-number="6">``This is no longer a code span.&#39;&#39;</a>
+<a class="sourceLine" id="cb120-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb120-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb120-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionCodeSpans{false}</a>
+<a class="sourceLine" id="cb120-10" data-line-number="10"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb120-11" data-line-number="11">``This is a quote.&#39;&#39;</a>
+<a class="sourceLine" id="cb120-12" data-line-number="12">``This is another quote.&#39;&#39;</a>
+<a class="sourceLine" id="cb120-13" data-line-number="13"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb120-14" data-line-number="14"></a>
+<a class="sourceLine" id="cb120-15" data-line-number="15"><span class="fu">\stoptext</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb121"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb121-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p><code>This is a code span.''</code>This is no longer a code span.''</p>
+<p><code>This is a code span.''</code>This is no longer a code span.’’</p>
<p>“This is a quote.” “This is another quote.”</p>
</blockquote>
-<h5 id="option-contentblocks"><span class="header-section-number">2.1.2.2.8</span> Option <code>contentBlocks</code></h5>
+<h4 id="option-contentblocks"><span class="header-section-number">2.2.1.9</span> Option <code>contentBlocks</code></h4>
<dl>
<dt><code>contentBlocks</code> (default value: <code>false</code>)</dt>
<dd><dl>
<dt>true</dt>
<dd><p>Enable the iA Writer content blocks syntax extension:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">http://example.com/minard.jpg (Napoleon&#39;s
- disastrous Russian campaign of 1812)
-/Flowchart.png &quot;Engineering Flowchart&quot;
-/Savings Account.csv &#39;Recent Transactions&#39;
-/Example.swift
-/Lorem Ipsum.txt</code></pre></div>
+<div class="sourceCode" id="cb122"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb122-1" data-line-number="1">http://example.com/minard.jpg (Napoleon&#39;s</a>
+<a class="sourceLine" id="cb122-2" data-line-number="2"> disastrous Russian campaign of 1812)</a>
+<a class="sourceLine" id="cb122-3" data-line-number="3">/Flowchart.png &quot;Engineering Flowchart&quot;</a>
+<a class="sourceLine" id="cb122-4" data-line-number="4">/Savings Account.csv &#39;Recent Transactions&#39;</a>
+<a class="sourceLine" id="cb122-5" data-line-number="5">/Example.swift</a>
+<a class="sourceLine" id="cb122-6" data-line-number="6">/Lorem Ipsum.txt</a></code></pre></div>
</dd>
</dl>
</dd>
@@ -1254,33 +1367,33 @@ The TeXbook [@knuth:tex, p. 123 and 130] was written by @knuth:tex.
</dl>
</dd>
</dl>
-<h6 id="latex-example-8" class="unnumbered">LaTeX example</h6>
+<h5 id="latex-example-8" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>table.csv</code> with the following content:</p>
<pre class="csv"><code>Name,Surname,Born
Albert,Einstein,1879
Marie,Curie,1867
Thomas,Edison,1847</code></pre>
<p>Create also a text document named <code>markdown-languages.json</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode js"><code class="sourceCode javascript"><span class="op">{</span>
- <span class="st">&quot;tex&quot;</span><span class="op">:</span> <span class="st">&quot;LaTeX&quot;</span>
-<span class="op">}</span></code></pre></div>
+<div class="sourceCode" id="cb124"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb124-1" data-line-number="1"><span class="op">{</span></a>
+<a class="sourceLine" id="cb124-2" data-line-number="2"> <span class="st">&quot;tex&quot;</span><span class="op">:</span> <span class="st">&quot;LaTeX&quot;</span></a>
+<a class="sourceLine" id="cb124-3" data-line-number="3"><span class="op">}</span></a></code></pre></div>
<p>Create also a text document named <code>code.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex">This is an example code listing in <span class="fu">\LaTeX</span>.</code></pre></div>
+<div class="sourceCode" id="cb125"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb125-1" data-line-number="1">This is an example code listing in <span class="fu">\LaTeX</span>.</a></code></pre></div>
<p>Create also a text document named <code>part.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">This is a *transcluded markdown document*.</code></pre></div>
+<div class="sourceCode" id="cb126"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb126-1" data-line-number="1">This is a *transcluded markdown document*.</a></code></pre></div>
<p>Create also a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">minted</span>}
-<span class="bu">\usepackage</span>[contentBlocks]{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-/table.csv (An example table)
-/code.tex (An example code listing)
-/part.md (A file transclusion example)
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
+<div class="sourceCode" id="cb127"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb127-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb127-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">minted</span>}</a>
+<a class="sourceLine" id="cb127-3" data-line-number="3"><span class="bu">\usepackage</span>[contentBlocks]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb127-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb127-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb127-6" data-line-number="6">/table.csv (An example table)</a>
+<a class="sourceLine" id="cb127-7" data-line-number="7">/code.tex (An example code listing)</a>
+<a class="sourceLine" id="cb127-8" data-line-number="8">/part.md (A file transclusion example)</a>
+<a class="sourceLine" id="cb127-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb127-10" data-line-number="10"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> --shell-escape document.tex</code></pre></div>
+<div class="sourceCode" id="cb128"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb128-1" data-line-number="1"><span class="ex">lualatex</span> --shell-escape document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<table>
@@ -1310,37 +1423,37 @@ Thomas,Edison,1847</code></pre>
</tbody>
</table>
<p>Table 1: An example table</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex">This is an example code listing in <span class="fu">\LaTeX</span>.</code></pre></div>
+<div class="sourceCode" id="cb129"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb129-1" data-line-number="1">This is an example code listing in <span class="fu">\LaTeX</span>.</a></code></pre></div>
<p>This is a <em>transcluded markdown document</em>.</p>
</blockquote>
-<h6 id="context-example-6" class="unnumbered">ConTeXt example</h6>
+<h5 id="context-example-6" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
<p>Using a text editor, create a text document named <code>table.csv</code> with the following content:</p>
<pre class="csv"><code>Name,Surname,Born
Albert,Einstein,1879
Marie,Curie,1867
Thomas,Edison,1847</code></pre>
<p>Create also a text document named <code>markdown-languages.json</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode js"><code class="sourceCode javascript"><span class="op">{</span>
- <span class="st">&quot;tex&quot;</span><span class="op">:</span> <span class="st">&quot;ConTeXt&quot;</span>
-<span class="op">}</span></code></pre></div>
+<div class="sourceCode" id="cb131"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb131-1" data-line-number="1"><span class="op">{</span></a>
+<a class="sourceLine" id="cb131-2" data-line-number="2"> <span class="st">&quot;tex&quot;</span><span class="op">:</span> <span class="st">&quot;ConTeXt&quot;</span></a>
+<a class="sourceLine" id="cb131-3" data-line-number="3"><span class="op">}</span></a></code></pre></div>
<p>Create also a text document named <code>code.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex">This is an example code listing in <span class="fu">\ConTeXt</span>.</code></pre></div>
+<div class="sourceCode" id="cb132"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb132-1" data-line-number="1">This is an example code listing in <span class="fu">\ConTeXt</span>.</a></code></pre></div>
<p>Create also a text document named <code>part.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">This is a *transcluded markdown document*.</code></pre></div>
+<div class="sourceCode" id="cb133"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb133-1" data-line-number="1">This is a *transcluded markdown document*.</a></code></pre></div>
<p>Create also a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\def</span>\markdownOptionContentBlocks{true}
-<span class="fu">\definetyping</span> [ConTeXt]
-<span class="fu">\setuptyping</span> [ConTeXt] [option=TEX]
-<span class="fu">\starttext</span>
-<span class="fu">\startmarkdown</span>
-/table.csv (An example table)
-/code.tex (An example code listing)
-/part.md (A file transclusion example)
-<span class="fu">\stopmarkdown</span>
-<span class="fu">\stoptext</span></code></pre></div>
+<div class="sourceCode" id="cb134"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb134-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb134-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionContentBlocks{true}</a>
+<a class="sourceLine" id="cb134-3" data-line-number="3"><span class="fu">\definetyping</span> [ConTeXt]</a>
+<a class="sourceLine" id="cb134-4" data-line-number="4"><span class="fu">\setuptyping</span> [ConTeXt] [option=TEX]</a>
+<a class="sourceLine" id="cb134-5" data-line-number="5"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb134-6" data-line-number="6"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb134-7" data-line-number="7">/table.csv (An example table)</a>
+<a class="sourceLine" id="cb134-8" data-line-number="8">/code.tex (An example code listing)</a>
+<a class="sourceLine" id="cb134-9" data-line-number="9">/part.md (A file transclusion example)</a>
+<a class="sourceLine" id="cb134-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb134-11" data-line-number="11"><span class="fu">\stoptext</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb135"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb135-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<table>
@@ -1370,45 +1483,45 @@ Thomas,Edison,1847</code></pre>
</tbody>
</table>
<p>Table 1: An example table</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex">This is an example code listing in <span class="fu">\ConTeXt</span>.</code></pre></div>
+<div class="sourceCode" id="cb136"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb136-1" data-line-number="1">This is an example code listing in <span class="fu">\ConTeXt</span>.</a></code></pre></div>
<p>This is a <em>transcluded markdown document</em>.</p>
</blockquote>
-<h5 id="option-contentblockslanguagemap"><span class="header-section-number">2.1.2.2.9</span> Option <code>contentBlocksLanguageMap</code></h5>
+<h4 id="option-contentblockslanguagemap"><span class="header-section-number">2.2.1.10</span> Option <code>contentBlocksLanguageMap</code></h4>
<dl>
<dt><code>contentBlocksLanguageMap</code> (default value: <code>&quot;markdown-languages.json&quot;</code>)</dt>
<dd><p>The filename of the JSON file that maps filename extensions to programming language names in the iA Writer content blocks.</p>
</dd>
</dl>
-<h6 id="latex-example-9" class="unnumbered">LaTeX example</h6>
+<h5 id="latex-example-9" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>table.csv</code> with the following content:</p>
<pre class="csv"><code>Name,Surname,Born
Albert,Einstein,1879
Marie,Curie,1867
Thomas,Edison,1847</code></pre>
<p>Create also a text document named <code>language-map.json</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode js"><code class="sourceCode javascript"><span class="op">{</span>
- <span class="st">&quot;tex&quot;</span><span class="op">:</span> <span class="st">&quot;LaTeX&quot;</span>
-<span class="op">}</span></code></pre></div>
+<div class="sourceCode" id="cb138"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb138-1" data-line-number="1"><span class="op">{</span></a>
+<a class="sourceLine" id="cb138-2" data-line-number="2"> <span class="st">&quot;tex&quot;</span><span class="op">:</span> <span class="st">&quot;LaTeX&quot;</span></a>
+<a class="sourceLine" id="cb138-3" data-line-number="3"><span class="op">}</span></a></code></pre></div>
<p>Create also a text document named <code>code.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex">This is an example code listing in <span class="fu">\LaTeX</span>.</code></pre></div>
+<div class="sourceCode" id="cb139"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb139-1" data-line-number="1">This is an example code listing in <span class="fu">\LaTeX</span>.</a></code></pre></div>
<p>Create also a text document named <code>part.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">This is a *transcluded markdown document*.</code></pre></div>
+<div class="sourceCode" id="cb140"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb140-1" data-line-number="1">This is a *transcluded markdown document*.</a></code></pre></div>
<p>Create also a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">minted</span>}
-<span class="bu">\usepackage</span>[contentBlocks]{<span class="ex">markdown</span>}
-<span class="fu">\markdownSetup</span>{
- contentBlocksLanguageMap = {language-map.json},
-}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-/table.csv (An example table)
-/code.tex (An example code listing)
-/part.md (A file transclusion example)
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
+<div class="sourceCode" id="cb141"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb141-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb141-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">minted</span>}</a>
+<a class="sourceLine" id="cb141-3" data-line-number="3"><span class="bu">\usepackage</span>[contentBlocks]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb141-4" data-line-number="4"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb141-5" data-line-number="5"> contentBlocksLanguageMap = {language-map.json},</a>
+<a class="sourceLine" id="cb141-6" data-line-number="6">}</a>
+<a class="sourceLine" id="cb141-7" data-line-number="7"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb141-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb141-9" data-line-number="9">/table.csv (An example table)</a>
+<a class="sourceLine" id="cb141-10" data-line-number="10">/code.tex (An example code listing)</a>
+<a class="sourceLine" id="cb141-11" data-line-number="11">/part.md (A file transclusion example)</a>
+<a class="sourceLine" id="cb141-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb141-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> --shell-escape document.tex</code></pre></div>
+<div class="sourceCode" id="cb142"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb142-1" data-line-number="1"><span class="ex">lualatex</span> --shell-escape document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<table>
@@ -1438,38 +1551,38 @@ Thomas,Edison,1847</code></pre>
</tbody>
</table>
<p>Table 1: An example table</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex">This is an example code listing in <span class="fu">\LaTeX</span>.</code></pre></div>
+<div class="sourceCode" id="cb143"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb143-1" data-line-number="1">This is an example code listing in <span class="fu">\LaTeX</span>.</a></code></pre></div>
<p>This is a <em>transcluded markdown document</em>.</p>
</blockquote>
-<h6 id="context-example-7" class="unnumbered">ConTeXt example</h6>
+<h5 id="context-example-7" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
<p>Using a text editor, create a text document named <code>table.csv</code> with the following content:</p>
<pre class="csv"><code>Name,Surname,Born
Albert,Einstein,1879
Marie,Curie,1867
Thomas,Edison,1847</code></pre>
<p>Create also a text document named <code>language-map.json</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode js"><code class="sourceCode javascript"><span class="op">{</span>
- <span class="st">&quot;tex&quot;</span><span class="op">:</span> <span class="st">&quot;ConTeXt&quot;</span>
-<span class="op">}</span></code></pre></div>
+<div class="sourceCode" id="cb145"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb145-1" data-line-number="1"><span class="op">{</span></a>
+<a class="sourceLine" id="cb145-2" data-line-number="2"> <span class="st">&quot;tex&quot;</span><span class="op">:</span> <span class="st">&quot;ConTeXt&quot;</span></a>
+<a class="sourceLine" id="cb145-3" data-line-number="3"><span class="op">}</span></a></code></pre></div>
<p>Create also a text document named <code>code.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex">This is an example code listing in <span class="fu">\ConTeXt</span>.</code></pre></div>
+<div class="sourceCode" id="cb146"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb146-1" data-line-number="1">This is an example code listing in <span class="fu">\ConTeXt</span>.</a></code></pre></div>
<p>Create also a text document named <code>part.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">This is a *transcluded markdown document*.</code></pre></div>
+<div class="sourceCode" id="cb147"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb147-1" data-line-number="1">This is a *transcluded markdown document*.</a></code></pre></div>
<p>Create also a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\def</span>\markdownOptionContentBlocks{true}
-<span class="fu">\def</span>\markdownOptionContentBlocksLanguageMap{language-map.json}
-<span class="fu">\definetyping</span> [ConTeXt]
-<span class="fu">\setuptyping</span> [ConTeXt] [option=TEX]
-<span class="fu">\starttext</span>
-<span class="fu">\startmarkdown</span>
-/table.csv (An example table)
-/code.tex (An example code listing)
-/part.md (A file transclusion example)
-<span class="fu">\stopmarkdown</span>
-<span class="fu">\stoptext</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb148"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb148-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb148-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionContentBlocks{true}</a>
+<a class="sourceLine" id="cb148-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionContentBlocksLanguageMap{language-map.json}</a>
+<a class="sourceLine" id="cb148-4" data-line-number="4"><span class="fu">\definetyping</span> [ConTeXt]</a>
+<a class="sourceLine" id="cb148-5" data-line-number="5"><span class="fu">\setuptyping</span> [ConTeXt] [option=TEX]</a>
+<a class="sourceLine" id="cb148-6" data-line-number="6"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb148-7" data-line-number="7"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb148-8" data-line-number="8">/table.csv (An example table)</a>
+<a class="sourceLine" id="cb148-9" data-line-number="9">/code.tex (An example code listing)</a>
+<a class="sourceLine" id="cb148-10" data-line-number="10">/part.md (A file transclusion example)</a>
+<a class="sourceLine" id="cb148-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb148-12" data-line-number="12"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb149"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb149-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<table>
@@ -1499,26 +1612,26 @@ Thomas,Edison,1847</code></pre>
</tbody>
</table>
<p>Table 1: An example table</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex">This is an example code listing in <span class="fu">\ConTeXt</span>.</code></pre></div>
+<div class="sourceCode" id="cb150"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb150-1" data-line-number="1">This is an example code listing in <span class="fu">\ConTeXt</span>.</a></code></pre></div>
<p>This is a <em>transcluded markdown document</em>.</p>
</blockquote>
-<h5 id="option-definitionlists"><span class="header-section-number">2.1.2.2.10</span> Option <code>definitionLists</code></h5>
+<h4 id="option-definitionlists"><span class="header-section-number">2.2.1.11</span> Option <code>definitionLists</code></h4>
<dl>
<dt><code>definitionLists</code> (default value: <code>false</code>)</dt>
<dd><dl>
<dt>true</dt>
<dd><p>Enable the pandoc definition list syntax extension:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">Term 1
-
-: Definition 1
-
-Term 2 with *inline markup*
-
-: Definition 2
-
-<span class="bn"> { some code, part of Definition 2 }</span>
-
-<span class="bn"> Third paragraph of definition 2.</span></code></pre></div>
+<div class="sourceCode" id="cb151"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb151-1" data-line-number="1">Term 1</a>
+<a class="sourceLine" id="cb151-2" data-line-number="2"></a>
+<a class="sourceLine" id="cb151-3" data-line-number="3">: Definition 1</a>
+<a class="sourceLine" id="cb151-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb151-5" data-line-number="5">Term 2 with *inline markup*</a>
+<a class="sourceLine" id="cb151-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb151-7" data-line-number="7">: Definition 2</a>
+<a class="sourceLine" id="cb151-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb151-9" data-line-number="9"><span class="bn"> { some code, part of Definition 2 }</span></a>
+<a class="sourceLine" id="cb151-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb151-11" data-line-number="11"><span class="bn"> Third paragraph of definition 2.</span></a></code></pre></div>
</dd>
</dl>
</dd>
@@ -1529,27 +1642,27 @@ Term 2 with *inline markup*
</dl>
</dd>
</dl>
-<h6 id="latex-example-10" class="unnumbered">LaTeX example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>[definitionLists]{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-Term 1
-
-: Definition 1
-
-Term 2 with *inline markup*
-
-: Definition 2
-
- { some code, part of Definition 2 }
-
- Third paragraph of definition 2.
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<h5 id="latex-example-10" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb152"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb152-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb152-2" data-line-number="2"><span class="bu">\usepackage</span>[definitionLists]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb152-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb152-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb152-5" data-line-number="5">Term 1</a>
+<a class="sourceLine" id="cb152-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb152-7" data-line-number="7">: Definition 1</a>
+<a class="sourceLine" id="cb152-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb152-9" data-line-number="9">Term 2 with *inline markup*</a>
+<a class="sourceLine" id="cb152-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb152-11" data-line-number="11">: Definition 2</a>
+<a class="sourceLine" id="cb152-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb152-13" data-line-number="13"> { some code, part of Definition 2 }</a>
+<a class="sourceLine" id="cb152-14" data-line-number="14"></a>
+<a class="sourceLine" id="cb152-15" data-line-number="15"> Third paragraph of definition 2.</a>
+<a class="sourceLine" id="cb152-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb152-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb153"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb153-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<dl>
@@ -1563,27 +1676,27 @@ Term 2 with *inline markup*
</dd>
</dl>
</blockquote>
-<h6 id="context-example-8" class="unnumbered">ConTeXt example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\def</span>\markdownOptionDefinitionLists{true}
-<span class="fu">\starttext</span>
-<span class="fu">\startmarkdown</span>
-Term 1
-
-: Definition 1
-
-Term 2 with *inline markup*
-
-: Definition 2
-
- { some code, part of Definition 2 }
-
- Third paragraph of definition 2.
-<span class="fu">\stopmarkdown</span>
-<span class="fu">\stoptext</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<h5 id="context-example-8" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb155"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb155-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb155-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionDefinitionLists{true}</a>
+<a class="sourceLine" id="cb155-3" data-line-number="3"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb155-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb155-5" data-line-number="5">Term 1</a>
+<a class="sourceLine" id="cb155-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb155-7" data-line-number="7">: Definition 1</a>
+<a class="sourceLine" id="cb155-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb155-9" data-line-number="9">Term 2 with *inline markup*</a>
+<a class="sourceLine" id="cb155-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb155-11" data-line-number="11">: Definition 2</a>
+<a class="sourceLine" id="cb155-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb155-13" data-line-number="13"> { some code, part of Definition 2 }</a>
+<a class="sourceLine" id="cb155-14" data-line-number="14"></a>
+<a class="sourceLine" id="cb155-15" data-line-number="15"> Third paragraph of definition 2.</a>
+<a class="sourceLine" id="cb155-16" data-line-number="16"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb155-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb156"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb156-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<dl>
@@ -1597,28 +1710,28 @@ Term 2 with *inline markup*
</dd>
</dl>
</blockquote>
-<h5 id="option-fencedcode"><span class="header-section-number">2.1.2.2.11</span> Option <code>fencedCode</code></h5>
+<h4 id="option-fencedcode"><span class="header-section-number">2.2.1.12</span> Option <code>fencedCode</code></h4>
<dl>
<dt><code>fencedCode</code> (default value: <code>false</code>)</dt>
<dd><dl>
<dt>true</dt>
<dd><p>Enable the commonmark fenced code block extension:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">~~~ js
-if (a &gt; 3) {
-<span class="bn"> moveShip(5 * gravity, DOWN);</span>
-}
-~~~~~~
-
- ``` html
- &lt;pre&gt;
-<span class="bn"> &lt;code&gt;</span>
-<span class="bn"> // Some comments</span>
-<span class="bn"> line 1 of code</span>
-<span class="bn"> line 2 of code</span>
-<span class="bn"> line 3 of code</span>
-<span class="bn"> &lt;/code&gt;</span>
- &lt;/pre&gt;
- ```</code></pre></div>
+<div class="sourceCode" id="cb158"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb158-1" data-line-number="1">~~~ js</a>
+<a class="sourceLine" id="cb158-2" data-line-number="2">if (a &gt; 3) {</a>
+<a class="sourceLine" id="cb158-3" data-line-number="3"><span class="bn"> moveShip(5 * gravity, DOWN);</span></a>
+<a class="sourceLine" id="cb158-4" data-line-number="4">}</a>
+<a class="sourceLine" id="cb158-5" data-line-number="5">~~~~~~</a>
+<a class="sourceLine" id="cb158-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb158-7" data-line-number="7"> ``` html</a>
+<a class="sourceLine" id="cb158-8" data-line-number="8"> &lt;pre&gt;</a>
+<a class="sourceLine" id="cb158-9" data-line-number="9"><span class="bn"> &lt;code&gt;</span></a>
+<a class="sourceLine" id="cb158-10" data-line-number="10"><span class="bn"> // Some comments</span></a>
+<a class="sourceLine" id="cb158-11" data-line-number="11"><span class="bn"> line 1 of code</span></a>
+<a class="sourceLine" id="cb158-12" data-line-number="12"><span class="bn"> line 2 of code</span></a>
+<a class="sourceLine" id="cb158-13" data-line-number="13"><span class="bn"> line 3 of code</span></a>
+<a class="sourceLine" id="cb158-14" data-line-number="14"><span class="bn"> &lt;/code&gt;</span></a>
+<a class="sourceLine" id="cb158-15" data-line-number="15"> &lt;/pre&gt;</a>
+<a class="sourceLine" id="cb158-16" data-line-number="16"> ```</a></code></pre></div>
</dd>
</dl>
</dd>
@@ -1629,113 +1742,113 @@ if (a &gt; 3) {
</dl>
</dd>
</dl>
-<h6 id="latex-example-11" class="unnumbered">LaTeX example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">minted</span>}
-<span class="bu">\usepackage</span>[fencedCode]{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-~~~ js
-if (a &gt; 3) {
- moveShip(5 * gravity, DOWN);
-}
-~~~~~~
-
- ``` html
- &lt;pre&gt;
- &lt;code&gt;
- // Some comments
- line 1 of code
- line 2 of code
- line 3 of code
- &lt;/code&gt;
- &lt;/pre&gt;
- ```
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> --shell-escape document.tex</code></pre></div>
-<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
-<blockquote>
-<div class="sourceCode"><pre class="sourceCode js"><code class="sourceCode javascript"><span class="cf">if</span> (a <span class="op">&gt;</span> <span class="dv">3</span>) <span class="op">{</span>
- <span class="at">moveShip</span>(<span class="dv">5</span> <span class="op">*</span> gravity<span class="op">,</span> DOWN)<span class="op">;</span>
-<span class="op">}</span></code></pre></div>
-<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;pre&gt;</span>
- <span class="kw">&lt;code&gt;</span>
- // Some comments
- line 1 of code
- line 2 of code
- line 3 of code
- <span class="kw">&lt;/code&gt;</span>
-<span class="kw">&lt;/pre&gt;</span></code></pre></div>
-</blockquote>
-<h6 id="context-example-9" class="unnumbered">ConTeXt example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\def</span>\markdownOptionFencedCode{true}
-<span class="fu">\definetyping</span> [js]
-<span class="fu">\definetyping</span> [html]
-<span class="fu">\setuptyping</span> [html] [option=XML]
-<span class="fu">\starttext</span>
-<span class="fu">\startmarkdown</span>
-~~~ js
-if (a &gt; 3) {
- moveShip(5 * gravity, DOWN);
-}
-~~~~~~
-
- ``` html
- &lt;pre&gt;
- &lt;code&gt;
- // Some comments
- line 1 of code
- line 2 of code
- line 3 of code
- &lt;/code&gt;
- &lt;/pre&gt;
- ```
-<span class="fu">\stopmarkdown</span>
-<span class="fu">\stoptext</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
-<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
-<blockquote>
-<div class="sourceCode"><pre class="sourceCode js"><code class="sourceCode javascript"><span class="cf">if</span> (a <span class="op">&gt;</span> <span class="dv">3</span>) <span class="op">{</span>
- <span class="at">moveShip</span>(<span class="dv">5</span> <span class="op">*</span> gravity<span class="op">,</span> DOWN)<span class="op">;</span>
-<span class="op">}</span></code></pre></div>
-<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;pre&gt;</span>
- <span class="kw">&lt;code&gt;</span>
- // Some comments
- line 1 of code
- line 2 of code
- line 3 of code
- <span class="kw">&lt;/code&gt;</span>
-<span class="kw">&lt;/pre&gt;</span></code></pre></div>
-</blockquote>
-<h5 id="option-footnotes"><span class="header-section-number">2.1.2.2.12</span> Option <code>footnotes</code></h5>
+<h5 id="latex-example-11" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb159"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb159-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb159-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">minted</span>}</a>
+<a class="sourceLine" id="cb159-3" data-line-number="3"><span class="bu">\usepackage</span>[fencedCode]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb159-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb159-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb159-6" data-line-number="6">~~~ js</a>
+<a class="sourceLine" id="cb159-7" data-line-number="7">if (a &gt; 3) {</a>
+<a class="sourceLine" id="cb159-8" data-line-number="8"> moveShip(5 * gravity, DOWN);</a>
+<a class="sourceLine" id="cb159-9" data-line-number="9">}</a>
+<a class="sourceLine" id="cb159-10" data-line-number="10">~~~~~~</a>
+<a class="sourceLine" id="cb159-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb159-12" data-line-number="12"> ``` html</a>
+<a class="sourceLine" id="cb159-13" data-line-number="13"> &lt;pre&gt;</a>
+<a class="sourceLine" id="cb159-14" data-line-number="14"> &lt;code&gt;</a>
+<a class="sourceLine" id="cb159-15" data-line-number="15"> // Some comments</a>
+<a class="sourceLine" id="cb159-16" data-line-number="16"> line 1 of code</a>
+<a class="sourceLine" id="cb159-17" data-line-number="17"> line 2 of code</a>
+<a class="sourceLine" id="cb159-18" data-line-number="18"> line 3 of code</a>
+<a class="sourceLine" id="cb159-19" data-line-number="19"> &lt;/code&gt;</a>
+<a class="sourceLine" id="cb159-20" data-line-number="20"> &lt;/pre&gt;</a>
+<a class="sourceLine" id="cb159-21" data-line-number="21"> ```</a>
+<a class="sourceLine" id="cb159-22" data-line-number="22"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb159-23" data-line-number="23"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb160"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb160-1" data-line-number="1"><span class="ex">lualatex</span> --shell-escape document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<div class="sourceCode" id="cb161"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb161-1" data-line-number="1"><span class="cf">if</span> (a <span class="op">&gt;</span> <span class="dv">3</span>) <span class="op">{</span></a>
+<a class="sourceLine" id="cb161-2" data-line-number="2"> <span class="at">moveShip</span>(<span class="dv">5</span> <span class="op">*</span> gravity<span class="op">,</span> DOWN)<span class="op">;</span></a>
+<a class="sourceLine" id="cb161-3" data-line-number="3"><span class="op">}</span></a></code></pre></div>
+<div class="sourceCode" id="cb162"><pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb162-1" data-line-number="1"><span class="kw">&lt;pre&gt;</span></a>
+<a class="sourceLine" id="cb162-2" data-line-number="2"> <span class="kw">&lt;code&gt;</span></a>
+<a class="sourceLine" id="cb162-3" data-line-number="3"> // Some comments</a>
+<a class="sourceLine" id="cb162-4" data-line-number="4"> line 1 of code</a>
+<a class="sourceLine" id="cb162-5" data-line-number="5"> line 2 of code</a>
+<a class="sourceLine" id="cb162-6" data-line-number="6"> line 3 of code</a>
+<a class="sourceLine" id="cb162-7" data-line-number="7"> <span class="kw">&lt;/code&gt;</span></a>
+<a class="sourceLine" id="cb162-8" data-line-number="8"><span class="kw">&lt;/pre&gt;</span></a></code></pre></div>
+</blockquote>
+<h5 id="context-example-9" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb163"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb163-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb163-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFencedCode{true}</a>
+<a class="sourceLine" id="cb163-3" data-line-number="3"><span class="fu">\definetyping</span> [js]</a>
+<a class="sourceLine" id="cb163-4" data-line-number="4"><span class="fu">\definetyping</span> [html]</a>
+<a class="sourceLine" id="cb163-5" data-line-number="5"><span class="fu">\setuptyping</span> [html] [option=XML]</a>
+<a class="sourceLine" id="cb163-6" data-line-number="6"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb163-7" data-line-number="7"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb163-8" data-line-number="8">~~~ js</a>
+<a class="sourceLine" id="cb163-9" data-line-number="9">if (a &gt; 3) {</a>
+<a class="sourceLine" id="cb163-10" data-line-number="10"> moveShip(5 * gravity, DOWN);</a>
+<a class="sourceLine" id="cb163-11" data-line-number="11">}</a>
+<a class="sourceLine" id="cb163-12" data-line-number="12">~~~~~~</a>
+<a class="sourceLine" id="cb163-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb163-14" data-line-number="14"> ``` html</a>
+<a class="sourceLine" id="cb163-15" data-line-number="15"> &lt;pre&gt;</a>
+<a class="sourceLine" id="cb163-16" data-line-number="16"> &lt;code&gt;</a>
+<a class="sourceLine" id="cb163-17" data-line-number="17"> // Some comments</a>
+<a class="sourceLine" id="cb163-18" data-line-number="18"> line 1 of code</a>
+<a class="sourceLine" id="cb163-19" data-line-number="19"> line 2 of code</a>
+<a class="sourceLine" id="cb163-20" data-line-number="20"> line 3 of code</a>
+<a class="sourceLine" id="cb163-21" data-line-number="21"> &lt;/code&gt;</a>
+<a class="sourceLine" id="cb163-22" data-line-number="22"> &lt;/pre&gt;</a>
+<a class="sourceLine" id="cb163-23" data-line-number="23"> ```</a>
+<a class="sourceLine" id="cb163-24" data-line-number="24"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb163-25" data-line-number="25"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb164"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb164-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<div class="sourceCode" id="cb165"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb165-1" data-line-number="1"><span class="cf">if</span> (a <span class="op">&gt;</span> <span class="dv">3</span>) <span class="op">{</span></a>
+<a class="sourceLine" id="cb165-2" data-line-number="2"> <span class="at">moveShip</span>(<span class="dv">5</span> <span class="op">*</span> gravity<span class="op">,</span> DOWN)<span class="op">;</span></a>
+<a class="sourceLine" id="cb165-3" data-line-number="3"><span class="op">}</span></a></code></pre></div>
+<div class="sourceCode" id="cb166"><pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb166-1" data-line-number="1"><span class="kw">&lt;pre&gt;</span></a>
+<a class="sourceLine" id="cb166-2" data-line-number="2"> <span class="kw">&lt;code&gt;</span></a>
+<a class="sourceLine" id="cb166-3" data-line-number="3"> // Some comments</a>
+<a class="sourceLine" id="cb166-4" data-line-number="4"> line 1 of code</a>
+<a class="sourceLine" id="cb166-5" data-line-number="5"> line 2 of code</a>
+<a class="sourceLine" id="cb166-6" data-line-number="6"> line 3 of code</a>
+<a class="sourceLine" id="cb166-7" data-line-number="7"> <span class="kw">&lt;/code&gt;</span></a>
+<a class="sourceLine" id="cb166-8" data-line-number="8"><span class="kw">&lt;/pre&gt;</span></a></code></pre></div>
+</blockquote>
+<h4 id="option-footnotes"><span class="header-section-number">2.2.1.13</span> Option <code>footnotes</code></h4>
<dl>
<dt><code>footnotes</code> (default value: <code>false</code>)</dt>
<dd><dl>
<dt>true</dt>
<dd><p>Enable the pandoc footnote syntax extension:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">Here is a footnote reference,<span class="ot">[^1]</span> and another.<span class="ot">[^longnote]</span>
-
-<span class="ot">[^1]</span>: Here is the footnote.
-
-<span class="ot">[^longnote]</span>: Here&#39;s one with multiple blocks.
-
-<span class="bn"> Subsequent paragraphs are indented to show that they</span>
-belong to the previous footnote.
-
-<span class="bn"> { some.code }</span>
-
-<span class="bn"> The whole paragraph can be indented, or just the</span>
-<span class="bn"> first line. In this way, multi-paragraph footnotes</span>
-<span class="bn"> work like multi-paragraph list items.</span>
-
-This paragraph won&#39;t be part of the note, because it
-isn&#39;t indented.</code></pre></div>
+<div class="sourceCode" id="cb167"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb167-1" data-line-number="1">Here is a footnote reference,<span class="ot">[^1]</span> and another.<span class="ot">[^longnote]</span></a>
+<a class="sourceLine" id="cb167-2" data-line-number="2"></a>
+<a class="sourceLine" id="cb167-3" data-line-number="3"><span class="ot">[^1]</span>: Here is the footnote.</a>
+<a class="sourceLine" id="cb167-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb167-5" data-line-number="5"><span class="ot">[^longnote]</span>: Here&#39;s one with multiple blocks.</a>
+<a class="sourceLine" id="cb167-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb167-7" data-line-number="7"><span class="bn"> Subsequent paragraphs are indented to show that they</span></a>
+<a class="sourceLine" id="cb167-8" data-line-number="8">belong to the previous footnote.</a>
+<a class="sourceLine" id="cb167-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb167-10" data-line-number="10"><span class="bn"> { some.code }</span></a>
+<a class="sourceLine" id="cb167-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb167-12" data-line-number="12"><span class="bn"> The whole paragraph can be indented, or just the</span></a>
+<a class="sourceLine" id="cb167-13" data-line-number="13"><span class="bn"> first line. In this way, multi-paragraph footnotes</span></a>
+<a class="sourceLine" id="cb167-14" data-line-number="14"><span class="bn"> work like multi-paragraph list items.</span></a>
+<a class="sourceLine" id="cb167-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb167-16" data-line-number="16">This paragraph won&#39;t be part of the note, because it</a>
+<a class="sourceLine" id="cb167-17" data-line-number="17">isn&#39;t indented.</a></code></pre></div>
</dd>
</dl>
</dd>
@@ -1746,79 +1859,79 @@ isn&#39;t indented.</code></pre></div>
</dl>
</dd>
</dl>
-<h6 id="latex-example-12" class="unnumbered">LaTeX example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>[footnotes]{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-Here is a footnote reference,[^1] and another.[^longnote]
-
-[^1]: Here is the footnote.
-
-[^longnote]: Here&#39;s one with multiple blocks.
-
- Subsequent paragraphs are indented to show that they
-belong to the previous footnote.
-
- { some.code }
-
- The whole paragraph can be indented, or just the
- first line. In this way, multi-paragraph footnotes
- work like multi-paragraph list items.
-
-This paragraph won&#39;t be part of the note, because it
-isn&#39;t indented.
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
-<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
-<blockquote>
-<p>Here is a footnote reference,<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a> and another.<a href="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a></p>
-<p>This paragraph won't be part of the note, because it isn't indented.</p>
-</blockquote>
-<h6 id="context-example-10" class="unnumbered">ConTeXt example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\def</span>\markdownOptionFootnotes{true}
-<span class="fu">\starttext</span>
-<span class="fu">\startmarkdown</span>
-Here is a footnote reference,[^1] and another.[^longnote]
-
-[^1]: Here is the footnote.
-
-[^longnote]: Here&#39;s one with multiple blocks.
-
- Subsequent paragraphs are indented to show that they
-belong to the previous footnote.
-
- { some.code }
-
- The whole paragraph can be indented, or just the
- first line. In this way, multi-paragraph footnotes
- work like multi-paragraph list items.
-
-This paragraph won&#39;t be part of the note, because it
-isn&#39;t indented.
-<span class="fu">\stopmarkdown</span>
-<span class="fu">\stoptext</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
-<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
-<blockquote>
-<p>Here is a footnote reference,<a href="#fn3" class="footnoteRef" id="fnref3"><sup>3</sup></a> and another.<a href="#fn4" class="footnoteRef" id="fnref4"><sup>4</sup></a></p>
-<p>This paragraph won't be part of the note, because it isn't indented.</p>
-</blockquote>
-<h5 id="option-hashenumerators"><span class="header-section-number">2.1.2.2.13</span> Option <code>hashEnumerators</code></h5>
+<h5 id="latex-example-12" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb168"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb168-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb168-2" data-line-number="2"><span class="bu">\usepackage</span>[footnotes]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb168-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb168-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb168-5" data-line-number="5">Here is a footnote reference,[^1] and another.[^longnote]</a>
+<a class="sourceLine" id="cb168-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb168-7" data-line-number="7">[^1]: Here is the footnote.</a>
+<a class="sourceLine" id="cb168-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb168-9" data-line-number="9">[^longnote]: Here&#39;s one with multiple blocks.</a>
+<a class="sourceLine" id="cb168-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb168-11" data-line-number="11"> Subsequent paragraphs are indented to show that they</a>
+<a class="sourceLine" id="cb168-12" data-line-number="12">belong to the previous footnote.</a>
+<a class="sourceLine" id="cb168-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb168-14" data-line-number="14"> { some.code }</a>
+<a class="sourceLine" id="cb168-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb168-16" data-line-number="16"> The whole paragraph can be indented, or just the</a>
+<a class="sourceLine" id="cb168-17" data-line-number="17"> first line. In this way, multi-paragraph footnotes</a>
+<a class="sourceLine" id="cb168-18" data-line-number="18"> work like multi-paragraph list items.</a>
+<a class="sourceLine" id="cb168-19" data-line-number="19"></a>
+<a class="sourceLine" id="cb168-20" data-line-number="20">This paragraph won&#39;t be part of the note, because it</a>
+<a class="sourceLine" id="cb168-21" data-line-number="21">isn&#39;t indented.</a>
+<a class="sourceLine" id="cb168-22" data-line-number="22"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb168-23" data-line-number="23"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb169"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb169-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Here is a footnote reference,<a href="#fn1" class="footnote-ref" id="fnref1"><sup>1</sup></a> and another.<a href="#fn2" class="footnote-ref" id="fnref2"><sup>2</sup></a></p>
+<p>This paragraph won’t be part of the note, because it isn’t indented.</p>
+</blockquote>
+<h5 id="context-example-10" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb171"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb171-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb171-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFootnotes{true}</a>
+<a class="sourceLine" id="cb171-3" data-line-number="3"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb171-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb171-5" data-line-number="5">Here is a footnote reference,[^1] and another.[^longnote]</a>
+<a class="sourceLine" id="cb171-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb171-7" data-line-number="7">[^1]: Here is the footnote.</a>
+<a class="sourceLine" id="cb171-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb171-9" data-line-number="9">[^longnote]: Here&#39;s one with multiple blocks.</a>
+<a class="sourceLine" id="cb171-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb171-11" data-line-number="11"> Subsequent paragraphs are indented to show that they</a>
+<a class="sourceLine" id="cb171-12" data-line-number="12">belong to the previous footnote.</a>
+<a class="sourceLine" id="cb171-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb171-14" data-line-number="14"> { some.code }</a>
+<a class="sourceLine" id="cb171-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb171-16" data-line-number="16"> The whole paragraph can be indented, or just the</a>
+<a class="sourceLine" id="cb171-17" data-line-number="17"> first line. In this way, multi-paragraph footnotes</a>
+<a class="sourceLine" id="cb171-18" data-line-number="18"> work like multi-paragraph list items.</a>
+<a class="sourceLine" id="cb171-19" data-line-number="19"></a>
+<a class="sourceLine" id="cb171-20" data-line-number="20">This paragraph won&#39;t be part of the note, because it</a>
+<a class="sourceLine" id="cb171-21" data-line-number="21">isn&#39;t indented.</a>
+<a class="sourceLine" id="cb171-22" data-line-number="22"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb171-23" data-line-number="23"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb172"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb172-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Here is a footnote reference,<a href="#fn3" class="footnote-ref" id="fnref3"><sup>3</sup></a> and another.<a href="#fn4" class="footnote-ref" id="fnref4"><sup>4</sup></a></p>
+<p>This paragraph won’t be part of the note, because it isn’t indented.</p>
+</blockquote>
+<h4 id="option-hashenumerators"><span class="header-section-number">2.2.1.14</span> Option <code>hashEnumerators</code></h4>
<dl>
<dt><code>hashEnumerators</code> (default value: <code>false</code>)</dt>
<dd><dl>
<dt>true</dt>
<dd><p>Enable the use of hash symbols (<code>#</code>) as ordered item list markers:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">#. Bird
-#. McHale
-#. Parish</code></pre></div>
+<div class="sourceCode" id="cb174"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb174-1" data-line-number="1">#. Bird</a>
+<a class="sourceLine" id="cb174-2" data-line-number="2">#. McHale</a>
+<a class="sourceLine" id="cb174-3" data-line-number="3">#. Parish</a></code></pre></div>
</dd>
</dl>
</dd>
@@ -1829,27 +1942,27 @@ isn&#39;t indented.
</dl>
</dd>
</dl>
-<h6 id="latex-example-13" class="unnumbered">LaTeX example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-#. Bird
-#. McHale
-#. Parish
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{hashEnumerators}
-#. Bird
-#. McHale
-#. Parish
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<h5 id="latex-example-13" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb175"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb175-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb175-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb175-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb175-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb175-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb175-6" data-line-number="6">. Bird</a>
+<a class="sourceLine" id="cb175-7" data-line-number="7">. McHale</a>
+<a class="sourceLine" id="cb175-8" data-line-number="8">. Parish</a>
+<a class="sourceLine" id="cb175-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb175-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb175-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{hashEnumerators}</a>
+<a class="sourceLine" id="cb175-12" data-line-number="12">. Bird</a>
+<a class="sourceLine" id="cb175-13" data-line-number="13">. McHale</a>
+<a class="sourceLine" id="cb175-14" data-line-number="14">. Parish</a>
+<a class="sourceLine" id="cb175-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb175-16" data-line-number="16"></a>
+<a class="sourceLine" id="cb175-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb176"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb176-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<h1 id="bird">. Bird</h1>
@@ -1861,27 +1974,27 @@ isn&#39;t indented.
<li>Parish</li>
</ol>
</blockquote>
-<h6 id="context-example-11" class="unnumbered">ConTeXt example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\starttext</span>
-
-<span class="fu">\startmarkdown</span>
-#. Bird
-#. McHale
-#. Parish
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\def</span>\markdownOptionHashEnumerators{true}
-<span class="fu">\startmarkdown</span>
-#. Bird
-#. McHale
-#. Parish
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\stoptext</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<h5 id="context-example-11" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb177"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb177-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb177-2" data-line-number="2"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb177-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb177-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb177-5" data-line-number="5">. Bird</a>
+<a class="sourceLine" id="cb177-6" data-line-number="6">. McHale</a>
+<a class="sourceLine" id="cb177-7" data-line-number="7">. Parish</a>
+<a class="sourceLine" id="cb177-8" data-line-number="8"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb177-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb177-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionHashEnumerators{true}</a>
+<a class="sourceLine" id="cb177-11" data-line-number="11"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb177-12" data-line-number="12">. Bird</a>
+<a class="sourceLine" id="cb177-13" data-line-number="13">. McHale</a>
+<a class="sourceLine" id="cb177-14" data-line-number="14">. Parish</a>
+<a class="sourceLine" id="cb177-15" data-line-number="15"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb177-16" data-line-number="16"></a>
+<a class="sourceLine" id="cb177-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb178"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb178-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<h1 id="bird-1">. Bird</h1>
@@ -1893,7 +2006,30 @@ isn&#39;t indented.
<li>Parish</li>
</ol>
</blockquote>
-<h5 id="option-html"><span class="header-section-number">2.1.2.2.14</span> Option <code>html</code></h5>
+<h4 id="header-attributes"><span class="header-section-number">2.2.1.15</span> Option <code>headerAttributes</code></h4>
+<dl>
+<dt><code>headerAttributes</code> (default value: <code>false</code>)</dt>
+<dd><dl>
+<dt>true</dt>
+<dd><p>Enable the assignment of HTML attributes to headings:</p>
+<div class="sourceCode" id="cb179"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb179-1" data-line-number="1"><span class="fu"># My first heading {#foo}</span></a>
+<a class="sourceLine" id="cb179-2" data-line-number="2"></a>
+<a class="sourceLine" id="cb179-3" data-line-number="3"><span class="fu">## My second heading ## {#bar .baz}</span></a>
+<a class="sourceLine" id="cb179-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb179-5" data-line-number="5">Yet another heading {key=value}</a>
+<a class="sourceLine" id="cb179-6" data-line-number="6">===================</a></code></pre></div>
+<p>These HTML attributes have currently no effect other than enabling <a href="#slice">content slicing</a>.</p>
+</dd>
+</dl>
+</dd>
+<dd><dl>
+<dt>false</dt>
+<dd><p>Disable the assignment of HTML attributes to headings.</p>
+</dd>
+</dl>
+</dd>
+</dl>
+<h4 id="option-html"><span class="header-section-number">2.2.1.16</span> Option <code>html</code></h4>
<dl>
<dt><code>html</code> (default value: <code>false</code>)</dt>
<dd><dl>
@@ -1910,273 +2046,296 @@ isn&#39;t indented.
</dd>
</dl>
<p>When the option is enabled, HTML entities are currently incorrectly parsed. See <a href="https://github.com/Witiko/markdown/issues/38" title="Tabs are stripped even with the `preserveTabs=true` Lua option enabled">the corresponding issue</a> in the package repository.</p>
-<h6 id="lua-module-example-6" class="unnumbered">Lua module example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local convert = markdown.new()
- local newline = [[^^J^^J]]
- local input =
- &quot;&lt;div&gt;*There is no block tag support.*&lt;/div&gt;&quot; .. newline ..
- &quot;*There is no &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*&quot; .. newline ..
- &quot;_There is no &lt;!-- comment --&gt; support._&quot; .. newline ..
- &quot;_There is no &lt;? HTML instruction ?&gt; support._&quot;
- tex.sprint(convert(input)) }
-<span class="fu">\par</span>
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local convert = markdown.new({html = true})
- local input =
- &quot;&lt;div&gt;*There is block tag support.*&lt;/div&gt;&quot; .. newline ..
- &quot;*There is &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*&quot; .. newline ..
- &quot;_There is &lt;!-- comment --&gt; support._&quot; .. newline ..
- &quot;_There is &lt;? HTML instruction ?&gt; support._&quot;
- tex.sprint(convert(input)) }
-<span class="fu">\bye</span></code></pre></div>
+<h5 id="lua-module-example-6" class="unnumbered">Lua Module Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb180"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb180-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb180-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb180-3" data-line-number="3"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb180-4" data-line-number="4"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb180-5" data-line-number="5"> local convert = markdown.new()</a>
+<a class="sourceLine" id="cb180-6" data-line-number="6"> local newline = [[^^J^^J]]</a>
+<a class="sourceLine" id="cb180-7" data-line-number="7"> local input =</a>
+<a class="sourceLine" id="cb180-8" data-line-number="8"> &quot;&lt;div&gt;*There is no block tag support.*&lt;/div&gt;&quot; .. newline ..</a>
+<a class="sourceLine" id="cb180-9" data-line-number="9"> &quot;*There is no &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*&quot; .. newline ..</a>
+<a class="sourceLine" id="cb180-10" data-line-number="10"> &quot;_There is no &lt;!-- comment --&gt; support._&quot; .. newline ..</a>
+<a class="sourceLine" id="cb180-11" data-line-number="11"> &quot;_There is no &lt;? HTML instruction ?&gt; support._&quot;</a>
+<a class="sourceLine" id="cb180-12" data-line-number="12"> tex.sprint(convert(input)) }</a>
+<a class="sourceLine" id="cb180-13" data-line-number="13"><span class="fu">\par</span></a>
+<a class="sourceLine" id="cb180-14" data-line-number="14"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb180-15" data-line-number="15"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb180-16" data-line-number="16"> local convert = markdown.new({html = true})</a>
+<a class="sourceLine" id="cb180-17" data-line-number="17"> local input =</a>
+<a class="sourceLine" id="cb180-18" data-line-number="18"> &quot;&lt;div&gt;*There is block tag support.*&lt;/div&gt;&quot; .. newline ..</a>
+<a class="sourceLine" id="cb180-19" data-line-number="19"> &quot;*There is &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*&quot; .. newline ..</a>
+<a class="sourceLine" id="cb180-20" data-line-number="20"> &quot;_There is &lt;!-- comment --&gt; support._&quot; .. newline ..</a>
+<a class="sourceLine" id="cb180-21" data-line-number="21"> &quot;_There is &lt;? HTML instruction ?&gt; support._&quot;</a>
+<a class="sourceLine" id="cb180-22" data-line-number="22"> tex.sprint(convert(input)) }</a>
+<a class="sourceLine" id="cb180-23" data-line-number="23"><span class="fu">\bye</span></a></code></pre></div>
<p>Then, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb181"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb181-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>&lt;div&gt;There is no block tag support.&lt;/div&gt; There is no &lt;inline tag=”tag”&gt;&lt;/inline&gt; support. There is no &lt;!-- comment --&gt; support. There is no &lt;? HTML instruction ?&gt; support.</p>
+<p>&lt;div&gt;There is no block tag support.&lt;/div&gt; There is no &lt;inline tag=”tag”&gt;&lt;/inline&gt; support. There is no &lt;!– comment –&gt; support. There is no &lt;? HTML instruction ?&gt; support.</p>
<p>There is support. There is support. There is support.</p>
</blockquote>
-<h6 id="lua-cli-example-6" class="unnumbered">Lua CLI example</h6>
+<h5 id="lua-cli-example-6" class="unnumbered">Lua CLI Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\input</span> optionfalse
-<span class="fu">\par</span>
-<span class="fu">\input</span> optiontrue
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb182"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb182-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb182-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb182-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a>
+<a class="sourceLine" id="cb182-4" data-line-number="4"><span class="fu">\par</span></a>
+<a class="sourceLine" id="cb182-5" data-line-number="5"><span class="fu">\input</span> optiontrue</a>
+<a class="sourceLine" id="cb182-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div>
<p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode html"><code class="sourceCode html"><span class="kw">&lt;div&gt;</span>
-*Is there block tag support?*
-<span class="kw">&lt;/div&gt;</span>
-*Is there <span class="kw">&lt;inline</span><span class="ot"> tag=</span><span class="st">&quot;tag&quot;</span><span class="kw">&gt;&lt;/inline&gt;</span> support?*
-_Is there <span class="co">&lt;!-- comment --&gt;</span> support?_
-_Is there <span class="kw">&lt;?</span> HTML instruction <span class="kw">?&gt;</span> support?_</code></pre></div>
+<div class="sourceCode" id="cb183"><pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb183-1" data-line-number="1"><span class="kw">&lt;div&gt;</span></a>
+<a class="sourceLine" id="cb183-2" data-line-number="2">*Is there block tag support?*</a>
+<a class="sourceLine" id="cb183-3" data-line-number="3"><span class="kw">&lt;/div&gt;</span></a>
+<a class="sourceLine" id="cb183-4" data-line-number="4">*Is there <span class="kw">&lt;inline</span><span class="ot"> tag=</span><span class="st">&quot;tag&quot;</span><span class="kw">&gt;&lt;/inline&gt;</span> support?*</a>
+<a class="sourceLine" id="cb183-5" data-line-number="5">_Is there <span class="co">&lt;!-- comment --&gt;</span> support?_</a>
+<a class="sourceLine" id="cb183-6" data-line-number="6">_Is there <span class="kw">&lt;?</span> HTML instruction <span class="kw">?&gt;</span> support?_</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> -- content.md optionfalse.tex
-<span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> html=true -- content.md optiontrue.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
-<p>where <code>&lt;CLI␣PATHNAME&gt;</code> corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\&lt;YOUR␣USERNAME&gt;\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
+<div class="sourceCode" id="cb184"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb184-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a>
+<a class="sourceLine" id="cb184-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ html=true -- content.md optiontrue.tex</a>
+<a class="sourceLine" id="cb184-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>&lt;div&gt;Is there block tag support?&lt;/div&gt; Is there &lt;inline tag=”tag”&gt;&lt;/inline&gt; support? Is there &lt;!-- comment --&gt; support? Is there &lt;? HTML instruction ?&gt; support?</p>
+<p>&lt;div&gt;Is there block tag support?&lt;/div&gt; Is there &lt;inline tag=”tag”&gt;&lt;/inline&gt; support? Is there &lt;!– comment –&gt; support? Is there &lt;? HTML instruction ?&gt; support?</p>
<p>Is there support? Is there support? Is there support?</p>
</blockquote>
-<h6 id="plain-tex-example-6" class="unnumbered">Plain TeX example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-
-<span class="fu">\markdownBegin</span>
-&lt;div&gt;
-*There is no block tag support.*
-&lt;/div&gt;
-*There is no &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*
-_There is no &lt;!-- comment --&gt; support._
-_There is no &lt;? HTML instruction ?&gt; support._
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\def</span>\markdownOptionHtml{true}
-<span class="fu">\markdownBegin</span>
-&lt;div&gt;
-*There is block tag support.*
-&lt;/div&gt;
-*There is &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*
-_There is &lt;!-- comment --&gt; support._
-_There is &lt;? HTML instruction ?&gt; support._
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\bye</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
-<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
-<blockquote>
-<p>&lt;div&gt;There is no block tag support.&lt;/div&gt; There is no &lt;inline tag=”tag”&gt;&lt;/inline&gt; support. There is no &lt;!-- comment --&gt; support. There is no &lt;? HTML instruction ?&gt; support.</p>
+<h5 id="plain-tex-example-6" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb185"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb185-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb185-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb185-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb185-4" data-line-number="4"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb185-5" data-line-number="5">&lt;div&gt;</a>
+<a class="sourceLine" id="cb185-6" data-line-number="6">*There is no block tag support.*</a>
+<a class="sourceLine" id="cb185-7" data-line-number="7">&lt;/div&gt;</a>
+<a class="sourceLine" id="cb185-8" data-line-number="8">*There is no &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*</a>
+<a class="sourceLine" id="cb185-9" data-line-number="9">_There is no &lt;!-- comment --&gt; support._</a>
+<a class="sourceLine" id="cb185-10" data-line-number="10">_There is no &lt;? HTML instruction ?&gt; support._</a>
+<a class="sourceLine" id="cb185-11" data-line-number="11"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb185-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb185-13" data-line-number="13"><span class="fu">\def</span>\markdownOptionHtml{true}</a>
+<a class="sourceLine" id="cb185-14" data-line-number="14"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb185-15" data-line-number="15">&lt;div&gt;</a>
+<a class="sourceLine" id="cb185-16" data-line-number="16">*There is block tag support.*</a>
+<a class="sourceLine" id="cb185-17" data-line-number="17">&lt;/div&gt;</a>
+<a class="sourceLine" id="cb185-18" data-line-number="18">*There is &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*</a>
+<a class="sourceLine" id="cb185-19" data-line-number="19">_There is &lt;!-- comment --&gt; support._</a>
+<a class="sourceLine" id="cb185-20" data-line-number="20">_There is &lt;? HTML instruction ?&gt; support._</a>
+<a class="sourceLine" id="cb185-21" data-line-number="21"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb185-22" data-line-number="22"></a>
+<a class="sourceLine" id="cb185-23" data-line-number="23"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb186"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb186-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>&lt;div&gt;There is no block tag support.&lt;/div&gt; There is no &lt;inline tag=”tag”&gt;&lt;/inline&gt; support. There is no &lt;!– comment –&gt; support. There is no &lt;? HTML instruction ?&gt; support.</p>
<p>There is support. There is support. There is support.</p>
</blockquote>
-<h6 id="latex-example-14" class="unnumbered">LaTeX example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-&lt;div&gt;
-*There is no block tag support.*
-&lt;/div&gt;
-*There is no &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*
-_There is no &lt;!-- comment --&gt; support._
-_There is no &lt;? HTML instruction ?&gt; support._
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{html}
-&lt;div&gt;
-*There is block tag support.*
-&lt;/div&gt;
-*There is &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*
-_There is &lt;!-- comment --&gt; support._
-_There is &lt;? HTML instruction ?&gt; support._
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
-<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
-<blockquote>
-<p>&lt;div&gt;There is no block tag support.&lt;/div&gt; There is no &lt;inline tag=”tag”&gt;&lt;/inline&gt; support. There is no &lt;!-- comment --&gt; support. There is no &lt;? HTML instruction ?&gt; support.</p>
+<h5 id="latex-example-14" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb187"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb187-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb187-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb187-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb187-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb187-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb187-6" data-line-number="6">&lt;div&gt;</a>
+<a class="sourceLine" id="cb187-7" data-line-number="7">*There is no block tag support.*</a>
+<a class="sourceLine" id="cb187-8" data-line-number="8">&lt;/div&gt;</a>
+<a class="sourceLine" id="cb187-9" data-line-number="9">*There is no &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*</a>
+<a class="sourceLine" id="cb187-10" data-line-number="10">_There is no &lt;!-- comment --&gt; support._</a>
+<a class="sourceLine" id="cb187-11" data-line-number="11">_There is no &lt;? HTML instruction ?&gt; support._</a>
+<a class="sourceLine" id="cb187-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb187-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb187-14" data-line-number="14"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{html}</a>
+<a class="sourceLine" id="cb187-15" data-line-number="15">&lt;div&gt;</a>
+<a class="sourceLine" id="cb187-16" data-line-number="16">*There is block tag support.*</a>
+<a class="sourceLine" id="cb187-17" data-line-number="17">&lt;/div&gt;</a>
+<a class="sourceLine" id="cb187-18" data-line-number="18">*There is &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*</a>
+<a class="sourceLine" id="cb187-19" data-line-number="19">_There is &lt;!-- comment --&gt; support._</a>
+<a class="sourceLine" id="cb187-20" data-line-number="20">_There is &lt;? HTML instruction ?&gt; support._</a>
+<a class="sourceLine" id="cb187-21" data-line-number="21"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb187-22" data-line-number="22"></a>
+<a class="sourceLine" id="cb187-23" data-line-number="23"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb188"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb188-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>&lt;div&gt;There is no block tag support.&lt;/div&gt; There is no &lt;inline tag=”tag”&gt;&lt;/inline&gt; support. There is no &lt;!– comment –&gt; support. There is no &lt;? HTML instruction ?&gt; support.</p>
<p>There is support. There is support. There is support.</p>
</blockquote>
-<h6 id="context-example-12" class="unnumbered">ConTeXt example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\starttext</span>
-
-<span class="fu">\startmarkdown</span>
-&lt;div&gt;
-*There is no block tag support.*
-&lt;/div&gt;
-*There is no &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*
-_There is no &lt;!-- comment --&gt; support._
-_There is no &lt;? HTML instruction ?&gt; support._
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\def</span>\markdownOptionHtml{true}
-<span class="fu">\startmarkdown</span>
-&lt;div&gt;
-*There is block tag support.*
-&lt;/div&gt;
-*There is &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*
-_There is &lt;!-- comment --&gt; support._
-_There is &lt;? HTML instruction ?&gt; support._
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\stoptext</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
-<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
-<blockquote>
-<p>&lt;div&gt;There is no block tag support.&lt;/div&gt; There is no &lt;inline tag=”tag”&gt;&lt;/inline&gt; support. There is no &lt;!-- comment --&gt; support. There is no &lt;? HTML instruction ?&gt; support.</p>
+<h5 id="context-example-12" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb189"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb189-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb189-2" data-line-number="2"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb189-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb189-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb189-5" data-line-number="5">&lt;div&gt;</a>
+<a class="sourceLine" id="cb189-6" data-line-number="6">*There is no block tag support.*</a>
+<a class="sourceLine" id="cb189-7" data-line-number="7">&lt;/div&gt;</a>
+<a class="sourceLine" id="cb189-8" data-line-number="8">*There is no &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*</a>
+<a class="sourceLine" id="cb189-9" data-line-number="9">_There is no &lt;!-- comment --&gt; support._</a>
+<a class="sourceLine" id="cb189-10" data-line-number="10">_There is no &lt;? HTML instruction ?&gt; support._</a>
+<a class="sourceLine" id="cb189-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb189-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb189-13" data-line-number="13"><span class="fu">\def</span>\markdownOptionHtml{true}</a>
+<a class="sourceLine" id="cb189-14" data-line-number="14"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb189-15" data-line-number="15">&lt;div&gt;</a>
+<a class="sourceLine" id="cb189-16" data-line-number="16">*There is block tag support.*</a>
+<a class="sourceLine" id="cb189-17" data-line-number="17">&lt;/div&gt;</a>
+<a class="sourceLine" id="cb189-18" data-line-number="18">*There is &lt;inline tag=&quot;tag&quot;&gt;&lt;/inline&gt; support.*</a>
+<a class="sourceLine" id="cb189-19" data-line-number="19">_There is &lt;!-- comment --&gt; support._</a>
+<a class="sourceLine" id="cb189-20" data-line-number="20">_There is &lt;? HTML instruction ?&gt; support._</a>
+<a class="sourceLine" id="cb189-21" data-line-number="21"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb189-22" data-line-number="22"></a>
+<a class="sourceLine" id="cb189-23" data-line-number="23"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb190"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb190-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>&lt;div&gt;There is no block tag support.&lt;/div&gt; There is no &lt;inline tag=”tag”&gt;&lt;/inline&gt; support. There is no &lt;!– comment –&gt; support. There is no &lt;? HTML instruction ?&gt; support.</p>
<p>There is support. There is support. There is support.</p>
</blockquote>
-<h5 id="option-hybrid"><span class="header-section-number">2.1.2.2.15</span> Option <code>hybrid</code></h5>
+<h4 id="option-hybrid"><span class="header-section-number">2.2.1.17</span> Option <code>hybrid</code></h4>
<dl>
<dt><code>hybrid</code> (default value: <code>true</code>)</dt>
<dd><dl>
<dt>true</dt>
-<dd><p>Disable the escaping of special plain TeX characters, which makes it possible to intersperse your markdown markup with TeX code. The intended usage is in documents prepared manually by a human author. In such documents, it can often be desirable to mix TeX and markdown markup freely.</p>
+<dd><p>Disable the escaping of special plain <span class="tex">T<sub>e</sub>X</span> characters, which makes it possible to intersperse your markdown markup with <span class="tex">T<sub>e</sub>X</span> code. The intended usage is in documents prepared manually by a human author. In such documents, it can often be desirable to mix <span class="tex">T<sub>e</sub>X</span> and markdown markup freely.</p>
</dd>
</dl>
</dd>
<dd><dl>
<dt>false</dt>
-<dd><p>Enable the escaping of special plain TeX characters outside verbatim environments, so that they are not interpretted by TeX. This is encouraged when typesetting automatically generated content or markdown documents that were not prepared with this package in mind.</p>
+<dd><p>Enable the escaping of special plain <span class="tex">T<sub>e</sub>X</span> characters outside verbatim environments, so that they are not interpretted by <span class="tex">T<sub>e</sub>X</span>. This is encouraged when typesetting automatically generated content or markdown documents that were not prepared with this package in mind.</p>
</dd>
</dl>
</dd>
</dl>
-<h6 id="lua-module-example-7" class="unnumbered">Lua module example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local convert_safe = markdown.new()
- local convert_unsafe = markdown.new({hybrid = true})
- local input = [[<span class="ss">$</span><span class="sc">\noexpand\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.]]
- tex.sprint(convert_safe(input) .. &quot; &quot; .. convert_unsafe(input)) }
-<span class="fu">\bye</span></code></pre></div>
+<h5 id="lua-module-example-7" class="unnumbered">Lua Module Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb191"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb191-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb191-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb191-3" data-line-number="3"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb191-4" data-line-number="4"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb191-5" data-line-number="5"> local input, convert_safe, convert_unsafe, paragraph</a>
+<a class="sourceLine" id="cb191-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb191-7" data-line-number="7"> input = [[<span class="ss">$</span><span class="sc">\string\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.]]</a>
+<a class="sourceLine" id="cb191-8" data-line-number="8"> convert_safe = markdown.new()</a>
+<a class="sourceLine" id="cb191-9" data-line-number="9"> convert_unsafe = markdown.new({hybrid = true})</a>
+<a class="sourceLine" id="cb191-10" data-line-number="10"> paragraph = [[<span class="fu">\par</span>]]</a>
+<a class="sourceLine" id="cb191-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb191-12" data-line-number="12"> tex.sprint(</a>
+<a class="sourceLine" id="cb191-13" data-line-number="13"> convert_safe(input) .. paragraph ..</a>
+<a class="sourceLine" id="cb191-14" data-line-number="14"> convert_unsafe(input)</a>
+<a class="sourceLine" id="cb191-15" data-line-number="15"> )</a>
+<a class="sourceLine" id="cb191-16" data-line-number="16">}</a>
+<a class="sourceLine" id="cb191-17" data-line-number="17"><span class="fu">\bye</span></a></code></pre></div>
<p>Then, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb192"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb192-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>$\sqrt {-1}$ <em>equals</em> $i$. √-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+<p>$\sqrt {-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
</blockquote>
-<h6 id="lua-cli-example-7" class="unnumbered">Lua CLI example</h6>
+<h5 id="lua-cli-example-7" class="unnumbered">Lua CLI Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\input</span> optionfalse
-<span class="fu">\input</span> optiontrue
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb193"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb193-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb193-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb193-3" data-line-number="3"><span class="fu">\input</span> optionfalse</a>
+<a class="sourceLine" id="cb193-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb193-5" data-line-number="5"><span class="fu">\input</span> optiontrue</a>
+<a class="sourceLine" id="cb193-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div>
<p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">$\sqrt{-1}$ *equals* $i$.</code></pre></div>
+<div class="sourceCode" id="cb194"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb194-1" data-line-number="1">$\sqrt{-1}$ *equals* $i$.</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> -- content.md optionfalse.tex
-<span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> hybrid=true -- content.md optiontrue.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
-<p>where <code>&lt;CLI␣PATHNAME&gt;</code> corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\&lt;YOUR␣USERNAME&gt;\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
+<div class="sourceCode" id="cb195"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb195-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a>
+<a class="sourceLine" id="cb195-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ hybrid=true -- content.md optiontrue.tex</a>
+<a class="sourceLine" id="cb195-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>$\sqrt {-1}$ <em>equals</em> $i$. √-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+<p>$\sqrt {-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
</blockquote>
-<h6 id="plain-tex-example-7" class="unnumbered">Plain TeX example</h6>
+<h5 id="plain-tex-example-7" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\input</span> lmfonts
-<span class="fu">\markdownBegin</span>
-<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.
-<span class="fu">\markdownEnd</span>
-<span class="fu">\def</span>\markdownOptionHybrid{true}
-<span class="fu">\markdownBegin</span>
-<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.
-<span class="fu">\markdownEnd</span>
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb196"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb196-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb196-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb196-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb196-4" data-line-number="4"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb196-5" data-line-number="5"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a>
+<a class="sourceLine" id="cb196-6" data-line-number="6"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb196-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb196-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionHybrid{true}</a>
+<a class="sourceLine" id="cb196-9" data-line-number="9"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb196-10" data-line-number="10"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a>
+<a class="sourceLine" id="cb196-11" data-line-number="11"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb196-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb196-13" data-line-number="13"><span class="fu">\bye</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb197"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb197-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>$\sqrt {-1}$ <em>equals</em> $i$. √-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+<p>$\sqrt {-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
</blockquote>
-<h6 id="latex-example-15" class="unnumbered">LaTeX example</h6>
+<h5 id="latex-example-15" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{hybrid}
-<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
+<div class="sourceCode" id="cb198"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb198-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb198-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb198-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb198-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb198-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb198-6" data-line-number="6"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a>
+<a class="sourceLine" id="cb198-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb198-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb198-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{hybrid}</a>
+<a class="sourceLine" id="cb198-10" data-line-number="10"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a>
+<a class="sourceLine" id="cb198-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb198-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb198-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb199"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb199-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>$\sqrt {-1}$ <em>equals</em> $i$. √-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+<p>$\sqrt {-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
</blockquote>
-<h6 id="context-example-13" class="unnumbered">ConTeXt example</h6>
+<h5 id="context-example-13" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\starttext</span>
-<span class="fu">\startmarkdown</span>
-<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.
-<span class="fu">\stopmarkdown</span>
-<span class="fu">\def</span>\markdownOptionHybrid{true}
-<span class="fu">\startmarkdown</span>
-<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.
-<span class="fu">\stopmarkdown</span>
-<span class="fu">\stoptext</span></code></pre></div>
+<div class="sourceCode" id="cb200"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb200-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb200-2" data-line-number="2"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb200-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb200-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb200-5" data-line-number="5"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a>
+<a class="sourceLine" id="cb200-6" data-line-number="6"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb200-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb200-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionHybrid{true}</a>
+<a class="sourceLine" id="cb200-9" data-line-number="9"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb200-10" data-line-number="10"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>.</a>
+<a class="sourceLine" id="cb200-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb200-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb200-13" data-line-number="13"><span class="fu">\stoptext</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb201"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb201-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>$\sqrt {-1}$ <em>equals</em> $i$. √-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+<p>$\sqrt {-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
</blockquote>
-<h5 id="option-inlinefootnotes"><span class="header-section-number">2.1.2.2.16</span> Option <code>inlineFootnotes</code></h5>
+<h4 id="option-inlinefootnotes"><span class="header-section-number">2.2.1.18</span> Option <code>inlineFootnotes</code></h4>
<dl>
<dt><code>inlineFootnotes</code> (default value: <code>false</code>)</dt>
<dd><dl>
<dt>true</dt>
<dd><p>Enable the pandoc inline footnote syntax extension:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">Here is an inline note.^[Inlines notes are easier to
-write, since you don&#39;t have to pick an identifier and
-move down to type the note.]</code></pre></div>
+<div class="sourceCode" id="cb202"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb202-1" data-line-number="1">Here is an inline note.^[Inlines notes are easier to</a>
+<a class="sourceLine" id="cb202-2" data-line-number="2">write, since you don&#39;t have to pick an identifier and</a>
+<a class="sourceLine" id="cb202-3" data-line-number="3">move down to type the note.]</a></code></pre></div>
</dd>
</dl>
</dd>
@@ -2187,42 +2346,42 @@ move down to type the note.]</code></pre></div>
</dl>
</dd>
</dl>
-<h6 id="latex-example-16" class="unnumbered">LaTeX example</h6>
+<h5 id="latex-example-16" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>[footnotes, inlineFootnotes]{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-Here is an inline note.^[Inlines notes are easier to
-write, since you don&#39;t have to pick an identifier and
-move down to type the note.]
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
+<div class="sourceCode" id="cb203"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb203-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb203-2" data-line-number="2"><span class="bu">\usepackage</span>[footnotes, inlineFootnotes]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb203-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb203-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb203-5" data-line-number="5">Here is an inline note.^[Inlines notes are easier to</a>
+<a class="sourceLine" id="cb203-6" data-line-number="6">write, since you don&#39;t have to pick an identifier and</a>
+<a class="sourceLine" id="cb203-7" data-line-number="7">move down to type the note.]</a>
+<a class="sourceLine" id="cb203-8" data-line-number="8"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb203-9" data-line-number="9"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb204"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb204-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>Here is an inline note.<a href="#fn5" class="footnoteRef" id="fnref5"><sup>5</sup></a></p>
+<p>Here is an inline note.<a href="#fn5" class="footnote-ref" id="fnref5"><sup>5</sup></a></p>
</blockquote>
-<h6 id="context-example-14" class="unnumbered">ConTeXt example</h6>
+<h5 id="context-example-14" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\def</span>\markdownOptionFootnotes{true}
-<span class="fu">\def</span>\markdownOptionInlineFootnotes{true}
-<span class="fu">\starttext</span>
-<span class="fu">\startmarkdown</span>
-Here is an inline note.^[Inlines notes are easier to
-write, since you don&#39;t have to pick an identifier and
-move down to type the note.]
-<span class="fu">\stopmarkdown</span>
-<span class="fu">\stoptext</span></code></pre></div>
+<div class="sourceCode" id="cb205"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb205-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb205-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFootnotes{true}</a>
+<a class="sourceLine" id="cb205-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionInlineFootnotes{true}</a>
+<a class="sourceLine" id="cb205-4" data-line-number="4"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb205-5" data-line-number="5"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb205-6" data-line-number="6">Here is an inline note.^[Inlines notes are easier to</a>
+<a class="sourceLine" id="cb205-7" data-line-number="7">write, since you don&#39;t have to pick an identifier and</a>
+<a class="sourceLine" id="cb205-8" data-line-number="8">move down to type the note.]</a>
+<a class="sourceLine" id="cb205-9" data-line-number="9"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb205-10" data-line-number="10"><span class="fu">\stoptext</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb206"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb206-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>Here is an inline note.<a href="#fn6" class="footnoteRef" id="fnref6"><sup>6</sup></a></p>
+<p>Here is an inline note.<a href="#fn6" class="footnote-ref" id="fnref6"><sup>6</sup></a></p>
</blockquote>
-<h5 id="option-preservetabs"><span class="header-section-number">2.1.2.2.17</span> Option <code>preserveTabs</code></h5>
+<h4 id="option-preservetabs"><span class="header-section-number">2.2.1.19</span> Option <code>preserveTabs</code></h4>
<dl>
<dt><code>preserveTabs</code> (default value: <code>false</code>)</dt>
<dd><dl>
@@ -2239,12 +2398,149 @@ move down to type the note.]
</dd>
</dl>
<p>This option is currently non-functional. See <a href="https://github.com/Witiko/markdown/issues/38" title="Tabs are stripped even with the `preserveTabs=true` Lua option enabled">the corresponding issue</a> in the package repository.</p>
-<h5 id="option-smartellipses"><span class="header-section-number">2.1.2.2.18</span> Option <code>smartEllipses</code></h5>
+<h4 id="slice"><span class="header-section-number">2.2.1.20</span> Option <code>slice</code></h4>
+<dl>
+<dt><code>slice</code> (default value: <code>^ $</code>)</dt>
+<dd><p>Two space-separated selectors that specify the slice of a document that will be processed, whereas the remainder of the document will be ignored. The following selectors are recognized:</p>
+<ul>
+<li>The circumflex (<code>^</code>) selects the beginning of a document.</li>
+<li>The dollar sign (<code>$</code>) selects the end of a document.</li>
+<li><code>^</code>⟨<em>identifier</em>⟩ selects the beginning of a section with the <a href="#header-attributes">HTML attribute</a> <code>#</code>⟨<em>identifier</em>⟩.</li>
+<li><code>$</code>⟨<em>identifier</em>⟩ selects the end of a section with the HTML attribute <code>#</code>⟨<em>identifier</em>⟩.</li>
+<li>⟨<em>identifier</em>⟩ corresponds to <code>^</code>⟨<em>identifier</em>⟩ for the first selector and to <code>$</code>⟨<em>identifier</em>⟩ for the second selector.</li>
+</ul>
+<p>Specifying only a single selector, ⟨<em>identifier</em>⟩, is equivalent to specifying the two selectors ⟨<em>identifier</em>⟩ ⟨<em>identifier</em>⟩, which is equivalent to <code>^</code>⟨<em>identifier</em>⟩ <code>$</code>⟨<em>identifier</em>⟩.</p>
+</dd>
+</dl>
+<h5 id="plain-tex-example-8" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>hamlet.md</code> with the following content:</p>
+<div class="sourceCode" id="cb207"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb207-1" data-line-number="1"><span class="fu"># The Tragedy of Hamlet</span></a>
+<a class="sourceLine" id="cb207-2" data-line-number="2">Shakespeare&#39;s longest play.</a>
+<a class="sourceLine" id="cb207-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb207-4" data-line-number="4"><span class="fu">## Act III {#act-3}</span></a>
+<a class="sourceLine" id="cb207-5" data-line-number="5">Hamlet kills Polonius.</a>
+<a class="sourceLine" id="cb207-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb207-7" data-line-number="7"><span class="fu">## Act V {#act-5}</span></a>
+<a class="sourceLine" id="cb207-8" data-line-number="8">Hamlet dies.</a>
+<a class="sourceLine" id="cb207-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb207-10" data-line-number="10"><span class="fu">## Act I {#act-1}</span></a>
+<a class="sourceLine" id="cb207-11" data-line-number="11">Hamlet talks to ghost.</a></code></pre></div>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb208"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb208-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb208-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionHeaderAttributes{true}</a>
+<a class="sourceLine" id="cb208-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb208-4" data-line-number="4"><span class="fu">\font\normal</span>=cmr10<span class="fu">\normal</span></a>
+<a class="sourceLine" id="cb208-5" data-line-number="5"><span class="fu">\font\big</span>=cmr10 at 12pt</a>
+<a class="sourceLine" id="cb208-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererHeadingTwo#1{{\big #1\par}}</a>
+<a class="sourceLine" id="cb208-7" data-line-number="7"><span class="fu">\font\bigger</span>=cmr10 scaled 1440</a>
+<a class="sourceLine" id="cb208-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererHeadingOne#1{{\bigger #1\par}}</a>
+<a class="sourceLine" id="cb208-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb208-10" data-line-number="10"><span class="fu">\def</span>\markdownOptionSlice{^ ^act-3}</a>
+<a class="sourceLine" id="cb208-11" data-line-number="11"><span class="fu">\markdownInput</span>{hamlet.md}</a>
+<a class="sourceLine" id="cb208-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb208-13" data-line-number="13"><span class="fu">\def</span>\markdownOptionSlice{act-1}</a>
+<a class="sourceLine" id="cb208-14" data-line-number="14"><span class="fu">\markdownInput</span>{hamlet.md}</a>
+<a class="sourceLine" id="cb208-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb208-16" data-line-number="16"><span class="fu">\def</span>\markdownOptionSlice{act-3 act-5}</a>
+<a class="sourceLine" id="cb208-17" data-line-number="17"><span class="fu">\markdownInput</span>{hamlet.md}</a>
+<a class="sourceLine" id="cb208-18" data-line-number="18"></a>
+<a class="sourceLine" id="cb208-19" data-line-number="19"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb209"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb209-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<h1 id="the-tragedy-of-hamlet">The Tragedy of Hamlet</h1>
+<p>Shakespeare’s longest play.</p>
+<h2 id="act-i">Act I</h2>
+<p>Hamlet talks to ghost.</p>
+<h2 id="act-iii">Act III</h2>
+<p>Hamlet kills Polonius.</p>
+<h2 id="act-v">Act V</h2>
+<p>Hamlet dies.</p>
+</blockquote>
+<h5 id="latex-example-17" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb210"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb210-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb210-2" data-line-number="2"><span class="bu">\usepackage</span>[headerAttributes]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb210-3" data-line-number="3"><span class="bu">\usepackage</span>{<span class="ex">filecontents</span>}</a>
+<a class="sourceLine" id="cb210-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">filecontents*</span>}{hamlet.md}</a>
+<a class="sourceLine" id="cb210-5" data-line-number="5"># The Tragedy of Hamlet</a>
+<a class="sourceLine" id="cb210-6" data-line-number="6">Shakespeare&#39;s longest play.</a>
+<a class="sourceLine" id="cb210-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb210-8" data-line-number="8">## Act III {#act-3}</a>
+<a class="sourceLine" id="cb210-9" data-line-number="9">Hamlet kills Polonius.</a>
+<a class="sourceLine" id="cb210-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb210-11" data-line-number="11">## Act V {#act-5}</a>
+<a class="sourceLine" id="cb210-12" data-line-number="12">Hamlet dies.</a>
+<a class="sourceLine" id="cb210-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb210-14" data-line-number="14">## Act I {#act-1}</a>
+<a class="sourceLine" id="cb210-15" data-line-number="15">Hamlet talks to ghost.</a>
+<a class="sourceLine" id="cb210-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">filecontents*</span>}</a>
+<a class="sourceLine" id="cb210-17" data-line-number="17"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb210-18" data-line-number="18"><span class="fu">\markdownInput</span>[slice=^ ^act-3]{hamlet.md}</a>
+<a class="sourceLine" id="cb210-19" data-line-number="19"><span class="fu">\markdownInput</span>[slice=act-1]{hamlet.md}</a>
+<a class="sourceLine" id="cb210-20" data-line-number="20"><span class="fu">\markdownInput</span>[slice=act-3 act-5]{hamlet.md}</a>
+<a class="sourceLine" id="cb210-21" data-line-number="21"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb211"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb211-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<h1 id="the-tragedy-of-hamlet-1">The Tragedy of Hamlet</h1>
+<p>Shakespeare’s longest play.</p>
+<h2 id="act-i-1">Act I</h2>
+<p>Hamlet talks to ghost.</p>
+<h2 id="act-iii-1">Act III</h2>
+<p>Hamlet kills Polonius.</p>
+<h2 id="act-v-1">Act V</h2>
+<p>Hamlet dies.</p>
+</blockquote>
+<h5 id="context-example-15" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>hamlet.md</code> with the following content:</p>
+<div class="sourceCode" id="cb212"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb212-1" data-line-number="1"><span class="fu"># The Tragedy of Hamlet</span></a>
+<a class="sourceLine" id="cb212-2" data-line-number="2">Shakespeare&#39;s longest play.</a>
+<a class="sourceLine" id="cb212-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb212-4" data-line-number="4"><span class="fu">## Act III {#act-3}</span></a>
+<a class="sourceLine" id="cb212-5" data-line-number="5">Hamlet kills Polonius.</a>
+<a class="sourceLine" id="cb212-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb212-7" data-line-number="7"><span class="fu">## Act V {#act-5}</span></a>
+<a class="sourceLine" id="cb212-8" data-line-number="8">Hamlet dies.</a>
+<a class="sourceLine" id="cb212-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb212-10" data-line-number="10"><span class="fu">## Act I {#act-1}</span></a>
+<a class="sourceLine" id="cb212-11" data-line-number="11">Hamlet talks to ghost.</a></code></pre></div>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb213"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb213-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb213-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionHeaderAttributes{true}</a>
+<a class="sourceLine" id="cb213-3" data-line-number="3"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb213-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb213-5" data-line-number="5"><span class="fu">\def</span>\markdownOptionSlice{^ ^act-3}</a>
+<a class="sourceLine" id="cb213-6" data-line-number="6"><span class="fu">\markdownInput</span>{hamlet.md}</a>
+<a class="sourceLine" id="cb213-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb213-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionSlice{act-1}</a>
+<a class="sourceLine" id="cb213-9" data-line-number="9"><span class="fu">\markdownInput</span>{hamlet.md}</a>
+<a class="sourceLine" id="cb213-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb213-11" data-line-number="11"><span class="fu">\def</span>\markdownOptionSlice{act-3 act-5}</a>
+<a class="sourceLine" id="cb213-12" data-line-number="12"><span class="fu">\markdownInput</span>{hamlet.md}</a>
+<a class="sourceLine" id="cb213-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb213-14" data-line-number="14"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb214"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb214-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<h1 id="the-tragedy-of-hamlet-2">The Tragedy of Hamlet</h1>
+<p>Shakespeare’s longest play.</p>
+<h2 id="act-i-2">Act I</h2>
+<p>Hamlet talks to ghost.</p>
+<h2 id="act-iii-2">Act III</h2>
+<p>Hamlet kills Polonius.</p>
+<h2 id="act-v-2">Act V</h2>
+<p>Hamlet dies.</p>
+</blockquote>
+<h4 id="option-smartellipses"><span class="header-section-number">2.2.1.21</span> Option <code>smartEllipses</code></h4>
<dl>
<dt><code>smartEllipses</code> (default value: <code>false</code>)</dt>
<dd><dl>
<dt>true</dt>
-<dd><p>Convert any ellipses in the input to the <code>\markdownRendererEllipsis</code> TeX macro.</p>
+<dd><p>Convert any ellipses in the input to the <code>\markdownRendererEllipsis</code> <span class="tex">T<sub>e</sub>X</span> macro.</p>
</dd>
</dl>
</dd>
@@ -2255,223 +2551,223 @@ move down to type the note.]
</dl>
</dd>
</dl>
-<h6 id="lua-module-example-8" class="unnumbered">Lua module example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\def</span>\markdownRendererEllipsis{. . .}
-<span class="fu">\input</span> lmfonts
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local convert = markdown.new()
- input = &quot;These are just three regular dots ...&quot;
- tex.sprint(convert(input)) }
-<span class="fu">\par</span>
-<span class="fu">\directlua</span>{
- local markdown = require(&quot;markdown&quot;)
- local convert = markdown.new({smartEllipses = true})
- input = &quot;... and this is a victorian ellipsis.&quot;
- tex.sprint(convert(input)) }
-<span class="fu">\bye</span></code></pre></div>
+<h5 id="lua-module-example-8" class="unnumbered">Lua Module Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb215"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb215-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb215-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEllipsis{. . .}</a>
+<a class="sourceLine" id="cb215-3" data-line-number="3"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb215-4" data-line-number="4"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb215-5" data-line-number="5"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb215-6" data-line-number="6"> local convert = markdown.new()</a>
+<a class="sourceLine" id="cb215-7" data-line-number="7"> local input = &quot;These are just three regular dots ...&quot;</a>
+<a class="sourceLine" id="cb215-8" data-line-number="8"> tex.sprint(convert(input)) }</a>
+<a class="sourceLine" id="cb215-9" data-line-number="9"><span class="fu">\par</span></a>
+<a class="sourceLine" id="cb215-10" data-line-number="10"><span class="fu">\directlua</span>{</a>
+<a class="sourceLine" id="cb215-11" data-line-number="11"> local markdown = require(&quot;markdown&quot;)</a>
+<a class="sourceLine" id="cb215-12" data-line-number="12"> local convert = markdown.new({smartEllipses = true})</a>
+<a class="sourceLine" id="cb215-13" data-line-number="13"> local input = &quot;... and this is a victorian ellipsis.&quot;</a>
+<a class="sourceLine" id="cb215-14" data-line-number="14"> tex.sprint(convert(input)) }</a>
+<a class="sourceLine" id="cb215-15" data-line-number="15"><span class="fu">\bye</span></a></code></pre></div>
<p>Then, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb216"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb216-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>These are just three regular dots ...</p>
+<p>These are just three regular dots …</p>
<p>. . . and this is a victorian ellipsis.</p>
</blockquote>
-<h6 id="lua-cli-example-8" class="unnumbered">Lua CLI example</h6>
+<h5 id="lua-cli-example-8" class="unnumbered">Lua CLI Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\def</span>\markdownRendererEllipsis{. . .}
-<span class="fu">\input</span> lmfonts
-<span class="fu">\input</span> optionfalse
-<span class="fu">\par</span>
-<span class="fu">\input</span> optiontrue
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb217"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb217-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb217-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEllipsis{. . .}</a>
+<a class="sourceLine" id="cb217-3" data-line-number="3"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb217-4" data-line-number="4"><span class="fu">\input</span> optionfalse</a>
+<a class="sourceLine" id="cb217-5" data-line-number="5"><span class="fu">\par</span></a>
+<a class="sourceLine" id="cb217-6" data-line-number="6"><span class="fu">\input</span> optiontrue</a>
+<a class="sourceLine" id="cb217-7" data-line-number="7"><span class="fu">\bye</span></a></code></pre></div>
<p>Using a text editor, create a text document named <code>content.md</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">Are these just three regular dots, a victorian ellipsis, or ... ?</code></pre></div>
+<div class="sourceCode" id="cb218"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb218-1" data-line-number="1">Are these just three regular dots, a victorian ellipsis, or ... ?</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> -- content.md optionfalse.tex
-<span class="ex">texlua</span> <span class="op">&lt;</span>CLI␣PATHNAME<span class="op">&gt;</span> smartEllipses=true -- content.md optiontrue.tex
-<span class="ex">luatex</span> document.tex</code></pre></div>
-<p>where <code>&lt;CLI␣PATHNAME&gt;</code> corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\&lt;YOUR␣USERNAME&gt;\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
+<div class="sourceCode" id="cb219"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb219-1" data-line-number="1"><span class="ex">texlua</span> ⟨CLI pathname⟩ -- content.md optionfalse.tex</a>
+<a class="sourceLine" id="cb219-2" data-line-number="2"><span class="ex">texlua</span> ⟨CLI pathname⟩ smartEllipses=true -- content.md optiontrue.tex</a>
+<a class="sourceLine" id="cb219-3" data-line-number="3"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>where ⟨<em>CLI pathname</em>⟩ corresponds to the location of the Lua CLI script file, such as <code>~/texmf/scripts/markdown/markdown-cli.lua</code> on UN*X systems or <code>C:\Users\</code>⟨<em>Your username</em>⟩<code>\texmf\scripts\markdown\markdown-cli.lua</code> on Windows systems. Use the command <code>kpsewhich markdown-cli.lua</code> to locate the Lua CLI script file using <a href="https://tug.org/kpathsea/" title="Kpathsea - TeX Users Group">Kpathsea</a>.</p>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>Are these just three regular dots, a victorian ellipsis, or ... ?</p>
+<p>Are these just three regular dots, a victorian ellipsis, or … ?</p>
<p>Are these just three regular dots, a victorian ellipsis, or . . . ?</p>
</blockquote>
-<h6 id="plain-tex-example-8" class="unnumbered">Plain TeX example</h6>
+<h5 id="plain-tex-example-9" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\def</span>\markdownRendererEllipsis{. . .}
-
-<span class="fu">\markdownBegin</span>
-These are just three regular dots ...
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\def</span>\markdownOptionSmartEllipses{true}
-<span class="fu">\markdownBegin</span>
-... and this is a victorian ellipsis.
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb220"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb220-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb220-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEllipsis{. . .}</a>
+<a class="sourceLine" id="cb220-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb220-4" data-line-number="4"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb220-5" data-line-number="5">These are just three regular dots ...</a>
+<a class="sourceLine" id="cb220-6" data-line-number="6"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb220-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb220-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionSmartEllipses{true}</a>
+<a class="sourceLine" id="cb220-9" data-line-number="9"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb220-10" data-line-number="10">... and this is a victorian ellipsis.</a>
+<a class="sourceLine" id="cb220-11" data-line-number="11"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb220-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb220-13" data-line-number="13"><span class="fu">\bye</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb221"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb221-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>These are just three regular dots ...</p>
+<p>These are just three regular dots …</p>
<p>. . . and this is a victorian ellipsis.</p>
</blockquote>
-<h6 id="latex-example-17" class="unnumbered">LaTeX example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">markdown</span>}
-<span class="fu">\markdownSetup</span>{
- renderers = {
- ellipsis = {. . .} }}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-These are just three regular dots ...
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{smartEllipses}
-... and this is a victorian ellipsis.
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
-<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
-<blockquote>
-<p>These are just three regular dots ...</p>
+<h5 id="latex-example-18" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb222"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb222-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb222-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb222-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb222-4" data-line-number="4"> renderers = {</a>
+<a class="sourceLine" id="cb222-5" data-line-number="5"> ellipsis = {. . .} }}</a>
+<a class="sourceLine" id="cb222-6" data-line-number="6"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb222-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb222-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb222-9" data-line-number="9">These are just three regular dots ...</a>
+<a class="sourceLine" id="cb222-10" data-line-number="10"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb222-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb222-12" data-line-number="12"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{smartEllipses}</a>
+<a class="sourceLine" id="cb222-13" data-line-number="13">... and this is a victorian ellipsis.</a>
+<a class="sourceLine" id="cb222-14" data-line-number="14"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb222-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb222-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb223"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb223-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>These are just three regular dots …</p>
<p>. . . and this is a victorian ellipsis.</p>
</blockquote>
-<h6 id="context-example-15" class="unnumbered">ConTeXt example</h6>
+<h5 id="context-example-16" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\def</span>\markdownRendererEllipsis{. . .}
-<span class="fu">\starttext</span>
-
-<span class="fu">\startmarkdown</span>
-These are just three regular dots ...
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\def</span>\markdownOptionSmartEllipses{true}
-<span class="fu">\startmarkdown</span>
-... and this is a victorian ellipsis.
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\stoptext</span></code></pre></div>
+<div class="sourceCode" id="cb224"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb224-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb224-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEllipsis{. . .}</a>
+<a class="sourceLine" id="cb224-3" data-line-number="3"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb224-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb224-5" data-line-number="5"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb224-6" data-line-number="6">These are just three regular dots ...</a>
+<a class="sourceLine" id="cb224-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb224-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb224-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionSmartEllipses{true}</a>
+<a class="sourceLine" id="cb224-10" data-line-number="10"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb224-11" data-line-number="11">... and this is a victorian ellipsis.</a>
+<a class="sourceLine" id="cb224-12" data-line-number="12"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb224-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb224-14" data-line-number="14"><span class="fu">\stoptext</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb225"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb225-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
-<p>These are just three regular dots ...</p>
+<p>These are just three regular dots …</p>
<p>. . . and this is a victorian ellipsis.</p>
</blockquote>
-<h5 id="option-startnumber"><span class="header-section-number">2.1.2.2.19</span> Option <code>startNumber</code></h5>
+<h4 id="option-startnumber"><span class="header-section-number">2.2.1.22</span> Option <code>startNumber</code></h4>
<dl>
<dt><code>startNumber</code> (default value: <code>true</code>)</dt>
<dd><dl>
<dt>true</dt>
-<dd><p>Make the number in the first item of an ordered lists significant. The item numbers will be passed to the <code>\markdownRendererOlItemWithNumber</code> TeX macro.</p>
+<dd><p>Make the number in the first item of an ordered lists significant. The item numbers will be passed to the <code>\markdownRendererOlItemWithNumber</code> <span class="tex">T<sub>e</sub>X</span> macro.</p>
</dd>
</dl>
</dd>
<dd><dl>
<dt>false</dt>
-<dd><p>Ignore the numbers in the ordered list items. Each item will only produce a <code>\markdownRendererOlItem</code> TeX macro.</p>
+<dd><p>Ignore the numbers in the ordered list items. Each item will only produce a <code>\markdownRendererOlItem</code> <span class="tex">T<sub>e</sub>X</span> macro.</p>
</dd>
</dl>
</dd>
</dl>
-<h6 id="latex-example-18" class="unnumbered">LaTeX example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-The following list respects the numbers specified in the markup:
-
-3. third item
-4. fourth item
-5. fifth item
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{startNumber=false}
-The following list does not respect the numbers specified in the
-markup:
-
-3. third item
-4. fourth item
-5. fifth item
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<h5 id="latex-example-19" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb226"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb226-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb226-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb226-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb226-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb226-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb226-6" data-line-number="6">The following list respects the numbers specified in the markup:</a>
+<a class="sourceLine" id="cb226-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb226-8" data-line-number="8">3. third item</a>
+<a class="sourceLine" id="cb226-9" data-line-number="9">4. fourth item</a>
+<a class="sourceLine" id="cb226-10" data-line-number="10">5. fifth item</a>
+<a class="sourceLine" id="cb226-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb226-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb226-13" data-line-number="13"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{startNumber=false}</a>
+<a class="sourceLine" id="cb226-14" data-line-number="14">The following list does not respect the numbers specified in the</a>
+<a class="sourceLine" id="cb226-15" data-line-number="15">markup:</a>
+<a class="sourceLine" id="cb226-16" data-line-number="16"></a>
+<a class="sourceLine" id="cb226-17" data-line-number="17">3. third item</a>
+<a class="sourceLine" id="cb226-18" data-line-number="18">4. fourth item</a>
+<a class="sourceLine" id="cb226-19" data-line-number="19">5. fifth item</a>
+<a class="sourceLine" id="cb226-20" data-line-number="20"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb226-21" data-line-number="21"></a>
+<a class="sourceLine" id="cb226-22" data-line-number="22"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb227"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb227-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>The following list respects the numbers specified in the markup:</p>
-<ol start="3" style="list-style-type: decimal">
+<ol start="3" type="1">
<li>third item</li>
<li>fourth item</li>
<li>fifth item</li>
</ol>
<p>The following list does not respect the numbers specified in the markup:</p>
-<ol style="list-style-type: decimal">
+<ol type="1">
<li>third item</li>
<li>fourth item</li>
<li>fifth item</li>
</ol>
</blockquote>
-<h6 id="context-example-16" class="unnumbered">ConTeXt example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\starttext</span>
-
-<span class="fu">\startmarkdown</span>
-The following list respects the numbers specified in the markup:
-
-3. third item
-4. fourth item
-5. fifth item
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\def</span>\markdownOptionStartNumber{false}
-<span class="fu">\startmarkdown</span>
-The following list respects the numbers specified in the markup:
-
-3. third item
-4. fourth item
-5. fifth item
-<span class="fu">\stopmarkdown</span>
-<span class="fu">\stoptext</span></code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<h5 id="context-example-17" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb228"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb228-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb228-2" data-line-number="2"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb228-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb228-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb228-5" data-line-number="5">The following list respects the numbers specified in the markup:</a>
+<a class="sourceLine" id="cb228-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb228-7" data-line-number="7">3. third item</a>
+<a class="sourceLine" id="cb228-8" data-line-number="8">4. fourth item</a>
+<a class="sourceLine" id="cb228-9" data-line-number="9">5. fifth item</a>
+<a class="sourceLine" id="cb228-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb228-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb228-12" data-line-number="12"><span class="fu">\def</span>\markdownOptionStartNumber{false}</a>
+<a class="sourceLine" id="cb228-13" data-line-number="13"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb228-14" data-line-number="14">The following list respects the numbers specified in the markup:</a>
+<a class="sourceLine" id="cb228-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb228-16" data-line-number="16">3. third item</a>
+<a class="sourceLine" id="cb228-17" data-line-number="17">4. fourth item</a>
+<a class="sourceLine" id="cb228-18" data-line-number="18">5. fifth item</a>
+<a class="sourceLine" id="cb228-19" data-line-number="19"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb228-20" data-line-number="20"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb229"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb229-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>The following list respects the numbers specified in the markup:</p>
-<ol start="3" style="list-style-type: decimal">
+<ol start="3" type="1">
<li>third item</li>
<li>fourth item</li>
<li>fifth item</li>
</ol>
<p>The following list does not respect the numbers specified in the markup:</p>
-<ol style="list-style-type: decimal">
+<ol type="1">
<li>third item</li>
<li>fourth item</li>
<li>fifth item</li>
</ol>
</blockquote>
-<h5 id="option-tightlists"><span class="header-section-number">2.1.2.2.20</span> Option <code>tightLists</code></h5>
+<h4 id="option-tightlists"><span class="header-section-number">2.2.1.23</span> Option <code>tightLists</code></h4>
<dl>
<dt><code>tightLists</code> (default value: <code>true</code>)</dt>
<dd><dl>
<dt>true</dt>
-<dd><p>Lists whose bullets do not consist of multiple paragraphs will be passed to the <code>\markdownRendererOlBeginTight</code>, <code>\markdownRendererOlEndTight</code>, <code>\markdownRendererUlBeginTight</code>, <code>\markdownRendererUlEndTight</code>, <code>\markdownRendererDlBeginTight</code>, and <code>\markdownRendererDlEndTight</code> TeX macros.</p>
+<dd><p>Lists whose bullets do not consist of multiple paragraphs will be passed to the <code>\markdownRendererOlBeginTight</code>, <code>\markdownRendererOlEndTight</code>, <code>\markdownRendererUlBeginTight</code>, <code>\markdownRendererUlEndTight</code>, <code>\markdownRendererDlBeginTight</code>, and <code>\markdownRendererDlEndTight</code> <span class="tex">T<sub>e</sub>X</span> macros.</p>
</dd>
</dl>
</dd>
@@ -2482,39 +2778,39 @@ The following list respects the numbers specified in the markup:
</dl>
</dd>
</dl>
-<h6 id="latex-example-19" class="unnumbered">LaTeX example</h6>
-<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-The following list is tight:
-
- - first item
- - second item
- - third item
-
-The following list is loose:
-
- - first item
- - second item that spans
-
- multiple paragraphs
- - third item
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{tightLists=false}
-The following list is now also loose:
-
- - first item
- - second item
- - third item
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
-<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<h5 id="latex-example-20" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb230"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb230-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb230-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb230-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb230-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb230-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb230-6" data-line-number="6">The following list is tight:</a>
+<a class="sourceLine" id="cb230-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb230-8" data-line-number="8"> - first item</a>
+<a class="sourceLine" id="cb230-9" data-line-number="9"> - second item</a>
+<a class="sourceLine" id="cb230-10" data-line-number="10"> - third item</a>
+<a class="sourceLine" id="cb230-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb230-12" data-line-number="12">The following list is loose:</a>
+<a class="sourceLine" id="cb230-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb230-14" data-line-number="14"> - first item</a>
+<a class="sourceLine" id="cb230-15" data-line-number="15"> - second item that spans</a>
+<a class="sourceLine" id="cb230-16" data-line-number="16"></a>
+<a class="sourceLine" id="cb230-17" data-line-number="17"> multiple paragraphs</a>
+<a class="sourceLine" id="cb230-18" data-line-number="18"> - third item</a>
+<a class="sourceLine" id="cb230-19" data-line-number="19"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb230-20" data-line-number="20"></a>
+<a class="sourceLine" id="cb230-21" data-line-number="21"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{tightLists=false}</a>
+<a class="sourceLine" id="cb230-22" data-line-number="22">The following list is now also loose:</a>
+<a class="sourceLine" id="cb230-23" data-line-number="23"></a>
+<a class="sourceLine" id="cb230-24" data-line-number="24"> - first item</a>
+<a class="sourceLine" id="cb230-25" data-line-number="25"> - second item</a>
+<a class="sourceLine" id="cb230-26" data-line-number="26"> - third item</a>
+<a class="sourceLine" id="cb230-27" data-line-number="27"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb230-28" data-line-number="28"></a>
+<a class="sourceLine" id="cb230-29" data-line-number="29"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb231"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb231-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>The following list is tight:</p>
@@ -2537,134 +2833,2114 @@ multiple paragraphs</li>
<li><p>third item</p></li>
</ul>
</blockquote>
-<h5 id="option-underscores"><span class="header-section-number">2.1.2.2.21</span> Option <code>underscores</code></h5>
+<h4 id="option-underscores"><span class="header-section-number">2.2.1.24</span> Option <code>underscores</code></h4>
<dl>
<dt><code>underscores</code> (default value: <code>true</code>)</dt>
<dd><dl>
<dt>true</dt>
<dd><p>Both underscores and asterisks can be used to denote emphasis and strong emphasis:</p>
-<div class="sourceCode"><pre class="sourceCode md"><code class="sourceCode markdown">*single asterisks*
-_single underscores_
-**double asterisks**
-__double underscores__</code></pre></div>
+<div class="sourceCode" id="cb232"><pre class="sourceCode md"><code class="sourceCode markdown"><a class="sourceLine" id="cb232-1" data-line-number="1">*single asterisks*</a>
+<a class="sourceLine" id="cb232-2" data-line-number="2">_single underscores_</a>
+<a class="sourceLine" id="cb232-3" data-line-number="3">**double asterisks**</a>
+<a class="sourceLine" id="cb232-4" data-line-number="4">__double underscores__</a></code></pre></div>
</dd>
</dl>
</dd>
<dd><dl>
<dt>false</dt>
-<dd><p>Only asterisks can be used to denote emphasis and strong emphasis. This makes it easy to write math with the option without the need to constantly escape subscripts.</p>
+<dd><p>Only asterisks can be used to denote emphasis and strong emphasis. This makes it easy to write math with the <strong><code>hybrid</code></strong> option without the need to constantly escape subscripts.</p>
</dd>
</dl>
</dd>
</dl>
-<h6 id="plain-tex-example-9" class="unnumbered">Plain TeX example</h6>
+<h5 id="plain-tex-example-10" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\input</span> markdown
-<span class="fu">\def</span>\markdownOptionHybrid{true}
-
-<span class="fu">\markdownBegin</span>
-This is _emphasized text_ and this is a math subscript: <span class="ss">$m</span><span class="sc">\_</span><span class="ss">n$</span>.
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\def</span>\markdownOptionUnderscores{false}
-<span class="fu">\markdownBegin</span>
-This is *emphasized text* and this is a math subscript: <span class="ss">$m_n$</span>.
-<span class="fu">\markdownEnd</span>
-
-<span class="fu">\bye</span></code></pre></div>
+<div class="sourceCode" id="cb233"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb233-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb233-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionHybrid{true}</a>
+<a class="sourceLine" id="cb233-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb233-4" data-line-number="4"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb233-5" data-line-number="5">This is _emphasized text_ and this is a math subscript: <span class="ss">$m</span><span class="sc">\_</span><span class="ss">n$</span>.</a>
+<a class="sourceLine" id="cb233-6" data-line-number="6"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb233-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb233-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionUnderscores{false}</a>
+<a class="sourceLine" id="cb233-9" data-line-number="9"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb233-10" data-line-number="10">This is *emphasized text* and this is a math subscript: <span class="ss">$m_n$</span>.</a>
+<a class="sourceLine" id="cb233-11" data-line-number="11"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb233-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb233-13" data-line-number="13"><span class="fu">\bye</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">luatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb234"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb234-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>This is <em>emphasized text</em> and this is a math subscript: <em>mₙ</em>.</p>
<p>This is <em>emphasized text</em> and this is a math subscript: <em>mₙ</em>.</p>
</blockquote>
-<h6 id="latex-example-20" class="unnumbered">LaTeX example</h6>
+<h5 id="latex-example-21" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="bu">\documentclass</span>{<span class="ex">article</span>}
-<span class="bu">\usepackage</span>[hybrid]{<span class="ex">markdown</span>}
-<span class="kw">\begin</span>{<span class="ex">document</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown</span>}
-This is _emphasized text_ and this is a math subscript: <span class="ss">$m</span><span class="sc">\_</span><span class="ss">n$</span>.
-<span class="kw">\end</span>{<span class="ex">markdown</span>}
-
-<span class="kw">\begin</span>{<span class="ex">markdown*</span>}{underscores=false}
-This is *emphasized text* and this is a math subscript: <span class="ss">$m_n$</span>.
-<span class="kw">\end</span>{<span class="ex">markdown*</span>}
-
-<span class="kw">\end</span>{<span class="ex">document</span>}</code></pre></div>
+<div class="sourceCode" id="cb235"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb235-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb235-2" data-line-number="2"><span class="bu">\usepackage</span>[hybrid]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb235-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb235-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb235-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb235-6" data-line-number="6">This is _emphasized text_ and this is a math subscript: <span class="ss">$m</span><span class="sc">\_</span><span class="ss">n$</span>.</a>
+<a class="sourceLine" id="cb235-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb235-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb235-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{underscores=false}</a>
+<a class="sourceLine" id="cb235-10" data-line-number="10">This is *emphasized text* and this is a math subscript: <span class="ss">$m_n$</span>.</a>
+<a class="sourceLine" id="cb235-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb235-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb235-13" data-line-number="13"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">lualatex</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb236"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb236-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>This is <em>emphasized text</em> and this is a math subscript: <em>mₙ</em>.</p>
<p>This is <em>emphasized text</em> and this is a math subscript: <em>mₙ</em>.</p>
</blockquote>
-<h6 id="context-example-17" class="unnumbered">ConTeXt example</h6>
+<h5 id="context-example-18" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
-<div class="sourceCode"><pre class="sourceCode tex"><code class="sourceCode latex"><span class="fu">\usemodule</span>[t][markdown]
-<span class="fu">\def</span>\markdownOptionHybrid{true}
-<span class="fu">\starttext</span>
-
-<span class="fu">\startmarkdown</span>
-This is _emphasized text_ and this is a math subscript: <span class="ss">$m</span><span class="sc">\_</span><span class="ss">n$</span>.
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\def</span>\markdownOptionUnderscores{false}
-<span class="fu">\startmarkdown</span>
-This is *emphasized text* and this is a math subscript: <span class="ss">$m_n$</span>.
-<span class="fu">\stopmarkdown</span>
-
-<span class="fu">\stoptext</span></code></pre></div>
+<div class="sourceCode" id="cb237"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb237-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb237-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionHybrid{true}</a>
+<a class="sourceLine" id="cb237-3" data-line-number="3"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb237-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb237-5" data-line-number="5"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb237-6" data-line-number="6">This is _emphasized text_ and this is a math subscript: <span class="ss">$m</span><span class="sc">\_</span><span class="ss">n$</span>.</a>
+<a class="sourceLine" id="cb237-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb237-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb237-9" data-line-number="9"><span class="fu">\def</span>\markdownOptionUnderscores{false}</a>
+<a class="sourceLine" id="cb237-10" data-line-number="10"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb237-11" data-line-number="11">This is *emphasized text* and this is a math subscript: <span class="ss">$m_n$</span>.</a>
+<a class="sourceLine" id="cb237-12" data-line-number="12"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb237-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb237-14" data-line-number="14"><span class="fu">\stoptext</span></a></code></pre></div>
<p>Next, invoke LuaTeX from the terminal:</p>
-<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">context</span> document.tex</code></pre></div>
+<div class="sourceCode" id="cb238"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb238-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
<blockquote>
<p>This is <em>emphasized text</em> and this is a math subscript: <em>mₙ</em>.</p>
<p>This is <em>emphasized text</em> and this is a math subscript: <em>mₙ</em>.</p>
</blockquote>
-<h2 id="plain-tex"><span class="header-section-number">2.2</span> Plain TeX</h2>
-<p>The plain TeX macro package provides TeX commands for typesetting markdown documents that invoke the Lua parser in the background. Beside TeX commands that correspond to the Lua options, the macro package also provides commands corresponding to additional plain TeX-specific options, and so-called <em>token renderer</em> commands that define how the individual markdown elements will be typeset.</p>
-<h3 id="interfaces-1"><span class="header-section-number">2.2.1</span> Interfaces</h3>
-<!-- TODO -->
-<h3 id="options-1"><span class="header-section-number">2.2.2</span> Options</h3>
-<!-- TODO -->
-<h3 id="token-renderers"><span class="header-section-number">2.2.3</span> Token renderers</h3>
-<!-- TODO -->
-<h2 id="latex"><span class="header-section-number">2.3</span> LaTeX</h2>
-<p>The LaTeX macro package provides additional syntactic sugar on top of the plain TeX macro package and provides sane default definitions of the token renderers.</p>
-<!-- TODO -->
-<h3 id="interfaces-2"><span class="header-section-number">2.3.1</span> Interfaces</h3>
-<!-- TODO -->
-<h3 id="options-2"><span class="header-section-number">2.3.2</span> Options</h3>
-<!-- TODO -->
-<h3 id="token-renderers-1"><span class="header-section-number">2.3.3</span> Token renderers</h3>
-<!-- TODO -->
-<h2 id="context"><span class="header-section-number">2.4</span> ConTeXt</h2>
-<p>The ConTeXt macro package provides additional syntactic sugar on top of the plain TeX macro package and provides sane default definitions of the token renderers.</p>
-<h3 id="interfaces-3"><span class="header-section-number">2.4.1</span> Interfaces</h3>
-<!-- TODO -->
-<h3 id="options-3"><span class="header-section-number">2.4.2</span> Options</h3>
-<!-- TODO -->
-<h3 id="token-renderers-2"><span class="header-section-number">2.4.3</span> Token renderers</h3>
-<!-- TODO -->
-<div class="footnotes">
+<h3 id="plain-tex-1"><span class="header-section-number">2.2.2</span> Plain <span class="tex">T<sub>e</sub>X</span></h3>
+<p>Plain <span class="tex">T<sub>e</sub>X</span> options control the communication between the <span class="tex">T<sub>e</sub>X</span> interface and the <code>markdown</code> Lua module. They are supported by all higher-level interfaces of the Markdown package, i.e. the plain <span class="tex">T<sub>e</sub>X</span>, <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> and Con<span class="tex">T<sub>e</sub>X</span>t interfaces.</p>
+<h4 id="file-and-directory-names"><span class="header-section-number">2.2.2.1</span> File and Directory Names</h4>
+<p>The plain <span class="tex">T<sub>e</sub>X</span> interface provides the following commands that you can use to specify the location of temporary files produced during the conversion from Markdown to <span class="tex">T<sub>e</sub>X</span>:</p>
+<ul>
+<li><code>\markdownOptionHelperScriptFileName</code>,</li>
+<li><code>\markdownOptionInputTempFileName</code>,</li>
+<li><code>\markdownOptionOutputTempFileName</code>,</li>
+<li><code>\markdownOptionErrorTempFileName</code>,</li>
+<li><code>\markdownOptionOutputDir</code>, and</li>
+<li><code>\markdownOptionCacheDir</code>.</li>
+</ul>
+<p>Using a text editor, create a folder named <code>output-directory</code> and a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb239"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb239-1" data-line-number="1"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb239-2" data-line-number="2"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb239-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionHelperScriptFileName{helper-script.lua}</a>
+<a class="sourceLine" id="cb239-4" data-line-number="4"><span class="fu">\def</span>\markdownOptionInputTempFileName{temporary-input.md}</a>
+<a class="sourceLine" id="cb239-5" data-line-number="5"><span class="fu">\def</span>\markdownOptionOutputTempFileName{temporary-output.tex}</a>
+<a class="sourceLine" id="cb239-6" data-line-number="6"><span class="fu">\def</span>\markdownOptionErrorTempFileName{error-output.txt}</a>
+<a class="sourceLine" id="cb239-7" data-line-number="7"><span class="fu">\def</span>\markdownOptionOutputDir{output-directory}</a>
+<a class="sourceLine" id="cb239-8" data-line-number="8"><span class="fu">\def</span>\markdownOptionCacheDir{output-directory/cache-directory}</a>
+<a class="sourceLine" id="cb239-9" data-line-number="9"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb239-10" data-line-number="10">Hello *world*!</a>
+<a class="sourceLine" id="cb239-11" data-line-number="11"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb239-12" data-line-number="12"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb240"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb240-1" data-line-number="1"><span class="ex">luatex</span> --output-directory output-directory document.tex</a></code></pre></div>
+<p>A text document named <code>temporary-input.md</code> should be produced in the folder named <code>output-directory</code> and contain the following text:</p>
+<blockquote>
+<p>Hello *world*!</p>
+</blockquote>
+<p>A folder named <code>output-directory/cache-directory</code> should also be produced and contain fragments of the converted markdown document. LuaTeX does not need other temporary files to perform the conversion from markdown to <span class="tex">T<sub>e</sub>X</span>. To produce the remaining temporary files, invoke pdfTeX from the terminal:</p>
+<div class="sourceCode" id="cb241"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb241-1" data-line-number="1"><span class="ex">pdftex</span> --output-directory output-directory --shell-escape document.tex</a></code></pre></div>
+<p>Text documents named <code>helper-script.lua</code>, and <code>temporary-output.md</code> should be produced in the folder named <code>output-directory</code>. The document named <code>helper-script.lua</code> will contain Lua code that was executed to convert markdown to plain <span class="tex">T<sub>e</sub>X</span>. The document named <code>temporary-output.tex</code> will contain the input markdown document converted to <span class="tex">T<sub>e</sub>X</span>.</p>
+<p>No document named <code>error-output.txt</code> should be produced in the folder named <code>output-directory</code>. This document would only be produced if an error had occured while executing the Lua code. If this happens, please <a href="https://github.com/witiko/markdown/issues">file a bug</a>.</p>
+<h4 id="package-documentation"><span class="header-section-number">2.2.2.2</span> Package Documentation</h4>
+<p>The <code>\markdownOptionStripPercentSigns</code> macro controls whether a percent sign (<code>%</code>) at the beginning of a line will be discarded when reading Markdown input from a <span class="tex">T<sub>e</sub>X</span> document. This enables the use of markdown when writing <span class="tex">T<sub>e</sub>X</span> package documentation using the <a href="https://ctan.org/pkg/doc" title="doc – Format LaTeX documentation">Doc <span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> package</a> by Frank Mittelbach.</p>
+<p>Using a text editor, create a text document named <code>document.dtx</code> with the following content:</p>
+<div class="sourceCode" id="cb242"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb242-1" data-line-number="1"><span class="co">% \iffalse</span></a>
+<a class="sourceLine" id="cb242-2" data-line-number="2"><span class="bu">\documentclass</span>{<span class="ex">ltxdoc</span>}</a>
+<a class="sourceLine" id="cb242-3" data-line-number="3"><span class="bu">\usepackage</span>[stripPercentSigns]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb242-4" data-line-number="4"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb242-5" data-line-number="5"><span class="fu">\DocInput</span>{document.dtx}</a>
+<a class="sourceLine" id="cb242-6" data-line-number="6"><span class="kw">\end</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb242-7" data-line-number="7"><span class="co">% \fi</span></a>
+<a class="sourceLine" id="cb242-8" data-line-number="8"><span class="co">%</span></a>
+<a class="sourceLine" id="cb242-9" data-line-number="9"><span class="co">% \begin{markdown}</span></a>
+<a class="sourceLine" id="cb242-10" data-line-number="10"><span class="co">% Hello *world*!</span></a>
+<a class="sourceLine" id="cb242-11" data-line-number="11"><span class="co">% \end{markdown}</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb243"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb243-1" data-line-number="1"><span class="ex">lualatex</span> document.dtx</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the text “Hello <em>world</em>!”</p>
+<h2 id="markdown-tokens"><span class="header-section-number">2.3</span> Markdown Tokens</h2>
+<p>A key feature of the Markdown package is the support for manipulating markdown tokens, such as headings, emphasized text, links, and lists, in <span class="tex">T<sub>e</sub>X</span>. Instead of reducing <span class="tex">T<sub>e</sub>X</span> to a PDF document producer, the Markdown package allows the user to specify how every markdown token should be processed and rendered.</p>
+<h3 id="token-renderers"><span class="header-section-number">2.3.1</span> Token Renderers</h3>
+<p>Token renderers are user-defined <span class="tex">T<sub>e</sub>X</span> macros, which render markdown tokens. In this section, I will describe the individual token renderers.</p>
+<h4 id="interblock-separator-renderer"><span class="header-section-number">2.3.1.1</span> Interblock Separator Renderer</h4>
+<p>The <code>\markdownRendererInterblockSeparator</code> macro represents a separator between two markdown block elements. The macro receives no arguments.</p>
+<h5 id="plain-tex-example-11" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb244"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb244-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb244-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb244-3" data-line-number="3"> \par</a>
+<a class="sourceLine" id="cb244-4" data-line-number="4"> {\it(The end of a block)}<span class="co">%</span></a>
+<a class="sourceLine" id="cb244-5" data-line-number="5"> \par</a>
+<a class="sourceLine" id="cb244-6" data-line-number="6">}</a>
+<a class="sourceLine" id="cb244-7" data-line-number="7"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb244-8" data-line-number="8">Hello *world*!</a>
+<a class="sourceLine" id="cb244-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb244-10" data-line-number="10">_Foo_ bar!</a>
+<a class="sourceLine" id="cb244-11" data-line-number="11"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb244-12" data-line-number="12"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb245"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb245-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Hello <em>world</em>!</p>
+<p><em>(The end of a block)</em></p>
+<p><em>Foo</em> bar!</p>
+</blockquote>
+<h5 id="latex-example-22" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb246"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb246-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb246-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb246-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb246-4" data-line-number="4"> renderers = {</a>
+<a class="sourceLine" id="cb246-5" data-line-number="5"> interblockSeparator = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb246-6" data-line-number="6"> <span class="fu">\par</span></a>
+<a class="sourceLine" id="cb246-7" data-line-number="7"> <span class="fu">\emph</span>{(The end of a block)}<span class="co">%</span></a>
+<a class="sourceLine" id="cb246-8" data-line-number="8"> <span class="fu">\par</span></a>
+<a class="sourceLine" id="cb246-9" data-line-number="9"> },</a>
+<a class="sourceLine" id="cb246-10" data-line-number="10"> },</a>
+<a class="sourceLine" id="cb246-11" data-line-number="11">}</a>
+<a class="sourceLine" id="cb246-12" data-line-number="12"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb246-13" data-line-number="13"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb246-14" data-line-number="14">Hello *world*!</a>
+<a class="sourceLine" id="cb246-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb246-16" data-line-number="16">_Foo_ bar!</a>
+<a class="sourceLine" id="cb246-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb246-18" data-line-number="18"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb247"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb247-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Hello <em>world</em>!</p>
+<p><em>(The end of a block)</em></p>
+<p><em>Foo</em> bar!</p>
+</blockquote>
+<h5 id="context-example-19" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb248"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb248-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb248-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb248-3" data-line-number="3"> \par</a>
+<a class="sourceLine" id="cb248-4" data-line-number="4"> \emph{(The end of a block)}<span class="co">%</span></a>
+<a class="sourceLine" id="cb248-5" data-line-number="5"> \par</a>
+<a class="sourceLine" id="cb248-6" data-line-number="6">}</a>
+<a class="sourceLine" id="cb248-7" data-line-number="7"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb248-8" data-line-number="8"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb248-9" data-line-number="9">Hello *world*!</a>
+<a class="sourceLine" id="cb248-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb248-11" data-line-number="11">_Foo_ bar!</a>
+<a class="sourceLine" id="cb248-12" data-line-number="12"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb248-13" data-line-number="13"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb249"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb249-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Hello <em>world</em>!</p>
+<p><em>(The end of a block)</em></p>
+<p><em>Foo</em> bar!</p>
+</blockquote>
+<h4 id="line-break-renderer"><span class="header-section-number">2.3.1.2</span> Line Break Renderer</h4>
+<p>The <code>\markdownRendererLineBreak</code> macro represents a forced line break. The macro receives no arguments.</p>
+<h5 id="plain-tex-example-12" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb250"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb250-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb250-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererLineBreak{<span class="co">%</span></a>
+<a class="sourceLine" id="cb250-3" data-line-number="3"> \par</a>
+<a class="sourceLine" id="cb250-4" data-line-number="4"> {\it(A forced linebreak)}<span class="co">%</span></a>
+<a class="sourceLine" id="cb250-5" data-line-number="5"> \par</a>
+<a class="sourceLine" id="cb250-6" data-line-number="6">}</a>
+<a class="sourceLine" id="cb250-7" data-line-number="7"><span class="fu">\markdownInput</span>{example.md}</a>
+<a class="sourceLine" id="cb250-8" data-line-number="8"><span class="fu">\bye</span></a></code></pre></div>
+<p>Using a text editor, create a text document named <code>example.md</code> with the following content. Note the two spaces at the end of the first line, which specify a hard linebreak. Due to the limitations of the <span class="tex">T<sub>e</sub>X</span> input processor, hard linebreaks would be ignored if we typed them directly into the <code>document.tex</code> document.</p>
+<pre><code>Hello world! <br/>_Foo_ bar!</code></pre>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb251"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb251-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Hello <em>world</em>!</p>
+<p><em>(A forced linebreak)</em></p>
+<p><em>Foo</em> bar!</p>
+</blockquote>
+<h5 id="latex-example-23" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb252"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb252-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb252-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb252-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb252-4" data-line-number="4"> renderers = {</a>
+<a class="sourceLine" id="cb252-5" data-line-number="5"> lineBreak = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb252-6" data-line-number="6"> <span class="fu">\par</span></a>
+<a class="sourceLine" id="cb252-7" data-line-number="7"> <span class="fu">\emph</span>{(A forced linebreak)}<span class="co">%</span></a>
+<a class="sourceLine" id="cb252-8" data-line-number="8"> <span class="fu">\par</span></a>
+<a class="sourceLine" id="cb252-9" data-line-number="9"> },</a>
+<a class="sourceLine" id="cb252-10" data-line-number="10"> },</a>
+<a class="sourceLine" id="cb252-11" data-line-number="11">}</a>
+<a class="sourceLine" id="cb252-12" data-line-number="12"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb252-13" data-line-number="13"><span class="fu">\markdownInput</span>{example.md}</a>
+<a class="sourceLine" id="cb252-14" data-line-number="14"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Using a text editor, create a text document named <code>example.md</code> with the following content. Note the two spaces at the end of the first line, which specify a hard linebreak. Due to the limitations of the <span class="tex">T<sub>e</sub>X</span> input processor, hard linebreaks would be ignored if we typed them directly into the <code>document.tex</code> document.</p>
+<pre><code>Hello world! <br/>_Foo_ bar!</code></pre>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb253"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb253-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Hello <em>world</em>!</p>
+<p><em>(A forced linebreak)</em></p>
+<p><em>Foo</em> bar!</p>
+</blockquote>
+<h5 id="context-example-20" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb254"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb254-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb254-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererLineBreak{<span class="co">%</span></a>
+<a class="sourceLine" id="cb254-3" data-line-number="3"> \par</a>
+<a class="sourceLine" id="cb254-4" data-line-number="4"> \emph{(A forced linebreak)}<span class="co">%</span></a>
+<a class="sourceLine" id="cb254-5" data-line-number="5"> \par</a>
+<a class="sourceLine" id="cb254-6" data-line-number="6">}</a>
+<a class="sourceLine" id="cb254-7" data-line-number="7"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb254-8" data-line-number="8"><span class="fu">\markdownInput</span>{example.md}</a>
+<a class="sourceLine" id="cb254-9" data-line-number="9"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Using a text editor, create a text document named <code>example.md</code> with the following content. Note the two spaces at the end of the first line, which specify a hard linebreak. Due to the limitations of the <span class="tex">T<sub>e</sub>X</span> input processor, hard linebreaks would be ignored if we typed them directly into the <code>document.tex</code> document.</p>
+<pre><code>Hello world! <br/>_Foo_ bar!</code></pre>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb255"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb255-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Hello <em>world</em>!</p>
+<p><em>(A forced linebreak)</em></p>
+<p><em>Foo</em> bar!</p>
+</blockquote>
+<h4 id="ellipsis-renderer"><span class="header-section-number">2.3.1.3</span> Ellipsis Renderer</h4>
+<p>The <code>\markdownRendererEllipsis</code> macro replaces any occurance of ASCII ellipses in the input text. This macro will only be produced, when the <strong><code>smartEllipses</code></strong> option is <code>true</code>. The macro receives no arguments.</p>
+<h5 id="plain-tex-example-13" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb256"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb256-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb256-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionSmartEllipses{true}</a>
+<a class="sourceLine" id="cb256-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererEllipsis{{\it SHAZAM}!}</a>
+<a class="sourceLine" id="cb256-4" data-line-number="4"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb256-5" data-line-number="5">The secret word is ...</a>
+<a class="sourceLine" id="cb256-6" data-line-number="6"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb256-7" data-line-number="7"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb257"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb257-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>The secret word is <em>SHAZAM</em>!</p>
+</blockquote>
+<h5 id="latex-example-24" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb258"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb258-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb258-2" data-line-number="2"><span class="bu">\usepackage</span>[smartEllipses]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb258-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb258-4" data-line-number="4"> renderers = {</a>
+<a class="sourceLine" id="cb258-5" data-line-number="5"> ellipsis = <span class="fu">\emph</span>{SHAZAM}!,</a>
+<a class="sourceLine" id="cb258-6" data-line-number="6"> },</a>
+<a class="sourceLine" id="cb258-7" data-line-number="7">}</a>
+<a class="sourceLine" id="cb258-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb258-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb258-10" data-line-number="10">The secret word is ...</a>
+<a class="sourceLine" id="cb258-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb258-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb259"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb259-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>The secret word is <em>SHAZAM</em>!</p>
+</blockquote>
+<h5 id="context-example-21" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb260"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb260-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb260-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionSmartEllipses{true}</a>
+<a class="sourceLine" id="cb260-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererEllipsis{\emph{SHAZAM}!}</a>
+<a class="sourceLine" id="cb260-4" data-line-number="4"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb260-5" data-line-number="5"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb260-6" data-line-number="6">The secret word is ...</a>
+<a class="sourceLine" id="cb260-7" data-line-number="7"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb260-8" data-line-number="8"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb261"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb261-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Hello <em>world</em>!</p>
+<p><em>(The end of a block)</em></p>
+<p><em>Foo</em> bar!</p>
+</blockquote>
+<h4 id="non-breaking-space-renderer"><span class="header-section-number">2.3.1.4</span> Non-Breaking Space Renderer</h4>
+<p>The <code>\markdownRendererNbsp</code> macro represents a non-breaking space.</p>
+<h5 id="latex-example-25" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.bib</code> with the following content:</p>
+<div class="sourceCode" id="cb262"><pre class="sourceCode bib"><code class="sourceCode bibtex"><a class="sourceLine" id="cb262-1" data-line-number="1"><span class="va">@book</span>{<span class="ot">knuth:tex</span>,</a>
+<a class="sourceLine" id="cb262-2" data-line-number="2"> <span class="dt">author</span> = &quot;<span class="st">Knuth, Donald Ervin</span>&quot;,</a>
+<a class="sourceLine" id="cb262-3" data-line-number="3"> <span class="dt">title</span> = &quot;<span class="st">The </span><span class="ch">\TeX</span><span class="st"> book, volume A of Computers and typesetting</span>&quot;,</a>
+<a class="sourceLine" id="cb262-4" data-line-number="4"> <span class="dt">publisher</span> = &quot;<span class="st">Addison-Wesley</span>&quot;,</a>
+<a class="sourceLine" id="cb262-5" data-line-number="5"> <span class="dt">year</span> = &quot;<span class="st">1984</span>&quot;</a>
+<a class="sourceLine" id="cb262-6" data-line-number="6">}</a></code></pre></div>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb263"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb263-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb263-2" data-line-number="2"><span class="bu">\usepackage</span>[</a>
+<a class="sourceLine" id="cb263-3" data-line-number="3"> citations,</a>
+<a class="sourceLine" id="cb263-4" data-line-number="4"> citationNbsps,</a>
+<a class="sourceLine" id="cb263-5" data-line-number="5">]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb263-6" data-line-number="6"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb263-7" data-line-number="7"> renderers = {</a>
+<a class="sourceLine" id="cb263-8" data-line-number="8"> nbsp = {<span class="ss">$</span><span class="sc">\cdot</span><span class="ss">$</span>},</a>
+<a class="sourceLine" id="cb263-9" data-line-number="9"> },</a>
+<a class="sourceLine" id="cb263-10" data-line-number="10">}</a>
+<a class="sourceLine" id="cb263-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb263-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb263-13" data-line-number="13"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb263-14" data-line-number="14">The TeXbook [@knuth:tex, p. 123 and 130] is good.</a>
+<a class="sourceLine" id="cb263-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb263-16" data-line-number="16"></a>
+<a class="sourceLine" id="cb263-17" data-line-number="17"><span class="bu">\bibliographystyle</span>{<span class="ex">plain</span>}</a>
+<a class="sourceLine" id="cb263-18" data-line-number="18"><span class="bu">\bibliography</span>{<span class="ex">document.bib</span>}</a>
+<a class="sourceLine" id="cb263-19" data-line-number="19"></a>
+<a class="sourceLine" id="cb263-20" data-line-number="20"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX and BibTeX from the terminal:</p>
+<div class="sourceCode" id="cb264"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb264-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a>
+<a class="sourceLine" id="cb264-2" data-line-number="2"><span class="ex">bibtex</span> document.aux</a>
+<a class="sourceLine" id="cb264-3" data-line-number="3"><span class="ex">lualatex</span> document.tex</a>
+<a class="sourceLine" id="cb264-4" data-line-number="4"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>The TeXbook [1, p.·123·and·130] is good.</p>
+<h3 id="references-2">References</h3>
+<p>[1] Donald Ervin Knuth. <em>The TeXbook, volume A of Computers and typesetting.</em> Addison-Wesley, 1984.</p>
+</blockquote>
+<h4 id="special-character-renderers"><span class="header-section-number">2.3.1.5</span> Special Character Renderers</h4>
+<p>The following macros replace any special plain <span class="tex">T<sub>e</sub>X</span> characters, including the active pipe character (<code>|</code>) of Con<span class="tex">T<sub>e</sub>X</span>t, in the input text:</p>
+<ul>
+<li><code>\markdownRendererAmpersand</code> replaces the ampersand (<code>&amp;</code>).</li>
+<li><code>\markdownRendererBackslash</code> replaces the backslash (<code>\</code>).</li>
+<li><code>\markdownRendererCircumflex</code> replaces the circumflex (<code>^</code>).</li>
+<li><code>\markdownRendererDollarSign</code> replaces the dollar sign (<code>$</code>).</li>
+<li><code>\markdownRendererHash</code> replaces the hash sign (<code>#</code>).</li>
+<li><code>\markdownRendererLeftBrace</code> replaces the left brace (<code>{</code>).</li>
+<li><code>\markdownRendererPercentSign</code> replaces the percent sign (<code>%</code>).</li>
+<li><code>\markdownRendererPipe</code> replaces the pipe character (<code>|</code>).</li>
+<li><code>\markdownRendererRightBrace</code> replaces the right brace (<code>}</code>).</li>
+<li><code>\markdownRendererTilde</code> replaces the tilde (<code>~</code>).</li>
+<li><code>\markdownRendererUnderscore</code> replaces the underscore (<code>_</code>).</li>
+</ul>
+<h5 id="plain-tex-example-14" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content. We will make the tilde behave as if it were written in <span class="tex">T<sub>e</sub>X</span>, where it represents a non-breaking space.</p>
+<div class="sourceCode" id="cb265"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb265-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb265-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererTilde{~}</a>
+<a class="sourceLine" id="cb265-3" data-line-number="3"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb265-4" data-line-number="4">Bartel~Leendert van~der~Waerden</a>
+<a class="sourceLine" id="cb265-5" data-line-number="5"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb265-6" data-line-number="6"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb266"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb266-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text, where the middot (<code>·</code>) denotes a non-breakable space:</p>
+<blockquote>
+<p>Bartel·Leendert van·der·Waerden</p>
+</blockquote>
+<h5 id="latex-example-26" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content. We will make the tilde behave as if it were written in <span class="tex">T<sub>e</sub>X</span>, where it represents a non-breaking space.</p>
+<div class="sourceCode" id="cb267"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb267-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb267-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb267-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb267-4" data-line-number="4"> renderers = {</a>
+<a class="sourceLine" id="cb267-5" data-line-number="5"> tilde = ~,</a>
+<a class="sourceLine" id="cb267-6" data-line-number="6"> },</a>
+<a class="sourceLine" id="cb267-7" data-line-number="7">}</a>
+<a class="sourceLine" id="cb267-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb267-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb267-10" data-line-number="10">Bartel~Leendert van~der~Waerden</a>
+<a class="sourceLine" id="cb267-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb267-12" data-line-number="12"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb268"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb268-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text, where the middot (<code>·</code>) denotes a non-breakable space:</p>
+<blockquote>
+<p>Bartel·Leendert van·der·Waerden</p>
+</blockquote>
+<h5 id="context-example-22" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content. We will make the tilde behave as if it were written in <span class="tex">T<sub>e</sub>X</span>, where it represents a non-breaking space.</p>
+<div class="sourceCode" id="cb269"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb269-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb269-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererTilde{~}</a>
+<a class="sourceLine" id="cb269-3" data-line-number="3"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb269-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb269-5" data-line-number="5">Bartel~Leendert van~der~Waerden</a>
+<a class="sourceLine" id="cb269-6" data-line-number="6"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb269-7" data-line-number="7"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb270"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb270-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text, where the middot (<code>·</code>) denotes a non-breakable space:</p>
+<blockquote>
+<p>Bartel·Leendert van·der·Waerden</p>
+</blockquote>
+<h4 id="code-span-renderer"><span class="header-section-number">2.3.1.6</span> Code Span Renderer</h4>
+<p>The <code>\markdownRendererCodeSpan</code> macro represents inlined code span in the input text. It receives a single argument that corresponds to the inlined code span.</p>
+<h5 id="plain-tex-example-15" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb271"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb271-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb271-2" data-line-number="2"><span class="fu">\input</span> lmfonts</a>
+<a class="sourceLine" id="cb271-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb271-4" data-line-number="4"><span class="fu">\def</span>\markdownRendererCodeSpan#1{#1}</a>
+<a class="sourceLine" id="cb271-5" data-line-number="5"></a>
+<a class="sourceLine" id="cb271-6" data-line-number="6"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb271-7" data-line-number="7">`<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>`</a>
+<a class="sourceLine" id="cb271-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb271-9" data-line-number="9"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a>
+<a class="sourceLine" id="cb271-10" data-line-number="10"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb271-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb271-12" data-line-number="12"><span class="fu">\def</span>\markdownOptionHybrid{true}</a>
+<a class="sourceLine" id="cb271-13" data-line-number="13"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb271-14" data-line-number="14"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a>
+<a class="sourceLine" id="cb271-15" data-line-number="15"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb271-16" data-line-number="16"></a>
+<a class="sourceLine" id="cb271-17" data-line-number="17"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb272"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb272-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>$\sqrt{-1}$ *equals* $i$.</p>
+<p>$\sqrt{-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+</blockquote>
+<h5 id="latex-example-27" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb273"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb273-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb273-2" data-line-number="2"><span class="bu">\usepackage</span>[smartEllipses]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb273-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb273-4" data-line-number="4"> renderers = {</a>
+<a class="sourceLine" id="cb273-5" data-line-number="5"> codeSpan = {#1},</a>
+<a class="sourceLine" id="cb273-6" data-line-number="6"> },</a>
+<a class="sourceLine" id="cb273-7" data-line-number="7">}</a>
+<a class="sourceLine" id="cb273-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb273-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb273-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb273-11" data-line-number="11">`<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>`</a>
+<a class="sourceLine" id="cb273-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb273-13" data-line-number="13"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a>
+<a class="sourceLine" id="cb273-14" data-line-number="14"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb273-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb273-16" data-line-number="16"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{hybrid}</a>
+<a class="sourceLine" id="cb273-17" data-line-number="17"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a>
+<a class="sourceLine" id="cb273-18" data-line-number="18"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb273-19" data-line-number="19"></a>
+<a class="sourceLine" id="cb273-20" data-line-number="20"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb274"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb274-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>$\sqrt{-1}$ *equals* $i$.</p>
+<p>$\sqrt{-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+</blockquote>
+<h5 id="context-example-23" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb275"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb275-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb275-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererCodeSpan#1{#1}</a>
+<a class="sourceLine" id="cb275-3" data-line-number="3"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb275-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb275-5" data-line-number="5"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb275-6" data-line-number="6">`<span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span>`</a>
+<a class="sourceLine" id="cb275-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb275-8" data-line-number="8"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a>
+<a class="sourceLine" id="cb275-9" data-line-number="9"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb275-10" data-line-number="10"></a>
+<a class="sourceLine" id="cb275-11" data-line-number="11"><span class="fu">\def</span>\markdownOptionHybrid{true}</a>
+<a class="sourceLine" id="cb275-12" data-line-number="12"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb275-13" data-line-number="13"><span class="ss">$</span><span class="sc">\sqrt</span><span class="ss">{-1}$</span> *equals* <span class="ss">$i$</span></a>
+<a class="sourceLine" id="cb275-14" data-line-number="14"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb275-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb275-16" data-line-number="16"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb276"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb276-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>$\sqrt{-1}$ *equals* $i$.</p>
+<p>$\sqrt{-1}$ <em>equals</em> $i$.</p>
+<p>√-̅1̅ <em>equals</em> <span class="math inline"><em>i</em></span>.</p>
+</blockquote>
+<h4 id="link-renderer"><span class="header-section-number">2.3.1.7</span> Link Renderer</h4>
+<p>The <code>\markdownRendererLink</code> macro represents a hyperlink. It receives four arguments: the label, the fully escaped <abbr>uri</abbr> that can be directly typeset, the raw <abbr>uri</abbr> that can be used outside typesetting, and the title of the link.</p>
+<h5 id="plain-tex-example-16" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb277"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb277-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb277-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererLink#1#2#3#4{<span class="co">%</span></a>
+<a class="sourceLine" id="cb277-3" data-line-number="3"> #1 {\tt#2} titled {\it#4}<span class="co">%</span></a>
+<a class="sourceLine" id="cb277-4" data-line-number="4">}</a>
+<a class="sourceLine" id="cb277-5" data-line-number="5"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb277-6" data-line-number="6">Please visit [the link][ctan].</a>
+<a class="sourceLine" id="cb277-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb277-8" data-line-number="8"> [ctan]: https://ctan.org/</a>
+<a class="sourceLine" id="cb277-9" data-line-number="9"> (the Comprehensive TeX Archive Network)</a>
+<a class="sourceLine" id="cb277-10" data-line-number="10"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb277-11" data-line-number="11"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb278"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb278-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Please visit the link <a href="https://ctan.org/" class="uri">https://ctan.org/</a> titled <em>the Comprehensive TeX Archive Network</em>.</p>
+</blockquote>
+<h5 id="latex-example-28" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb279"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb279-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb279-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb279-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb279-4" data-line-number="4"> renderers = {</a>
+<a class="sourceLine" id="cb279-5" data-line-number="5"> link = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb279-6" data-line-number="6"> #1 <span class="fu">\texttt</span>{#2} titled <span class="fu">\emph</span>{#4}<span class="co">%</span></a>
+<a class="sourceLine" id="cb279-7" data-line-number="7"> },</a>
+<a class="sourceLine" id="cb279-8" data-line-number="8"> },</a>
+<a class="sourceLine" id="cb279-9" data-line-number="9">}</a>
+<a class="sourceLine" id="cb279-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb279-11" data-line-number="11"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb279-12" data-line-number="12">Please visit [the link][ctan].</a>
+<a class="sourceLine" id="cb279-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb279-14" data-line-number="14"> [ctan]: https://ctan.org/</a>
+<a class="sourceLine" id="cb279-15" data-line-number="15"> (the Comprehensive TeX Archive Network)</a>
+<a class="sourceLine" id="cb279-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb279-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb280"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb280-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Please visit the link <a href="https://ctan.org/" class="uri">https://ctan.org/</a> titled <em>the Comprehensive TeX Archive Network</em>.</p>
+</blockquote>
+<h5 id="context-example-24" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb281"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb281-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb281-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererLink#1#2#3#4{<span class="co">%</span></a>
+<a class="sourceLine" id="cb281-3" data-line-number="3"> #1 {\tt#2} titled \emph{#4}<span class="co">%</span></a>
+<a class="sourceLine" id="cb281-4" data-line-number="4">}</a>
+<a class="sourceLine" id="cb281-5" data-line-number="5"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb281-6" data-line-number="6"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb281-7" data-line-number="7">Please visit [the link][ctan].</a>
+<a class="sourceLine" id="cb281-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb281-9" data-line-number="9"> [ctan]: https://ctan.org/</a>
+<a class="sourceLine" id="cb281-10" data-line-number="10"> (the Comprehensive TeX Archive Network)</a>
+<a class="sourceLine" id="cb281-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb281-12" data-line-number="12"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb282"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb282-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Please visit the link <a href="https://ctan.org/" class="uri">https://ctan.org/</a> titled <em>the Comprehensive TeX Archive Network</em>.</p>
+</blockquote>
+<h4 id="image-renderer"><span class="header-section-number">2.3.1.8</span> Image Renderer</h4>
+<p>The <code>\markdownRendererImage</code> macro represents an image. It receives four arguments: the label, the fully escaped <abbr>uri</abbr> that can be directly typeset, the raw <abbr>uri</abbr> that can be used outside typesetting, and the title of the link.</p>
+<h5 id="latex-example-29" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb283"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb283-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb283-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb283-3" data-line-number="3"><span class="fu">\begingroup</span></a>
+<a class="sourceLine" id="cb283-4" data-line-number="4"><span class="fu">\catcode</span>`<span class="fu">\@</span>=11</a>
+<a class="sourceLine" id="cb283-5" data-line-number="5"><span class="fu">\catcode</span>`<span class="fu">\%</span>=12</a>
+<a class="sourceLine" id="cb283-6" data-line-number="6"><span class="fu">\catcode</span>`<span class="fu">\^</span>^A=14</a>
+<a class="sourceLine" id="cb283-7" data-line-number="7"><span class="fu">\global\def</span>\markdownRendererImage#1#2#3#4{^^A</a>
+<a class="sourceLine" id="cb283-8" data-line-number="8"> \immediate\write18{^^A</a>
+<a class="sourceLine" id="cb283-9" data-line-number="9"> if printf &#39;<span class="co">%s&#39; &quot;#3&quot; | grep -q ^http; then</span></a>
+<a class="sourceLine" id="cb283-10" data-line-number="10"> OUTPUT=&quot;$(printf &#39;<span class="co">%s&#39; &quot;#3&quot; | md5sum | cut -d&#39; &#39; -f1).^^A</span></a>
+<a class="sourceLine" id="cb283-11" data-line-number="11"> $(printf &#39;<span class="co">%s&#39; &quot;#3&quot; | sed &#39;s/.*[.]//&#39;)&quot;;</span></a>
+<a class="sourceLine" id="cb283-12" data-line-number="12"> if ! [ -e &quot;$OUTPUT&quot; ]; then</a>
+<a class="sourceLine" id="cb283-13" data-line-number="13"> wget -O &quot;$OUTPUT&quot; &#39;#3&#39; || rm &quot;$OUTPUT&quot;;</a>
+<a class="sourceLine" id="cb283-14" data-line-number="14"> convert &quot;$OUTPUT&quot; png:&quot;$OUTPUT&quot;;</a>
+<a class="sourceLine" id="cb283-15" data-line-number="15"> fi;</a>
+<a class="sourceLine" id="cb283-16" data-line-number="16"> printf &#39;<span class="co">%s%%&#39; &quot;$OUTPUT&quot; &gt; \jobname.fetched;</span></a>
+<a class="sourceLine" id="cb283-17" data-line-number="17"> else</a>
+<a class="sourceLine" id="cb283-18" data-line-number="18"> printf &#39;<span class="co">%s%%&#39; &quot;#3&quot; &gt; \jobname.fetched;</span></a>
+<a class="sourceLine" id="cb283-19" data-line-number="19"> fi^^A</a>
+<a class="sourceLine" id="cb283-20" data-line-number="20"> }^^A</a>
+<a class="sourceLine" id="cb283-21" data-line-number="21"> {^^A</a>
+<a class="sourceLine" id="cb283-22" data-line-number="22"> \everyeof={\noexpand}^^A</a>
+<a class="sourceLine" id="cb283-23" data-line-number="23"> \edef\filename{\@@input&quot;\jobname.fetched&quot; }^^A</a>
+<a class="sourceLine" id="cb283-24" data-line-number="24"> \includegraphics[width=\textwidth]{\filename}^^A</a>
+<a class="sourceLine" id="cb283-25" data-line-number="25"> }^^A</a>
+<a class="sourceLine" id="cb283-26" data-line-number="26">}</a>
+<a class="sourceLine" id="cb283-27" data-line-number="27"><span class="fu">\endgroup</span></a>
+<a class="sourceLine" id="cb283-28" data-line-number="28"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb283-29" data-line-number="29"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb283-30" data-line-number="30">![TUGboat](https://tug.org/tugboat/noword.jpg)</a>
+<a class="sourceLine" id="cb283-31" data-line-number="31"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb283-32" data-line-number="32"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb284"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb284-1" data-line-number="1"><span class="ex">lualatex</span> --shell-escape document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following content. This assumes that you use a Unix-like operating system with Bourne or Bourne again shell as the default shell of the current user. It also assumes that the <code>md5sum</code>, <code>wget</code>, and <code>convert</code> binaries are installed and that the <span class="tex">T<sub>e</sub>X</span> engine has shell access.</p>
+<blockquote>
+<p><img src="https://tug.org/tugboat/noword.jpg" title="The Communications of the TeX Users Group" /></p>
+</blockquote>
+<h4 id="content-block-renderers"><span class="header-section-number">2.3.1.9</span> Content Block Renderers</h4>
+<p> The <code>\markdownRendererContentBlock</code> macro represents an iA Writer content block. It receives four arguments: the local file or online image filename extension cast to the lower case, the fully escaped <abbr>uri</abbr> that can be directly typeset, the raw <abbr>uri</abbr> that can be used outside typesetting, and the title of the content block.</p>
+<p>The <code>\markdownRendererContentBlockOnlineImage</code> macro represents an iA Writer online image content block. The macro receives the same arguments as <code>\markdownRendererContentBlock</code>.</p>
+<p>The <code>\markdownRendererContentBlockCode</code> macro represents an iA Writer content block that was recognized as a file in a known programming language by its filename extension <span class="math inline"><em>s</em></span>. If any <code>markdown-languages.json</code> file found by contains a record <span class="math inline">(<em>k</em>, <em>v</em>)</span>, then a non-online-image content block with the filename extension <span class="math inline"><em>s</em>, <em>s</em></span><code>:lower()</code><span class="math inline"> = <em>k</em></span> is considered to be in a known programming language <span class="math inline"><em>v</em></span>. The macro receives five arguments: the local file name extension <span class="math inline"><em>s</em></span> cast to the lower case, the language <span class="math inline"><em>v</em></span>, the fully escaped <abbr>uri</abbr> that can be directly typeset, the raw <abbr>uri</abbr> that can be used outside typesetting, and the title of the content block.</p>
+<p>Note that you will need to place place a <code>markdown-languages.json</code> file inside your working directory or inside your local <span class="tex">T<sub>e</sub>X</span> directory structure. In this file, you will define a mapping between filename extensions and the language names recognized by your favorite syntax highlighter; there may exist other creative uses beside syntax highlighting. <a href="https://github.com/iainc/Markdown-Content-Blocks" title="File transclusion syntax for Markdown">The <code>Languages.json</code> file provided by Anton Sotkov</a> is a good starting point.</p>
+<h5 id="plain-tex-example-17" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb285"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb285-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb285-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionContentBlocks{true}</a>
+<a class="sourceLine" id="cb285-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererContentBlock#1#2#3#4{<span class="co">%</span></a>
+<a class="sourceLine" id="cb285-4" data-line-number="4"> This is {\tt #2}, #4.</a>
+<a class="sourceLine" id="cb285-5" data-line-number="5">}</a>
+<a class="sourceLine" id="cb285-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererContentBlockOnlineImage#1#2#3#4{<span class="co">%</span></a>
+<a class="sourceLine" id="cb285-7" data-line-number="7"> This is the image {\tt #2}, #4.</a>
+<a class="sourceLine" id="cb285-8" data-line-number="8">}</a>
+<a class="sourceLine" id="cb285-9" data-line-number="9"><span class="fu">\def</span>\markdownRendererContentBlockCode#1#2#3#4#5{<span class="co">%</span></a>
+<a class="sourceLine" id="cb285-10" data-line-number="10"> This is the #2 (\uppercase{#1}) document {\tt #3}, #5.</a>
+<a class="sourceLine" id="cb285-11" data-line-number="11">}</a>
+<a class="sourceLine" id="cb285-12" data-line-number="12"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb285-13" data-line-number="13">/document.tex (the document that we are currently typesetting)</a>
+<a class="sourceLine" id="cb285-14" data-line-number="14">/markdown-languages.json (the mapping between filename extensions</a>
+<a class="sourceLine" id="cb285-15" data-line-number="15"> and programming language names)</a>
+<a class="sourceLine" id="cb285-16" data-line-number="16">https://tug.org/tugboat/noword.jpg (the logotype of TUGboat)</a>
+<a class="sourceLine" id="cb285-17" data-line-number="17"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb285-18" data-line-number="18"><span class="fu">\bye</span></a></code></pre></div>
+<p>Create also a text document named <code>markdown-languages.json</code> with the following content:</p>
+<div class="sourceCode" id="cb286"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb286-1" data-line-number="1"><span class="op">{</span></a>
+<a class="sourceLine" id="cb286-2" data-line-number="2"> <span class="st">&quot;json&quot;</span><span class="op">:</span> <span class="st">&quot;JavaScript Object Notation&quot;</span><span class="op">,</span></a>
+<a class="sourceLine" id="cb286-3" data-line-number="3"><span class="op">}</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb287"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb287-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is <code>document.tex</code>, the document that we are currently typesetting.</p>
+<p>This is the JavaScript Object Notation (JSON) document <code>markdown-languages.json</code>, the mapping between filename extensions and programming language names.</p>
+<p>This is the image <code>https://tug.org/tugboat/noword.jpg</code>, the logotype of TUGboat.</p>
+</blockquote>
+<h5 id="latex-example-30" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb288"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb288-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb288-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">filecontents</span>}</a>
+<a class="sourceLine" id="cb288-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">filecontents*</span>}{markdown-languages.json}</a>
+<a class="sourceLine" id="cb288-4" data-line-number="4">{</a>
+<a class="sourceLine" id="cb288-5" data-line-number="5"> &quot;json&quot;: &quot;JavaScript Object Notation&quot;,</a>
+<a class="sourceLine" id="cb288-6" data-line-number="6">}</a>
+<a class="sourceLine" id="cb288-7" data-line-number="7"><span class="kw">\end</span>{<span class="ex">filecontents*</span>}</a>
+<a class="sourceLine" id="cb288-8" data-line-number="8"><span class="bu">\usepackage</span>[contentBlocks]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb288-9" data-line-number="9"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb288-10" data-line-number="10"> renderers = {</a>
+<a class="sourceLine" id="cb288-11" data-line-number="11"> contentBlock = {This is <span class="fu">\texttt</span>{#2}, #4.},</a>
+<a class="sourceLine" id="cb288-12" data-line-number="12"> contentBlockOnlineImage = {This is the image <span class="fu">\texttt</span>{#2}, #4.},</a>
+<a class="sourceLine" id="cb288-13" data-line-number="13"> contentBlockCode = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb288-14" data-line-number="14"> This is the #2 (<span class="fu">\MakeUppercase</span>{#1}) document <span class="fu">\texttt</span>{#3}, #5.</a>
+<a class="sourceLine" id="cb288-15" data-line-number="15"> },</a>
+<a class="sourceLine" id="cb288-16" data-line-number="16"> },</a>
+<a class="sourceLine" id="cb288-17" data-line-number="17">}</a>
+<a class="sourceLine" id="cb288-18" data-line-number="18"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb288-19" data-line-number="19"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb288-20" data-line-number="20">/document.tex (the document that we are currently typesetting)</a>
+<a class="sourceLine" id="cb288-21" data-line-number="21">/markdown-languages.json (the mapping between filename extensions</a>
+<a class="sourceLine" id="cb288-22" data-line-number="22"> and programming language names)</a>
+<a class="sourceLine" id="cb288-23" data-line-number="23">https://tug.org/tugboat/noword.jpg (the logotype of TUGboat)</a>
+<a class="sourceLine" id="cb288-24" data-line-number="24"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb288-25" data-line-number="25"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb289"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb289-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is <code>document.tex</code>, the document that we are currently typesetting.</p>
+<p>This is the JavaScript Object Notation (JSON) document <code>markdown-languages.json</code>, the mapping between filename extensions and programming language names.</p>
+<p>This is the image <code>https://tug.org/tugboat/noword.jpg</code>, the logotype of TUGboat.</p>
+</blockquote>
+<h5 id="context-example-25" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb290"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb290-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb290-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionContentBlocks{true}</a>
+<a class="sourceLine" id="cb290-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererContentBlock#1#2#3#4{<span class="co">%</span></a>
+<a class="sourceLine" id="cb290-4" data-line-number="4"> This is {\tt #2}, #4.</a>
+<a class="sourceLine" id="cb290-5" data-line-number="5">}</a>
+<a class="sourceLine" id="cb290-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererContentBlockOnlineImage#1#2#3#4{<span class="co">%</span></a>
+<a class="sourceLine" id="cb290-7" data-line-number="7"> This is the image {\tt #2}, #4.</a>
+<a class="sourceLine" id="cb290-8" data-line-number="8">}</a>
+<a class="sourceLine" id="cb290-9" data-line-number="9"><span class="fu">\def</span>\markdownRendererContentBlockCode#1#2#3#4#5{<span class="co">%</span></a>
+<a class="sourceLine" id="cb290-10" data-line-number="10"> This is the #2 (\uppercase{#1}) document {\tt #3}, #5.</a>
+<a class="sourceLine" id="cb290-11" data-line-number="11">}</a>
+<a class="sourceLine" id="cb290-12" data-line-number="12"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb290-13" data-line-number="13"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb290-14" data-line-number="14">/document.tex (the document that we are currently typesetting)</a>
+<a class="sourceLine" id="cb290-15" data-line-number="15">/markdown-languages.json (the mapping between filename extensions</a>
+<a class="sourceLine" id="cb290-16" data-line-number="16"> and programming language names)</a>
+<a class="sourceLine" id="cb290-17" data-line-number="17">https://tug.org/tugboat/noword.jpg (the logotype of TUGboat)</a>
+<a class="sourceLine" id="cb290-18" data-line-number="18"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb290-19" data-line-number="19"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Create also a text document named <code>markdown-languages.json</code> with the following content:</p>
+<div class="sourceCode" id="cb291"><pre class="sourceCode js"><code class="sourceCode javascript"><a class="sourceLine" id="cb291-1" data-line-number="1"><span class="op">{</span></a>
+<a class="sourceLine" id="cb291-2" data-line-number="2"> <span class="st">&quot;json&quot;</span><span class="op">:</span> <span class="st">&quot;JavaScript Object Notation&quot;</span><span class="op">,</span></a>
+<a class="sourceLine" id="cb291-3" data-line-number="3"><span class="op">}</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb292"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb292-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is <code>document.tex</code>, the document that we are currently typesetting.</p>
+<p>This is the JavaScript Object Notation (JSON) document <code>markdown-languages.json</code>, the mapping between filename extensions and programming language names.</p>
+<p>This is the image <code>https://tug.org/tugboat/noword.jpg</code>, the logotype of TUGboat.</p>
+</blockquote>
+<h4 id="bullet-list-renderers"><span class="header-section-number">2.3.1.10</span> Bullet List Renderers</h4>
+<p>The <code>\markdownRendererUlBegin</code> macro represents the beginning of a bulleted list that contains an item with several paragraphs of text (the list is not tight). The macro receives no arguments.</p>
+<p>The <code>\markdownRendererUlBeginTight</code> macro represents the beginning of a bulleted list that contains no item with several paragraphs of text (the list is tight). This macro will only be produced, when the <strong><code>tightLists</code></strong> option is <code>false</code>. The macro receives no arguments.</p>
+<p>The <code>\markdownRendererUlItem</code> macro represents an item in a bulleted list. The macro receives no arguments.</p>
+<p>The <code>\markdownRendererUlItemEnd</code> macro represents the end of an item in a bulleted list. The macro receives no arguments.</p>
+<p>The <code>\markdownRendererUlEnd</code> macro represents the end of a bulleted list that contains an item with several paragraphs of text (the list is not tight). The macro receives no arguments.</p>
+<p>The <code>\markdownRendererUlEndTight</code> macro represents the end of a bulleted list that contains no item with several paragraphs of text (the list is tight). This macro will only be produced, when the <strong><code>tightLists</code></strong> option is <code>false</code>. The macro receives no arguments.</p>
+<h5 id="plain-tex-example-18" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb293"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb293-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb293-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionTightLists{true}</a>
+<a class="sourceLine" id="cb293-3" data-line-number="3"></a>
+<a class="sourceLine" id="cb293-4" data-line-number="4"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a>
+<a class="sourceLine" id="cb293-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererUlBeginTight{ (}</a>
+<a class="sourceLine" id="cb293-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererUlItem{<span class="co">%</span></a>
+<a class="sourceLine" id="cb293-7" data-line-number="7"> \def\markdownRendererUlItem{<span class="co">%</span></a>
+<a class="sourceLine" id="cb293-8" data-line-number="8"> ,</a>
+<a class="sourceLine" id="cb293-9" data-line-number="9"> \def\markdownRendererUlItem{, and }<span class="co">%</span></a>
+<a class="sourceLine" id="cb293-10" data-line-number="10"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb293-11" data-line-number="11">}</a>
+<a class="sourceLine" id="cb293-12" data-line-number="12"><span class="fu">\def</span>\markdownRendererUlItemEnd{}</a>
+<a class="sourceLine" id="cb293-13" data-line-number="13"><span class="fu">\def</span>\markdownRendererUlEndTight{).}</a>
+<a class="sourceLine" id="cb293-14" data-line-number="14"></a>
+<a class="sourceLine" id="cb293-15" data-line-number="15"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb293-16" data-line-number="16">This is a tight list</a>
+<a class="sourceLine" id="cb293-17" data-line-number="17"></a>
+<a class="sourceLine" id="cb293-18" data-line-number="18">- the first item</a>
+<a class="sourceLine" id="cb293-19" data-line-number="19">- the second item</a>
+<a class="sourceLine" id="cb293-20" data-line-number="20">- the third item</a>
+<a class="sourceLine" id="cb293-21" data-line-number="21"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb293-22" data-line-number="22"></a>
+<a class="sourceLine" id="cb293-23" data-line-number="23"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb293-24" data-line-number="24"> :\par</a>
+<a class="sourceLine" id="cb293-25" data-line-number="25"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a>
+<a class="sourceLine" id="cb293-26" data-line-number="26">}</a>
+<a class="sourceLine" id="cb293-27" data-line-number="27"><span class="fu">\def</span>\markdownRendererUlBegin{}</a>
+<a class="sourceLine" id="cb293-28" data-line-number="28"><span class="fu">\def</span>\markdownRendererUlItem{--\kern 0.5em}</a>
+<a class="sourceLine" id="cb293-29" data-line-number="29"><span class="fu">\def</span>\markdownRendererUlItemEnd{.\par}</a>
+<a class="sourceLine" id="cb293-30" data-line-number="30"><span class="fu">\def</span>\markdownRendererUlEnd{}</a>
+<a class="sourceLine" id="cb293-31" data-line-number="31"></a>
+<a class="sourceLine" id="cb293-32" data-line-number="32"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb293-33" data-line-number="33">This is a loose list</a>
+<a class="sourceLine" id="cb293-34" data-line-number="34"></a>
+<a class="sourceLine" id="cb293-35" data-line-number="35">- This is the first item</a>
+<a class="sourceLine" id="cb293-36" data-line-number="36"></a>
+<a class="sourceLine" id="cb293-37" data-line-number="37">- This is the second item</a>
+<a class="sourceLine" id="cb293-38" data-line-number="38"></a>
+<a class="sourceLine" id="cb293-39" data-line-number="39">- This is the third item</a>
+<a class="sourceLine" id="cb293-40" data-line-number="40"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb293-41" data-line-number="41"></a>
+<a class="sourceLine" id="cb293-42" data-line-number="42"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb294"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb294-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is a tight list (the first item, the second item, and the third item).</p>
+<p>This is a loose list:</p>
+<ul>
+<li><p>This is the first item.</p></li>
+<li><p>This is the second item.</p></li>
+<li><p>This is the third item.</p></li>
+</ul>
+</blockquote>
+<h5 id="latex-example-31" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb295"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb295-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb295-2" data-line-number="2"><span class="bu">\usepackage</span>[tightLists]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb295-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb295-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb295-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a>
+<a class="sourceLine" id="cb295-6" data-line-number="6"> renderers = {</a>
+<a class="sourceLine" id="cb295-7" data-line-number="7"> interblockSeparator = {},</a>
+<a class="sourceLine" id="cb295-8" data-line-number="8"> ulBeginTight = { (},</a>
+<a class="sourceLine" id="cb295-9" data-line-number="9"> ulItem = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb295-10" data-line-number="10"> <span class="fu">\def</span>\markdownRendererUlItem{<span class="co">%</span></a>
+<a class="sourceLine" id="cb295-11" data-line-number="11"> ,</a>
+<a class="sourceLine" id="cb295-12" data-line-number="12"> \def\markdownRendererUlItem{, and }<span class="co">%</span></a>
+<a class="sourceLine" id="cb295-13" data-line-number="13"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb295-14" data-line-number="14"> },</a>
+<a class="sourceLine" id="cb295-15" data-line-number="15"> ulItemEnd = {},</a>
+<a class="sourceLine" id="cb295-16" data-line-number="16"> ulEndTight = {).},</a>
+<a class="sourceLine" id="cb295-17" data-line-number="17"> },</a>
+<a class="sourceLine" id="cb295-18" data-line-number="18">}</a>
+<a class="sourceLine" id="cb295-19" data-line-number="19">This is a tight list</a>
+<a class="sourceLine" id="cb295-20" data-line-number="20"></a>
+<a class="sourceLine" id="cb295-21" data-line-number="21">- the first item</a>
+<a class="sourceLine" id="cb295-22" data-line-number="22">- the second item</a>
+<a class="sourceLine" id="cb295-23" data-line-number="23">- the third item</a>
+<a class="sourceLine" id="cb295-24" data-line-number="24"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb295-25" data-line-number="25"></a>
+<a class="sourceLine" id="cb295-26" data-line-number="26"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a>
+<a class="sourceLine" id="cb295-27" data-line-number="27"> renderers = {</a>
+<a class="sourceLine" id="cb295-28" data-line-number="28"> interblockSeparator = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb295-29" data-line-number="29"> :<span class="fu">\par</span></a>
+<a class="sourceLine" id="cb295-30" data-line-number="30"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a>
+<a class="sourceLine" id="cb295-31" data-line-number="31"> },</a>
+<a class="sourceLine" id="cb295-32" data-line-number="32"> ulBeginTight = {<span class="kw">\begin</span>{<span class="ex">itemize</span>}},</a>
+<a class="sourceLine" id="cb295-33" data-line-number="33"> ulItem = {<span class="fu">\item</span>},</a>
+<a class="sourceLine" id="cb295-34" data-line-number="34"> ulItemEnd = {.},</a>
+<a class="sourceLine" id="cb295-35" data-line-number="35"> ulEnd = {<span class="kw">\end</span>{<span class="ex">itemize</span>}},</a>
+<a class="sourceLine" id="cb295-36" data-line-number="36"> },</a>
+<a class="sourceLine" id="cb295-37" data-line-number="37">}</a>
+<a class="sourceLine" id="cb295-38" data-line-number="38">This is a loose list</a>
+<a class="sourceLine" id="cb295-39" data-line-number="39"></a>
+<a class="sourceLine" id="cb295-40" data-line-number="40">- This is the first item</a>
+<a class="sourceLine" id="cb295-41" data-line-number="41"></a>
+<a class="sourceLine" id="cb295-42" data-line-number="42">- This is the second item</a>
+<a class="sourceLine" id="cb295-43" data-line-number="43"></a>
+<a class="sourceLine" id="cb295-44" data-line-number="44">- This is the third item</a>
+<a class="sourceLine" id="cb295-45" data-line-number="45"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb295-46" data-line-number="46"></a>
+<a class="sourceLine" id="cb295-47" data-line-number="47"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb296"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb296-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is a tight list (the first item, the second item, and the third item).</p>
+<p>This is a loose list:</p>
+<ul>
+<li><p>This is the first item.</p></li>
+<li><p>This is the second item.</p></li>
+<li><p>This is the third item.</p></li>
+</ul>
+</blockquote>
+<h5 id="context-example-26" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb297"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb297-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb297-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionTightLists{true}</a>
+<a class="sourceLine" id="cb297-3" data-line-number="3"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb297-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb297-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a>
+<a class="sourceLine" id="cb297-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererUlBeginTight{ (}</a>
+<a class="sourceLine" id="cb297-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererUlItem{<span class="co">%</span></a>
+<a class="sourceLine" id="cb297-8" data-line-number="8"> \def\markdownRendererUlItem{<span class="co">%</span></a>
+<a class="sourceLine" id="cb297-9" data-line-number="9"> ,</a>
+<a class="sourceLine" id="cb297-10" data-line-number="10"> \def\markdownRendererUlItem{, and }<span class="co">%</span></a>
+<a class="sourceLine" id="cb297-11" data-line-number="11"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb297-12" data-line-number="12">}</a>
+<a class="sourceLine" id="cb297-13" data-line-number="13"><span class="fu">\def</span>\markdownRendererUlItemEnd{}</a>
+<a class="sourceLine" id="cb297-14" data-line-number="14"><span class="fu">\def</span>\markdownRendererUlEndTight{).}</a>
+<a class="sourceLine" id="cb297-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb297-16" data-line-number="16"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb297-17" data-line-number="17">This is a tight list</a>
+<a class="sourceLine" id="cb297-18" data-line-number="18"></a>
+<a class="sourceLine" id="cb297-19" data-line-number="19">- the first item</a>
+<a class="sourceLine" id="cb297-20" data-line-number="20">- the second item</a>
+<a class="sourceLine" id="cb297-21" data-line-number="21">- the third item</a>
+<a class="sourceLine" id="cb297-22" data-line-number="22"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb297-23" data-line-number="23"></a>
+<a class="sourceLine" id="cb297-24" data-line-number="24"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb297-25" data-line-number="25"> :\par</a>
+<a class="sourceLine" id="cb297-26" data-line-number="26"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a>
+<a class="sourceLine" id="cb297-27" data-line-number="27">}</a>
+<a class="sourceLine" id="cb297-28" data-line-number="28"><span class="fu">\def</span>\markdownRendererUlBegin{\startitemize}</a>
+<a class="sourceLine" id="cb297-29" data-line-number="29"><span class="fu">\def</span>\markdownRendererUlItem{\item}</a>
+<a class="sourceLine" id="cb297-30" data-line-number="30"><span class="fu">\def</span>\markdownRendererUlItemEnd{.}</a>
+<a class="sourceLine" id="cb297-31" data-line-number="31"><span class="fu">\def</span>\markdownRendererUlEnd{\stopitemize}</a>
+<a class="sourceLine" id="cb297-32" data-line-number="32"></a>
+<a class="sourceLine" id="cb297-33" data-line-number="33"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb297-34" data-line-number="34">This is a loose list</a>
+<a class="sourceLine" id="cb297-35" data-line-number="35"></a>
+<a class="sourceLine" id="cb297-36" data-line-number="36">- This is the first item</a>
+<a class="sourceLine" id="cb297-37" data-line-number="37"></a>
+<a class="sourceLine" id="cb297-38" data-line-number="38">- This is the second item</a>
+<a class="sourceLine" id="cb297-39" data-line-number="39"></a>
+<a class="sourceLine" id="cb297-40" data-line-number="40">- This is the third item</a>
+<a class="sourceLine" id="cb297-41" data-line-number="41"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb297-42" data-line-number="42"></a>
+<a class="sourceLine" id="cb297-43" data-line-number="43"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb298"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb298-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is a tight list (the first item, the second item, and the third item).</p>
+<p>This is a loose list:</p>
+<ul>
+<li><p>This is the first item.</p></li>
+<li><p>This is the second item.</p></li>
+<li><p>This is the third item.</p></li>
+</ul>
+</blockquote>
+<h4 id="ordered-list-renderers"><span class="header-section-number">2.3.1.11</span> Ordered List Renderers</h4>
+<p>The <code>\markdownRendererOlBegin</code> macro represents the beginning of an ordered list that contains an item with several paragraphs of text (the list is not tight). The macro receives no arguments.</p>
+<p>The <code>\markdownRendererOlBeginTight</code> macro represents the beginning of an ordered list that contains no item with several paragraphs of text (the list is tight). This macro will only be produced, when the <strong><code>tightLists</code></strong> option is <code>false</code>. The macro receives no arguments.</p>
+<p>The <code>\markdownRendererOlItem</code> macro represents an item in an ordered list. This macro will only be produced, when the <strong><code>startNumber</code></strong> option is <code>false</code>. The macro receives no arguments.</p>
+<p>The <code>\markdownRendererOlItemEnd</code> macro represents the end of an item in an ordered list. The macro receives no arguments.</p>
+<p>The <code>\markdownRendererOlItemWithNumber</code> macro represents an item in an ordered list. This macro will only be produced, when the <strong><code>startNumber</code></strong> option is <code>true</code>. The macro receives no arguments.</p>
+<p>The <code>\markdownRendererOlEnd</code> macro represents the end of an ordered list that contains an item with several paragraphs of text (the list is not tight). The macro receives no arguments.</p>
+<p>The <code>\markdownRendererOlEndTight</code> macro represents the end of an ordered list that contains no item with several paragraphs of text (the list is tight). This macro will only be produced, when the <strong><code>tightLists</code></strong> option is <code>false</code>. The macro receives no arguments.</p>
+<h5 id="plain-tex-example-19" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb299"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb299-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb299-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionTightLists{true}</a>
+<a class="sourceLine" id="cb299-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionStartNumber{true}</a>
+<a class="sourceLine" id="cb299-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb299-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a>
+<a class="sourceLine" id="cb299-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererOlBeginTight{ (}</a>
+<a class="sourceLine" id="cb299-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererOlItemWithNumber#1{<span class="co">%</span></a>
+<a class="sourceLine" id="cb299-8" data-line-number="8"> \ifnum #1=1\relax</a>
+<a class="sourceLine" id="cb299-9" data-line-number="9"> the first</a>
+<a class="sourceLine" id="cb299-10" data-line-number="10"> \else</a>
+<a class="sourceLine" id="cb299-11" data-line-number="11"> \ifnum #1=2\relax</a>
+<a class="sourceLine" id="cb299-12" data-line-number="12"> , the second</a>
+<a class="sourceLine" id="cb299-13" data-line-number="13"> \else</a>
+<a class="sourceLine" id="cb299-14" data-line-number="14"> , and the third</a>
+<a class="sourceLine" id="cb299-15" data-line-number="15"> \fi</a>
+<a class="sourceLine" id="cb299-16" data-line-number="16"> \fi</a>
+<a class="sourceLine" id="cb299-17" data-line-number="17">}</a>
+<a class="sourceLine" id="cb299-18" data-line-number="18"><span class="fu">\def</span>\markdownRendererOlItemEnd{}</a>
+<a class="sourceLine" id="cb299-19" data-line-number="19"><span class="fu">\def</span>\markdownRendererOlEndTight{).}</a>
+<a class="sourceLine" id="cb299-20" data-line-number="20"></a>
+<a class="sourceLine" id="cb299-21" data-line-number="21"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb299-22" data-line-number="22">This is a tight list</a>
+<a class="sourceLine" id="cb299-23" data-line-number="23"></a>
+<a class="sourceLine" id="cb299-24" data-line-number="24">1. item</a>
+<a class="sourceLine" id="cb299-25" data-line-number="25">2. item</a>
+<a class="sourceLine" id="cb299-26" data-line-number="26">3. item</a>
+<a class="sourceLine" id="cb299-27" data-line-number="27"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb299-28" data-line-number="28"></a>
+<a class="sourceLine" id="cb299-29" data-line-number="29"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb299-30" data-line-number="30"> :\par</a>
+<a class="sourceLine" id="cb299-31" data-line-number="31"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a>
+<a class="sourceLine" id="cb299-32" data-line-number="32">}</a>
+<a class="sourceLine" id="cb299-33" data-line-number="33"><span class="fu">\def</span>\markdownRendererOlBegin{}</a>
+<a class="sourceLine" id="cb299-34" data-line-number="34"><span class="fu">\def</span>\markdownRendererOlItemWithNumber#1{<span class="co">%</span></a>
+<a class="sourceLine" id="cb299-35" data-line-number="35"> #1.\kern 0.5em<span class="co">%</span></a>
+<a class="sourceLine" id="cb299-36" data-line-number="36"> This is the</a>
+<a class="sourceLine" id="cb299-37" data-line-number="37"> \ifnum #1=1\relax</a>
+<a class="sourceLine" id="cb299-38" data-line-number="38"> first</a>
+<a class="sourceLine" id="cb299-39" data-line-number="39"> \else</a>
+<a class="sourceLine" id="cb299-40" data-line-number="40"> \ifnum #1=2\relax</a>
+<a class="sourceLine" id="cb299-41" data-line-number="41"> second</a>
+<a class="sourceLine" id="cb299-42" data-line-number="42"> \else</a>
+<a class="sourceLine" id="cb299-43" data-line-number="43"> third</a>
+<a class="sourceLine" id="cb299-44" data-line-number="44"> \fi</a>
+<a class="sourceLine" id="cb299-45" data-line-number="45"> \fi</a>
+<a class="sourceLine" id="cb299-46" data-line-number="46">}</a>
+<a class="sourceLine" id="cb299-47" data-line-number="47"><span class="fu">\def</span>\markdownRendererOlItemEnd{.\par}</a>
+<a class="sourceLine" id="cb299-48" data-line-number="48"><span class="fu">\def</span>\markdownRendererOlEnd{}</a>
+<a class="sourceLine" id="cb299-49" data-line-number="49"></a>
+<a class="sourceLine" id="cb299-50" data-line-number="50"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb299-51" data-line-number="51">This is a loose list</a>
+<a class="sourceLine" id="cb299-52" data-line-number="52"></a>
+<a class="sourceLine" id="cb299-53" data-line-number="53">1. item</a>
+<a class="sourceLine" id="cb299-54" data-line-number="54"></a>
+<a class="sourceLine" id="cb299-55" data-line-number="55">2. item</a>
+<a class="sourceLine" id="cb299-56" data-line-number="56"></a>
+<a class="sourceLine" id="cb299-57" data-line-number="57">3. item</a>
+<a class="sourceLine" id="cb299-58" data-line-number="58"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb299-59" data-line-number="59"></a>
+<a class="sourceLine" id="cb299-60" data-line-number="60"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb300"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb300-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is a tight list (the first item, the second item, and the third item).</p>
+<p>This is a loose list:</p>
+<ol type="1">
+<li><p>This is the first item.</p></li>
+<li><p>This is the second item.</p></li>
+<li><p>This is the third item.</p></li>
+</ol>
+</blockquote>
+<h5 id="latex-example-32" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb301"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb301-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb301-2" data-line-number="2"><span class="bu">\usepackage</span>[tightLists, startNumber]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb301-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb301-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb301-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a>
+<a class="sourceLine" id="cb301-6" data-line-number="6"> renderers = {</a>
+<a class="sourceLine" id="cb301-7" data-line-number="7"> interblockSeparator = {},</a>
+<a class="sourceLine" id="cb301-8" data-line-number="8"> olBeginTight = { (},</a>
+<a class="sourceLine" id="cb301-9" data-line-number="9"> olItemWithNumber = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb301-10" data-line-number="10"> <span class="fu">\ifnum</span> #1=1<span class="fu">\relax</span></a>
+<a class="sourceLine" id="cb301-11" data-line-number="11"> the first</a>
+<a class="sourceLine" id="cb301-12" data-line-number="12"> <span class="fu">\else</span></a>
+<a class="sourceLine" id="cb301-13" data-line-number="13"> <span class="fu">\ifnum</span> #1=2<span class="fu">\relax</span></a>
+<a class="sourceLine" id="cb301-14" data-line-number="14"> , the second</a>
+<a class="sourceLine" id="cb301-15" data-line-number="15"> <span class="fu">\else</span></a>
+<a class="sourceLine" id="cb301-16" data-line-number="16"> , and the third</a>
+<a class="sourceLine" id="cb301-17" data-line-number="17"> <span class="fu">\fi</span></a>
+<a class="sourceLine" id="cb301-18" data-line-number="18"> <span class="fu">\fi</span></a>
+<a class="sourceLine" id="cb301-19" data-line-number="19"> },</a>
+<a class="sourceLine" id="cb301-20" data-line-number="20"> olItemEnd = {},</a>
+<a class="sourceLine" id="cb301-21" data-line-number="21"> olEndTight = {).},</a>
+<a class="sourceLine" id="cb301-22" data-line-number="22"> },</a>
+<a class="sourceLine" id="cb301-23" data-line-number="23">}</a>
+<a class="sourceLine" id="cb301-24" data-line-number="24">This is a tight list</a>
+<a class="sourceLine" id="cb301-25" data-line-number="25"></a>
+<a class="sourceLine" id="cb301-26" data-line-number="26">1. item</a>
+<a class="sourceLine" id="cb301-27" data-line-number="27">2. item</a>
+<a class="sourceLine" id="cb301-28" data-line-number="28">3. item</a>
+<a class="sourceLine" id="cb301-29" data-line-number="29"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb301-30" data-line-number="30"></a>
+<a class="sourceLine" id="cb301-31" data-line-number="31"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a>
+<a class="sourceLine" id="cb301-32" data-line-number="32"> renderers = {</a>
+<a class="sourceLine" id="cb301-33" data-line-number="33"> interblockSeparator = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb301-34" data-line-number="34"> :<span class="fu">\par</span></a>
+<a class="sourceLine" id="cb301-35" data-line-number="35"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a>
+<a class="sourceLine" id="cb301-36" data-line-number="36"> },</a>
+<a class="sourceLine" id="cb301-37" data-line-number="37"> olBeginTight = {<span class="kw">\begin</span>{<span class="ex">enumerate</span>}},</a>
+<a class="sourceLine" id="cb301-38" data-line-number="38"> olItemWithNumber = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb301-39" data-line-number="39"> <span class="fu">\item</span> This is the</a>
+<a class="sourceLine" id="cb301-40" data-line-number="40"> <span class="fu">\ifnum</span> #1=1<span class="fu">\relax</span></a>
+<a class="sourceLine" id="cb301-41" data-line-number="41"> first</a>
+<a class="sourceLine" id="cb301-42" data-line-number="42"> <span class="fu">\else</span></a>
+<a class="sourceLine" id="cb301-43" data-line-number="43"> <span class="fu">\ifnum</span> #1=2<span class="fu">\relax</span></a>
+<a class="sourceLine" id="cb301-44" data-line-number="44"> second</a>
+<a class="sourceLine" id="cb301-45" data-line-number="45"> <span class="fu">\else</span></a>
+<a class="sourceLine" id="cb301-46" data-line-number="46"> third</a>
+<a class="sourceLine" id="cb301-47" data-line-number="47"> <span class="fu">\fi</span></a>
+<a class="sourceLine" id="cb301-48" data-line-number="48"> <span class="fu">\fi</span></a>
+<a class="sourceLine" id="cb301-49" data-line-number="49"> },</a>
+<a class="sourceLine" id="cb301-50" data-line-number="50"> olItemEnd = {.},</a>
+<a class="sourceLine" id="cb301-51" data-line-number="51"> olEnd = {<span class="kw">\end</span>{<span class="ex">enumerate</span>}},</a>
+<a class="sourceLine" id="cb301-52" data-line-number="52"> },</a>
+<a class="sourceLine" id="cb301-53" data-line-number="53">}</a>
+<a class="sourceLine" id="cb301-54" data-line-number="54">This is a loose list</a>
+<a class="sourceLine" id="cb301-55" data-line-number="55"></a>
+<a class="sourceLine" id="cb301-56" data-line-number="56">1. item</a>
+<a class="sourceLine" id="cb301-57" data-line-number="57"></a>
+<a class="sourceLine" id="cb301-58" data-line-number="58">2. item</a>
+<a class="sourceLine" id="cb301-59" data-line-number="59"></a>
+<a class="sourceLine" id="cb301-60" data-line-number="60">3. item</a>
+<a class="sourceLine" id="cb301-61" data-line-number="61"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb301-62" data-line-number="62"></a>
+<a class="sourceLine" id="cb301-63" data-line-number="63"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb302"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb302-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is a tight list (the first item, the second item, and the third item).</p>
+<p>This is a loose list:</p>
+<ol type="1">
+<li><p>This is the first item.</p></li>
+<li><p>This is the second item.</p></li>
+<li><p>This is the third item.</p></li>
+</ol>
+</blockquote>
+<h5 id="context-example-27" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb303"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb303-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb303-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionTightLists{true}</a>
+<a class="sourceLine" id="cb303-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionStartNumber{true}</a>
+<a class="sourceLine" id="cb303-4" data-line-number="4"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb303-5" data-line-number="5"></a>
+<a class="sourceLine" id="cb303-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a>
+<a class="sourceLine" id="cb303-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererOlBeginTight{ (}</a>
+<a class="sourceLine" id="cb303-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererOlItemWithNumber#1{<span class="co">%</span></a>
+<a class="sourceLine" id="cb303-9" data-line-number="9"> \ifnum #1=1\relax</a>
+<a class="sourceLine" id="cb303-10" data-line-number="10"> the first</a>
+<a class="sourceLine" id="cb303-11" data-line-number="11"> \else</a>
+<a class="sourceLine" id="cb303-12" data-line-number="12"> \ifnum #1=2\relax</a>
+<a class="sourceLine" id="cb303-13" data-line-number="13"> , the second</a>
+<a class="sourceLine" id="cb303-14" data-line-number="14"> \else</a>
+<a class="sourceLine" id="cb303-15" data-line-number="15"> , and the third</a>
+<a class="sourceLine" id="cb303-16" data-line-number="16"> \fi</a>
+<a class="sourceLine" id="cb303-17" data-line-number="17"> \fi</a>
+<a class="sourceLine" id="cb303-18" data-line-number="18">}</a>
+<a class="sourceLine" id="cb303-19" data-line-number="19"><span class="fu">\def</span>\markdownRendererOlItemEnd{}</a>
+<a class="sourceLine" id="cb303-20" data-line-number="20"><span class="fu">\def</span>\markdownRendererOlEndTight{).}</a>
+<a class="sourceLine" id="cb303-21" data-line-number="21"></a>
+<a class="sourceLine" id="cb303-22" data-line-number="22"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb303-23" data-line-number="23">This is a tight list</a>
+<a class="sourceLine" id="cb303-24" data-line-number="24"></a>
+<a class="sourceLine" id="cb303-25" data-line-number="25">1. item</a>
+<a class="sourceLine" id="cb303-26" data-line-number="26">2. item</a>
+<a class="sourceLine" id="cb303-27" data-line-number="27">3. item</a>
+<a class="sourceLine" id="cb303-28" data-line-number="28"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb303-29" data-line-number="29"></a>
+<a class="sourceLine" id="cb303-30" data-line-number="30"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb303-31" data-line-number="31"> :\par</a>
+<a class="sourceLine" id="cb303-32" data-line-number="32"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a>
+<a class="sourceLine" id="cb303-33" data-line-number="33">}</a>
+<a class="sourceLine" id="cb303-34" data-line-number="34"><span class="fu">\def</span>\markdownRendererOlBegin{\startitemize}</a>
+<a class="sourceLine" id="cb303-35" data-line-number="35"><span class="fu">\def</span>\markdownRendererOlItemWithNumber#1{<span class="co">%</span></a>
+<a class="sourceLine" id="cb303-36" data-line-number="36"> \sym{#1.}</a>
+<a class="sourceLine" id="cb303-37" data-line-number="37"> This is the</a>
+<a class="sourceLine" id="cb303-38" data-line-number="38"> \ifnum #1=1\relax</a>
+<a class="sourceLine" id="cb303-39" data-line-number="39"> first</a>
+<a class="sourceLine" id="cb303-40" data-line-number="40"> \else</a>
+<a class="sourceLine" id="cb303-41" data-line-number="41"> \ifnum #1=2\relax</a>
+<a class="sourceLine" id="cb303-42" data-line-number="42"> second</a>
+<a class="sourceLine" id="cb303-43" data-line-number="43"> \else</a>
+<a class="sourceLine" id="cb303-44" data-line-number="44"> third</a>
+<a class="sourceLine" id="cb303-45" data-line-number="45"> \fi</a>
+<a class="sourceLine" id="cb303-46" data-line-number="46"> \fi</a>
+<a class="sourceLine" id="cb303-47" data-line-number="47">}</a>
+<a class="sourceLine" id="cb303-48" data-line-number="48"><span class="fu">\def</span>\markdownRendererOlItemEnd{.\par}</a>
+<a class="sourceLine" id="cb303-49" data-line-number="49"><span class="fu">\def</span>\markdownRendererOlEnd{\stopitemize}</a>
+<a class="sourceLine" id="cb303-50" data-line-number="50"></a>
+<a class="sourceLine" id="cb303-51" data-line-number="51"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb303-52" data-line-number="52">This is a loose list</a>
+<a class="sourceLine" id="cb303-53" data-line-number="53"></a>
+<a class="sourceLine" id="cb303-54" data-line-number="54">1. item</a>
+<a class="sourceLine" id="cb303-55" data-line-number="55"></a>
+<a class="sourceLine" id="cb303-56" data-line-number="56">2. item</a>
+<a class="sourceLine" id="cb303-57" data-line-number="57"></a>
+<a class="sourceLine" id="cb303-58" data-line-number="58">3. item</a>
+<a class="sourceLine" id="cb303-59" data-line-number="59"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb303-60" data-line-number="60"></a>
+<a class="sourceLine" id="cb303-61" data-line-number="61"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb304"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb304-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is a tight list (the first item, the second item, and the third item).</p>
+<p>This is a loose list:</p>
+<ol type="1">
+<li><p>This is the first item.</p></li>
+<li><p>This is the second item.</p></li>
+<li><p>This is the third item.</p></li>
+</ol>
+</blockquote>
+<h4 id="definition-list-renderers"><span class="header-section-number">2.3.1.12</span> Definition List Renderers</h4>
+<p>The following macros are only produced, when the <strong><code>definitionLists</code></strong> option is <code>true</code>.</p>
+<p>The <code>\markdownRendererDlBegin</code> macro represents the beginning of a definition list that contains an item with several paragraphs of text (the list is not tight). The macro receives no arguments.</p>
+<p>The <code>\markdownRendererDlBeginTight</code> macro represents the beginning of a definition list that contains an item with several paragraphs of text (the list is not tight). This macro will only be produced, when the <strong><code>tightLists</code></strong> option is <code>false</code>. The macro receives no arguments.</p>
+<p>The <code>\markdownRendererDlItem</code> macro represents a term in a definition list. The macro receives a single argument that corresponds to the term being defined.</p>
+<p>The <code>\markdownRendererDlItemEnd</code> macro represents the end of a list of definitions for a single term.</p>
+<p>The <code>\markdownRendererDlDefinitionBegin</code> macro represents the beginning of a definition in a definition list. There can be several definitions for a single term.</p>
+<p>The <code>\markdownRendererDlDefinitionEnd</code> macro represents the end of a definition in a definition list. There can be several definitions for a single term.</p>
+<p>The <code>\markdownRendererDlEnd</code> macro represents the end of a definition list that contains an item with several paragraphs of text (the list is not tight). The macro receives no arguments.</p>
+<p>The <code>\markdownRendererDlEndTight</code> macro represents the end of a definition list that contains no item with several paragraphs of text (the list is tight). This macro will only be produced, when the <strong><code>tightLists</code></strong> option is <code>false</code>. The macro receives no arguments.</p>
+<h5 id="plain-tex-example-20" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb305"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb305-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb305-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionDefinitionLists{true}</a>
+<a class="sourceLine" id="cb305-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionTightLists{true}</a>
+<a class="sourceLine" id="cb305-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb305-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-6" data-line-number="6"> :<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-7" data-line-number="7"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-8" data-line-number="8">}</a>
+<a class="sourceLine" id="cb305-9" data-line-number="9"><span class="fu">\def</span>\markdownRendererDlBeginTight{<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-10" data-line-number="10"> \begingroup</a>
+<a class="sourceLine" id="cb305-11" data-line-number="11"> \parindent=0pt</a>
+<a class="sourceLine" id="cb305-12" data-line-number="12">}</a>
+<a class="sourceLine" id="cb305-13" data-line-number="13"><span class="fu">\def</span>\markdownRendererDlItem#1{<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-14" data-line-number="14"> \par{\bf#1}<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-15" data-line-number="15"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-16" data-line-number="16"> ,</a>
+<a class="sourceLine" id="cb305-17" data-line-number="17"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-18" data-line-number="18"> , and</a>
+<a class="sourceLine" id="cb305-19" data-line-number="19"> \def\markdownRendererDlDefinitionEnd{.}<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-20" data-line-number="20"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-21" data-line-number="21"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-22" data-line-number="22">}</a>
+<a class="sourceLine" id="cb305-23" data-line-number="23"><span class="fu">\def</span>\markdownRendererDlItemEnd{}</a>
+<a class="sourceLine" id="cb305-24" data-line-number="24"><span class="fu">\def</span>\markdownRendererDlDefinitionBegin{\par--\kern 0.5em}</a>
+<a class="sourceLine" id="cb305-25" data-line-number="25"><span class="fu">\def</span>\markdownRendererDlEndTight{\endgroup}</a>
+<a class="sourceLine" id="cb305-26" data-line-number="26"></a>
+<a class="sourceLine" id="cb305-27" data-line-number="27"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb305-28" data-line-number="28">This is a tight definition list</a>
+<a class="sourceLine" id="cb305-29" data-line-number="29"></a>
+<a class="sourceLine" id="cb305-30" data-line-number="30">Coffee</a>
+<a class="sourceLine" id="cb305-31" data-line-number="31">: black hot drink</a>
+<a class="sourceLine" id="cb305-32" data-line-number="32">: prepared from roasted coffee beans</a>
+<a class="sourceLine" id="cb305-33" data-line-number="33">: one of the most traded agricultural commodities in the world</a>
+<a class="sourceLine" id="cb305-34" data-line-number="34"></a>
+<a class="sourceLine" id="cb305-35" data-line-number="35">Milk</a>
+<a class="sourceLine" id="cb305-36" data-line-number="36">: white cold drink</a>
+<a class="sourceLine" id="cb305-37" data-line-number="37">: nutrient-rich</a>
+<a class="sourceLine" id="cb305-38" data-line-number="38">: produced on an industrial scale</a>
+<a class="sourceLine" id="cb305-39" data-line-number="39"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb305-40" data-line-number="40"></a>
+<a class="sourceLine" id="cb305-41" data-line-number="41"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-42" data-line-number="42"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-43" data-line-number="43">}</a>
+<a class="sourceLine" id="cb305-44" data-line-number="44"><span class="fu">\def</span>\markdownRendererDlBegin{}</a>
+<a class="sourceLine" id="cb305-45" data-line-number="45"><span class="fu">\def</span>\markdownRendererDlItem#1{<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-46" data-line-number="46"> . #1 is a</a>
+<a class="sourceLine" id="cb305-47" data-line-number="47"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-48" data-line-number="48"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-49" data-line-number="49"> ,</a>
+<a class="sourceLine" id="cb305-50" data-line-number="50"> \def\markdownRendererDlDefinitionBegin{, and }<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-51" data-line-number="51"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-52" data-line-number="52"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb305-53" data-line-number="53">}</a>
+<a class="sourceLine" id="cb305-54" data-line-number="54"><span class="fu">\def</span>\markdownRendererDlItemEnd{}</a>
+<a class="sourceLine" id="cb305-55" data-line-number="55"><span class="fu">\def</span>\markdownRendererDlDefinitionEnd{}</a>
+<a class="sourceLine" id="cb305-56" data-line-number="56"><span class="fu">\def</span>\markdownRendererDlEnd{.}</a>
+<a class="sourceLine" id="cb305-57" data-line-number="57"></a>
+<a class="sourceLine" id="cb305-58" data-line-number="58"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb305-59" data-line-number="59">This is a loose definition list</a>
+<a class="sourceLine" id="cb305-60" data-line-number="60"></a>
+<a class="sourceLine" id="cb305-61" data-line-number="61">Coffee</a>
+<a class="sourceLine" id="cb305-62" data-line-number="62"></a>
+<a class="sourceLine" id="cb305-63" data-line-number="63">: black hot drink</a>
+<a class="sourceLine" id="cb305-64" data-line-number="64"></a>
+<a class="sourceLine" id="cb305-65" data-line-number="65">: prepared from roasted coffee beans</a>
+<a class="sourceLine" id="cb305-66" data-line-number="66"></a>
+<a class="sourceLine" id="cb305-67" data-line-number="67">: one of the most traded agricultural commodities in the world</a>
+<a class="sourceLine" id="cb305-68" data-line-number="68"></a>
+<a class="sourceLine" id="cb305-69" data-line-number="69">Milk</a>
+<a class="sourceLine" id="cb305-70" data-line-number="70"></a>
+<a class="sourceLine" id="cb305-71" data-line-number="71">: white cold drink</a>
+<a class="sourceLine" id="cb305-72" data-line-number="72"></a>
+<a class="sourceLine" id="cb305-73" data-line-number="73">: nutrient-rich</a>
+<a class="sourceLine" id="cb305-74" data-line-number="74"></a>
+<a class="sourceLine" id="cb305-75" data-line-number="75">: produced on an industrial scale</a>
+<a class="sourceLine" id="cb305-76" data-line-number="76"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb305-77" data-line-number="77"></a>
+<a class="sourceLine" id="cb305-78" data-line-number="78"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb306"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb306-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is a tight definition list:</p>
+<p><strong>Coffee</strong></p>
+<ul>
+<li>black hot drink,</li>
+<li>prepared from roasted coffee beans, and</li>
+<li>one of the most traded agricultural commodities in the world.</li>
+</ul>
+<p><strong>Milk</strong></p>
+<ul>
+<li>white cold drink,</li>
+<li>nutrient-rich, and</li>
+<li>produced on an industrial scale.</li>
+</ul>
+<p>This is a loose definition list. Coffee is a black hot drink, prepared from roasted coffee beans, and one of the most traded agricultural commodities in the world. Milk is a white cold drink, nutrient-rich, and produced on an industrial scale.</p>
+</blockquote>
+<h5 id="latex-example-33" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb307"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb307-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb307-2" data-line-number="2"><span class="bu">\usepackage</span>[definitionLists, tightLists]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb307-3" data-line-number="3"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb307-4" data-line-number="4"></a>
+<a class="sourceLine" id="cb307-5" data-line-number="5"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a>
+<a class="sourceLine" id="cb307-6" data-line-number="6"> renderers = {</a>
+<a class="sourceLine" id="cb307-7" data-line-number="7"> interblockSeparator = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-8" data-line-number="8"> :<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-9" data-line-number="9"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-10" data-line-number="10"> },</a>
+<a class="sourceLine" id="cb307-11" data-line-number="11"> dlBeginTight = {<span class="kw">\begin</span>{<span class="ex">description</span>}},</a>
+<a class="sourceLine" id="cb307-12" data-line-number="12"> dlItem = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-13" data-line-number="13"> <span class="fu">\item</span>[#1]</a>
+<a class="sourceLine" id="cb307-14" data-line-number="14"> <span class="kw">\begin</span>{<span class="ex">itemize</span>}</a>
+<a class="sourceLine" id="cb307-15" data-line-number="15"> <span class="fu">\def</span>\markdownRendererDlDefinitionEnd{<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-16" data-line-number="16"> ,</a>
+<a class="sourceLine" id="cb307-17" data-line-number="17"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-18" data-line-number="18"> , and</a>
+<a class="sourceLine" id="cb307-19" data-line-number="19"> \def\markdownRendererDlDefinitionEnd{.}<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-20" data-line-number="20"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-21" data-line-number="21"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-22" data-line-number="22"> },</a>
+<a class="sourceLine" id="cb307-23" data-line-number="23"> dlItemEnd = {<span class="kw">\end</span>{<span class="ex">itemize</span>}},</a>
+<a class="sourceLine" id="cb307-24" data-line-number="24"> dlDefinitionBegin = <span class="fu">\item</span>,</a>
+<a class="sourceLine" id="cb307-25" data-line-number="25"> dlEndTight = {<span class="kw">\end</span>{<span class="ex">description</span>}},</a>
+<a class="sourceLine" id="cb307-26" data-line-number="26"> },</a>
+<a class="sourceLine" id="cb307-27" data-line-number="27">}</a>
+<a class="sourceLine" id="cb307-28" data-line-number="28">This is a tight definition list</a>
+<a class="sourceLine" id="cb307-29" data-line-number="29"></a>
+<a class="sourceLine" id="cb307-30" data-line-number="30">Coffee</a>
+<a class="sourceLine" id="cb307-31" data-line-number="31">: black hot drink</a>
+<a class="sourceLine" id="cb307-32" data-line-number="32">: prepared from roasted coffee beans</a>
+<a class="sourceLine" id="cb307-33" data-line-number="33">: one of the most traded agricultural commodities in the world</a>
+<a class="sourceLine" id="cb307-34" data-line-number="34"></a>
+<a class="sourceLine" id="cb307-35" data-line-number="35">Milk</a>
+<a class="sourceLine" id="cb307-36" data-line-number="36">: white cold drink</a>
+<a class="sourceLine" id="cb307-37" data-line-number="37">: nutrient-rich</a>
+<a class="sourceLine" id="cb307-38" data-line-number="38">: produced on an industrial scale</a>
+<a class="sourceLine" id="cb307-39" data-line-number="39"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb307-40" data-line-number="40"></a>
+<a class="sourceLine" id="cb307-41" data-line-number="41"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a>
+<a class="sourceLine" id="cb307-42" data-line-number="42"> renderers = {</a>
+<a class="sourceLine" id="cb307-43" data-line-number="43"> interblockSeparator = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-44" data-line-number="44"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-45" data-line-number="45"> },</a>
+<a class="sourceLine" id="cb307-46" data-line-number="46"> dlBegin = {},</a>
+<a class="sourceLine" id="cb307-47" data-line-number="47"> dlItem = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-48" data-line-number="48"> . #1 is a</a>
+<a class="sourceLine" id="cb307-49" data-line-number="49"> <span class="fu">\def</span>\markdownRendererDlDefinitionBegin{<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-50" data-line-number="50"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-51" data-line-number="51"> ,</a>
+<a class="sourceLine" id="cb307-52" data-line-number="52"> \def\markdownRendererDlDefinitionBegin{, and }<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-53" data-line-number="53"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-54" data-line-number="54"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb307-55" data-line-number="55"> },</a>
+<a class="sourceLine" id="cb307-56" data-line-number="56"> dlItemEnd = {},</a>
+<a class="sourceLine" id="cb307-57" data-line-number="57"> dlDefinitionEnd = {},</a>
+<a class="sourceLine" id="cb307-58" data-line-number="58"> dlEnd = {.},</a>
+<a class="sourceLine" id="cb307-59" data-line-number="59"> },</a>
+<a class="sourceLine" id="cb307-60" data-line-number="60">}</a>
+<a class="sourceLine" id="cb307-61" data-line-number="61">This is a loose definition list</a>
+<a class="sourceLine" id="cb307-62" data-line-number="62"></a>
+<a class="sourceLine" id="cb307-63" data-line-number="63">Coffee</a>
+<a class="sourceLine" id="cb307-64" data-line-number="64"></a>
+<a class="sourceLine" id="cb307-65" data-line-number="65">: black hot drink</a>
+<a class="sourceLine" id="cb307-66" data-line-number="66"></a>
+<a class="sourceLine" id="cb307-67" data-line-number="67">: prepared from roasted coffee beans</a>
+<a class="sourceLine" id="cb307-68" data-line-number="68"></a>
+<a class="sourceLine" id="cb307-69" data-line-number="69">: one of the most traded agricultural commodities in the world</a>
+<a class="sourceLine" id="cb307-70" data-line-number="70"></a>
+<a class="sourceLine" id="cb307-71" data-line-number="71">Milk</a>
+<a class="sourceLine" id="cb307-72" data-line-number="72"></a>
+<a class="sourceLine" id="cb307-73" data-line-number="73">: white cold drink</a>
+<a class="sourceLine" id="cb307-74" data-line-number="74"></a>
+<a class="sourceLine" id="cb307-75" data-line-number="75">: nutrient-rich</a>
+<a class="sourceLine" id="cb307-76" data-line-number="76"></a>
+<a class="sourceLine" id="cb307-77" data-line-number="77">: produced on an industrial scale</a>
+<a class="sourceLine" id="cb307-78" data-line-number="78"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb307-79" data-line-number="79"></a>
+<a class="sourceLine" id="cb307-80" data-line-number="80"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb308"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb308-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is a tight definition list:</p>
+<p><strong>Coffee</strong></p>
+<ul>
+<li>black hot drink,</li>
+<li>prepared from roasted coffee beans, and</li>
+<li>one of the most traded agricultural commodities in the world.</li>
+</ul>
+<p><strong>Milk</strong></p>
+<ul>
+<li>white cold drink,</li>
+<li>nutrient-rich, and</li>
+<li>produced on an industrial scale.</li>
+</ul>
+<p>This is a loose definition list. Coffee is a black hot drink, prepared from roasted coffee beans, and one of the most traded agricultural commodities in the world. Milk is a white cold drink, nutrient-rich, and produced on an industrial scale.</p>
+</blockquote>
+<h5 id="context-example-28" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb309"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb309-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb309-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionDefinitionLists{true}</a>
+<a class="sourceLine" id="cb309-3" data-line-number="3"><span class="fu">\def</span>\markdownOptionTightLists{true}</a>
+<a class="sourceLine" id="cb309-4" data-line-number="4"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb309-5" data-line-number="5"></a>
+<a class="sourceLine" id="cb309-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-7" data-line-number="7"> :<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-8" data-line-number="8"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-9" data-line-number="9">}</a>
+<a class="sourceLine" id="cb309-10" data-line-number="10"><span class="fu">\def</span>\markdownRendererDlBeginTight{}</a>
+<a class="sourceLine" id="cb309-11" data-line-number="11"><span class="fu">\def</span>\markdownRendererDlItem#1{<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-12" data-line-number="12"> \par{\bf#1}<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-13" data-line-number="13"> \startitemize</a>
+<a class="sourceLine" id="cb309-14" data-line-number="14"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-15" data-line-number="15"> ,</a>
+<a class="sourceLine" id="cb309-16" data-line-number="16"> \def\markdownRendererDlDefinitionEnd{<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-17" data-line-number="17"> , and</a>
+<a class="sourceLine" id="cb309-18" data-line-number="18"> \def\markdownRendererDlDefinitionEnd{.}<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-19" data-line-number="19"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-20" data-line-number="20"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-21" data-line-number="21">}</a>
+<a class="sourceLine" id="cb309-22" data-line-number="22"><span class="fu">\def</span>\markdownRendererDlItemEnd{\stopitemize}</a>
+<a class="sourceLine" id="cb309-23" data-line-number="23"><span class="fu">\def</span>\markdownRendererDlDefinitionBegin{\item}</a>
+<a class="sourceLine" id="cb309-24" data-line-number="24"><span class="fu">\def</span>\markdownRendererDlEndTight{}</a>
+<a class="sourceLine" id="cb309-25" data-line-number="25"></a>
+<a class="sourceLine" id="cb309-26" data-line-number="26"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb309-27" data-line-number="27">This is a tight definition list</a>
+<a class="sourceLine" id="cb309-28" data-line-number="28"></a>
+<a class="sourceLine" id="cb309-29" data-line-number="29">Coffee</a>
+<a class="sourceLine" id="cb309-30" data-line-number="30">: black hot drink</a>
+<a class="sourceLine" id="cb309-31" data-line-number="31">: prepared from roasted coffee beans</a>
+<a class="sourceLine" id="cb309-32" data-line-number="32">: one of the most traded agricultural commodities in the world</a>
+<a class="sourceLine" id="cb309-33" data-line-number="33"></a>
+<a class="sourceLine" id="cb309-34" data-line-number="34">Milk</a>
+<a class="sourceLine" id="cb309-35" data-line-number="35">: white cold drink</a>
+<a class="sourceLine" id="cb309-36" data-line-number="36">: nutrient-rich</a>
+<a class="sourceLine" id="cb309-37" data-line-number="37">: produced on an industrial scale</a>
+<a class="sourceLine" id="cb309-38" data-line-number="38"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb309-39" data-line-number="39"></a>
+<a class="sourceLine" id="cb309-40" data-line-number="40"><span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-41" data-line-number="41"> \def\markdownRendererInterblockSeparator{\par}<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-42" data-line-number="42">}</a>
+<a class="sourceLine" id="cb309-43" data-line-number="43"><span class="fu">\def</span>\markdownRendererDlBegin{}</a>
+<a class="sourceLine" id="cb309-44" data-line-number="44"><span class="fu">\def</span>\markdownRendererDlItem#1{<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-45" data-line-number="45"> . #1 is a</a>
+<a class="sourceLine" id="cb309-46" data-line-number="46"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-47" data-line-number="47"> \def\markdownRendererDlDefinitionBegin{<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-48" data-line-number="48"> ,</a>
+<a class="sourceLine" id="cb309-49" data-line-number="49"> \def\markdownRendererDlDefinitionBegin{, and }<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-50" data-line-number="50"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-51" data-line-number="51"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb309-52" data-line-number="52">}</a>
+<a class="sourceLine" id="cb309-53" data-line-number="53"><span class="fu">\def</span>\markdownRendererDlItemEnd{}</a>
+<a class="sourceLine" id="cb309-54" data-line-number="54"><span class="fu">\def</span>\markdownRendererDlDefinitionEnd{}</a>
+<a class="sourceLine" id="cb309-55" data-line-number="55"><span class="fu">\def</span>\markdownRendererDlEnd{.}</a>
+<a class="sourceLine" id="cb309-56" data-line-number="56"></a>
+<a class="sourceLine" id="cb309-57" data-line-number="57"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb309-58" data-line-number="58">This is a loose definition list</a>
+<a class="sourceLine" id="cb309-59" data-line-number="59"></a>
+<a class="sourceLine" id="cb309-60" data-line-number="60">Coffee</a>
+<a class="sourceLine" id="cb309-61" data-line-number="61"></a>
+<a class="sourceLine" id="cb309-62" data-line-number="62">: black hot drink</a>
+<a class="sourceLine" id="cb309-63" data-line-number="63"></a>
+<a class="sourceLine" id="cb309-64" data-line-number="64">: prepared from roasted coffee beans</a>
+<a class="sourceLine" id="cb309-65" data-line-number="65"></a>
+<a class="sourceLine" id="cb309-66" data-line-number="66">: one of the most traded agricultural commodities in the world</a>
+<a class="sourceLine" id="cb309-67" data-line-number="67"></a>
+<a class="sourceLine" id="cb309-68" data-line-number="68">Milk</a>
+<a class="sourceLine" id="cb309-69" data-line-number="69"></a>
+<a class="sourceLine" id="cb309-70" data-line-number="70">: white cold drink</a>
+<a class="sourceLine" id="cb309-71" data-line-number="71"></a>
+<a class="sourceLine" id="cb309-72" data-line-number="72">: nutrient-rich</a>
+<a class="sourceLine" id="cb309-73" data-line-number="73"></a>
+<a class="sourceLine" id="cb309-74" data-line-number="74">: produced on an industrial scale</a>
+<a class="sourceLine" id="cb309-75" data-line-number="75"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb309-76" data-line-number="76"></a>
+<a class="sourceLine" id="cb309-77" data-line-number="77"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb310"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb310-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is a tight definition list:</p>
+<p><strong>Coffee</strong></p>
+<ul>
+<li>black hot drink,</li>
+<li>prepared from roasted coffee beans, and</li>
+<li>one of the most traded agricultural commodities in the world.</li>
+</ul>
+<p><strong>Milk</strong></p>
+<ul>
+<li>white cold drink,</li>
+<li>nutrient-rich, and</li>
+<li>produced on an industrial scale.</li>
+</ul>
+<p>This is a loose definition list. Coffee is a black hot drink, prepared from roasted coffee beans, and one of the most traded agricultural commodities in the world. Milk is a white cold drink, nutrient-rich, and produced on an industrial scale.</p>
+</blockquote>
+<h4 id="emphasis-renderers"><span class="header-section-number">2.3.1.13</span> Emphasis Renderers</h4>
+<p>The <code>\markdownRendererEmphasis</code> macro represents an emphasized span of text. The macro receives a single argument that corresponds to the emphasized span of text.</p>
+<h5 id="plain-tex-example-21" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb311"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb311-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb311-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEmphasis#1{{\it#1}}</a>
+<a class="sourceLine" id="cb311-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererStrongEmphasis#1{{\bf#1}}</a>
+<a class="sourceLine" id="cb311-4" data-line-number="4"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb311-5" data-line-number="5">This is *emphasis*.</a>
+<a class="sourceLine" id="cb311-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb311-7" data-line-number="7">This is **strong emphasis**.</a>
+<a class="sourceLine" id="cb311-8" data-line-number="8"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb311-9" data-line-number="9"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb312"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb312-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is <em>emphasis</em>.</p>
+<p>This is <strong>strong emphasis</strong>.</p>
+</blockquote>
+<h5 id="latex-example-34" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb313"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb313-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb313-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb313-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb313-4" data-line-number="4"> renderers = {</a>
+<a class="sourceLine" id="cb313-5" data-line-number="5"> emphasis = {<span class="fu">\emph</span>{#1}},</a>
+<a class="sourceLine" id="cb313-6" data-line-number="6"> strongEmphasis = {<span class="fu">\textbf</span>{#1}},</a>
+<a class="sourceLine" id="cb313-7" data-line-number="7"> },</a>
+<a class="sourceLine" id="cb313-8" data-line-number="8">}</a>
+<a class="sourceLine" id="cb313-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb313-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb313-11" data-line-number="11">This is *emphasis*.</a>
+<a class="sourceLine" id="cb313-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb313-13" data-line-number="13">This is **strong emphasis**.</a>
+<a class="sourceLine" id="cb313-14" data-line-number="14"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb313-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb314"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb314-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is <em>emphasis</em>.</p>
+<p>This is <strong>strong emphasis</strong>.</p>
+</blockquote>
+<h5 id="context-example-29" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb315"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb315-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb315-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererEmphasis#1{\emph{#1}}</a>
+<a class="sourceLine" id="cb315-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererStrongEmphasis#1{\bold{#1}}</a>
+<a class="sourceLine" id="cb315-4" data-line-number="4"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb315-5" data-line-number="5"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb315-6" data-line-number="6">This is *emphasis*.</a>
+<a class="sourceLine" id="cb315-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb315-8" data-line-number="8">This is **strong emphasis**.</a>
+<a class="sourceLine" id="cb315-9" data-line-number="9"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb315-10" data-line-number="10"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb316"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb316-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is <em>emphasis</em>.</p>
+<p>This is <strong>strong emphasis</strong>.</p>
+</blockquote>
+<p>The <code>\markdownRendererStrongEmphasis</code> macro represents a strongly emphasized span of text. The macro receives a single argument that corresponds to the emphasized span of text.</p>
+<h4 id="block-quote-renderers"><span class="header-section-number">2.3.1.14</span> Block Quote Renderers</h4>
+<p>The <code>\markdownRendererBlockQuoteBegin</code> macro represents the beginning of a block quote. The macro receives no arguments.</p>
+<h5 id="plain-tex-example-22" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb317"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb317-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb317-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererBlockQuoteBegin{<span class="co">%</span></a>
+<a class="sourceLine" id="cb317-3" data-line-number="3"> \begingroup</a>
+<a class="sourceLine" id="cb317-4" data-line-number="4"> \vskip\parindent</a>
+<a class="sourceLine" id="cb317-5" data-line-number="5"> \leftskip=2\parindent</a>
+<a class="sourceLine" id="cb317-6" data-line-number="6"> \parindent=0pt</a>
+<a class="sourceLine" id="cb317-7" data-line-number="7">}</a>
+<a class="sourceLine" id="cb317-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererBlockQuoteEnd{<span class="co">%</span></a>
+<a class="sourceLine" id="cb317-9" data-line-number="9"> \par</a>
+<a class="sourceLine" id="cb317-10" data-line-number="10"> \vskip\parindent</a>
+<a class="sourceLine" id="cb317-11" data-line-number="11"> \endgroup</a>
+<a class="sourceLine" id="cb317-12" data-line-number="12">}</a>
+<a class="sourceLine" id="cb317-13" data-line-number="13"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb317-14" data-line-number="14">A quote from William Shakespeare&#39;s King Lear:</a>
+<a class="sourceLine" id="cb317-15" data-line-number="15"></a>
+<a class="sourceLine" id="cb317-16" data-line-number="16">&gt; This is the excellent foppery of the world that when we are</a>
+<a class="sourceLine" id="cb317-17" data-line-number="17">&gt; sick in fortune---often the surfeit of our own behavior---we</a>
+<a class="sourceLine" id="cb317-18" data-line-number="18">&gt; make guilty of our disasters the sun, the moon, and the</a>
+<a class="sourceLine" id="cb317-19" data-line-number="19">&gt; stars [...]</a>
+<a class="sourceLine" id="cb317-20" data-line-number="20"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb317-21" data-line-number="21"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb318"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb318-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>A quote from William Shakespeare’s King Lear:</p>
+<blockquote>
+<p>This is the excellent foppery of the world that when we are sick in fortune—often the surfeit of our own behavior—we make guilty of our disasters the sun, the moon, and the stars […]</p>
+</blockquote>
+</blockquote>
+<h5 id="latex-example-35" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb319"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb319-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb319-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb319-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb319-4" data-line-number="4"> renderers = {</a>
+<a class="sourceLine" id="cb319-5" data-line-number="5"> blockQuoteBegin = {<span class="kw">\begin</span>{<span class="ex">quote</span>}},</a>
+<a class="sourceLine" id="cb319-6" data-line-number="6"> blockQuoteEnd = {<span class="kw">\end</span>{<span class="ex">quote</span>}},</a>
+<a class="sourceLine" id="cb319-7" data-line-number="7"> },</a>
+<a class="sourceLine" id="cb319-8" data-line-number="8">}</a>
+<a class="sourceLine" id="cb319-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb319-10" data-line-number="10"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb319-11" data-line-number="11">A quote from William Shakespeare&#39;s King Lear:</a>
+<a class="sourceLine" id="cb319-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb319-13" data-line-number="13">&gt; This is the excellent foppery of the world that when we are</a>
+<a class="sourceLine" id="cb319-14" data-line-number="14">&gt; sick in fortune---often the surfeit of our own behavior---we</a>
+<a class="sourceLine" id="cb319-15" data-line-number="15">&gt; make guilty of our disasters the sun, the moon, and the</a>
+<a class="sourceLine" id="cb319-16" data-line-number="16">&gt; stars [...]</a>
+<a class="sourceLine" id="cb319-17" data-line-number="17"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb319-18" data-line-number="18"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb320"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb320-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>A quote from William Shakespeare’s King Lear:</p>
+<blockquote>
+<p>This is the excellent foppery of the world that when we are sick in fortune—often the surfeit of our own behavior—we make guilty of our disasters the sun, the moon, and the stars […]</p>
+</blockquote>
+</blockquote>
+<h5 id="context-example-30" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb321"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb321-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb321-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererBlockQuoteBegin{\startquotation}</a>
+<a class="sourceLine" id="cb321-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererBlockQuoteEnd{\stopquotation}</a>
+<a class="sourceLine" id="cb321-4" data-line-number="4"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb321-5" data-line-number="5"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb321-6" data-line-number="6">A quote from William Shakespeare&#39;s King Lear:</a>
+<a class="sourceLine" id="cb321-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb321-8" data-line-number="8">&gt; This is the excellent foppery of the world that when we are</a>
+<a class="sourceLine" id="cb321-9" data-line-number="9">&gt; sick in fortune---often the surfeit of our own behavior---we</a>
+<a class="sourceLine" id="cb321-10" data-line-number="10">&gt; make guilty of our disasters the sun, the moon, and the</a>
+<a class="sourceLine" id="cb321-11" data-line-number="11">&gt; stars [...]</a>
+<a class="sourceLine" id="cb321-12" data-line-number="12"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb321-13" data-line-number="13"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb322"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb322-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>A quote from William Shakespeare’s King Lear:</p>
+<blockquote>
+<p>This is the excellent foppery of the world that when we are sick in fortune—often the surfeit of our own behavior—we make guilty of our disasters the sun, the moon, and the stars […]</p>
+</blockquote>
+</blockquote>
+<p>The <code>\markdownRendererBlockQuoteEnd</code> macro represents the end of a block quote. The macro receives no arguments.</p>
+<h4 id="code-block-renderers"><span class="header-section-number">2.3.1.15</span> Code Block Renderers</h4>
+<p>The <code>\markdownRendererInputVerbatim</code> macro represents a code block. The macro receives a single argument that corresponds to the filename of a file contaning the code block contents.</p>
+<p>The <code>\markdownRendererInputFencedCode</code> macro represents a fenced code block. This macro will only be produced, when the <strong><code>fencedCode</code></strong> option is <code>true</code>. The macro receives two arguments that correspond to the filename of a file contaning the code block contents and to the code fence infostring.</p>
+<h5 id="latex-example-36" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb323"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb323-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb323-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">verbatim</span>}</a>
+<a class="sourceLine" id="cb323-3" data-line-number="3"><span class="bu">\usepackage</span>[hyphens]{<span class="ex">url</span>}</a>
+<a class="sourceLine" id="cb323-4" data-line-number="4"><span class="bu">\usepackage</span>[fencedCode]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb323-5" data-line-number="5"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb323-6" data-line-number="6"> renderers = {</a>
+<a class="sourceLine" id="cb323-7" data-line-number="7"> interblockSeparator = {</a>
+<a class="sourceLine" id="cb323-8" data-line-number="8"> <span class="fu">\def</span>\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb323-9" data-line-number="9"> \par</a>
+<a class="sourceLine" id="cb323-10" data-line-number="10"> \def\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb323-11" data-line-number="11"> \def\markdownRendererInterblockSeparator{<span class="co">%</span></a>
+<a class="sourceLine" id="cb323-12" data-line-number="12"> \par</a>
+<a class="sourceLine" id="cb323-13" data-line-number="13"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb323-14" data-line-number="14"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb323-15" data-line-number="15"> }<span class="co">%</span></a>
+<a class="sourceLine" id="cb323-16" data-line-number="16"> },</a>
+<a class="sourceLine" id="cb323-17" data-line-number="17"> inputVerbatim = {</a>
+<a class="sourceLine" id="cb323-18" data-line-number="18"> is contained in file <span class="fu">\url</span>{#1}:<span class="co">%</span></a>
+<a class="sourceLine" id="cb323-19" data-line-number="19"> <span class="fu">\verbatiminput</span>{#1}<span class="co">%</span></a>
+<a class="sourceLine" id="cb323-20" data-line-number="20"> },</a>
+<a class="sourceLine" id="cb323-21" data-line-number="21"> inputFencedCode = {</a>
+<a class="sourceLine" id="cb323-22" data-line-number="22"> in #2 <span class="fu">\markdownRendererInputVerbatim</span>{#1}<span class="co">%</span></a>
+<a class="sourceLine" id="cb323-23" data-line-number="23"> },</a>
+<a class="sourceLine" id="cb323-24" data-line-number="24"> },</a>
+<a class="sourceLine" id="cb323-25" data-line-number="25">}</a>
+<a class="sourceLine" id="cb323-26" data-line-number="26"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb323-27" data-line-number="27"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb323-28" data-line-number="28">The following code</a>
+<a class="sourceLine" id="cb323-29" data-line-number="29"></a>
+<a class="sourceLine" id="cb323-30" data-line-number="30"> def foo(bar):</a>
+<a class="sourceLine" id="cb323-31" data-line-number="31"> if len(bar) &lt;= 1:</a>
+<a class="sourceLine" id="cb323-32" data-line-number="32"> return bar[0]</a>
+<a class="sourceLine" id="cb323-33" data-line-number="33"> elif len(bar) == 2:</a>
+<a class="sourceLine" id="cb323-34" data-line-number="34"> return sorted(bar)</a>
+<a class="sourceLine" id="cb323-35" data-line-number="35"> else:</a>
+<a class="sourceLine" id="cb323-36" data-line-number="36"> baz = len(bar) // 2</a>
+<a class="sourceLine" id="cb323-37" data-line-number="37"> return foo(bar[baz:], bar[:baz])</a>
+<a class="sourceLine" id="cb323-38" data-line-number="38"></a>
+<a class="sourceLine" id="cb323-39" data-line-number="39">The following code</a>
+<a class="sourceLine" id="cb323-40" data-line-number="40"></a>
+<a class="sourceLine" id="cb323-41" data-line-number="41">~~~ Python</a>
+<a class="sourceLine" id="cb323-42" data-line-number="42">&gt;&gt;&gt; foo([4, 2, 1, 3])</a>
+<a class="sourceLine" id="cb323-43" data-line-number="43">[1, 2, 3, 4]</a>
+<a class="sourceLine" id="cb323-44" data-line-number="44">~~~~~~~~~~</a>
+<a class="sourceLine" id="cb323-45" data-line-number="45"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb323-46" data-line-number="46"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb324"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb324-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text except for the filename, which may differ:</p>
+<blockquote>
+<p>The following code is contained in file <code>./_markdown_document/882453149edcf288976647f6fe147ada.verbatim</code>:</p>
+<div class="sourceCode" id="cb325"><pre class="sourceCode py"><code class="sourceCode python"><a class="sourceLine" id="cb325-1" data-line-number="1"><span class="kw">def</span> foo(bar):</a>
+<a class="sourceLine" id="cb325-2" data-line-number="2"> <span class="cf">if</span> <span class="bu">len</span>(bar) <span class="op">&lt;=</span> <span class="dv">1</span>:</a>
+<a class="sourceLine" id="cb325-3" data-line-number="3"> <span class="cf">return</span> bar[:<span class="dv">1</span>]</a>
+<a class="sourceLine" id="cb325-4" data-line-number="4"> <span class="cf">elif</span> <span class="bu">len</span>(bar) <span class="op">==</span> <span class="dv">2</span>:</a>
+<a class="sourceLine" id="cb325-5" data-line-number="5"> <span class="cf">return</span> <span class="bu">sorted</span>(bar)</a>
+<a class="sourceLine" id="cb325-6" data-line-number="6"> <span class="cf">else</span>:</a>
+<a class="sourceLine" id="cb325-7" data-line-number="7"> baz <span class="op">=</span> bar[<span class="bu">len</span>(bar) <span class="op">//</span> <span class="dv">2</span>]</a>
+<a class="sourceLine" id="cb325-8" data-line-number="8"> <span class="cf">return</span> (</a>
+<a class="sourceLine" id="cb325-9" data-line-number="9"> foo([qux <span class="cf">for</span> qux <span class="kw">in</span> bar <span class="cf">if</span> qux <span class="op">&lt;</span> baz]) <span class="op">+</span> [baz] <span class="op">+</span></a>
+<a class="sourceLine" id="cb325-10" data-line-number="10"> foo([qux <span class="cf">for</span> qux <span class="kw">in</span> bar <span class="cf">if</span> qux <span class="op">&gt;</span> baz])</a>
+<a class="sourceLine" id="cb325-11" data-line-number="11"> )</a></code></pre></div>
+<p>The following code in Python contained in file <code>./_markdown_document/cf2a96e2120cef5b1fae5fea36fcc27b.verbatim</code>:</p>
+<div class="sourceCode" id="cb326"><pre class="sourceCode py"><code class="sourceCode python"><a class="sourceLine" id="cb326-1" data-line-number="1"><span class="op">&gt;&gt;&gt;</span> foo([<span class="dv">4</span>, <span class="dv">2</span>, <span class="dv">1</span>, <span class="dv">3</span>])</a>
+<a class="sourceLine" id="cb326-2" data-line-number="2">[<span class="dv">1</span>, <span class="dv">2</span>, <span class="dv">3</span>, <span class="dv">4</span>]</a></code></pre></div>
+</blockquote>
+<h4 id="heading-renderers"><span class="header-section-number">2.3.1.16</span> Heading Renderers</h4>
+<p>The <code>\markdownRendererHeadingOne</code> macro represents a first level heading. The macro receives a single argument that corresponds to the heading text.</p>
+<p>The <code>\markdownRendererHeadingTwo</code> macro represents a second level heading. The macro receives a single argument that corresponds to the heading text.</p>
+<p>The <code>\markdownRendererHeadingThree</code> macro represents a third level heading. The macro receives a single argument that corresponds to the heading text.</p>
+<p>The <code>\markdownRendererHeadingFour</code> macro represents a fourth level heading. The macro receives a single argument that corresponds to the heading text.</p>
+<p>The <code>\markdownRendererHeadingFive</code> macro represents a fifth level heading. The macro receives a single argument that corresponds to the heading text.</p>
+<p>The <code>\markdownRendererHeadingSix</code> macro represents a sixth level heading. The macro receives a single argument that corresponds to the heading text.</p>
+<h5 id="plain-tex-example-23" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb327"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb327-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb327-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a>
+<a class="sourceLine" id="cb327-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererHeadingOne{1}</a>
+<a class="sourceLine" id="cb327-4" data-line-number="4"><span class="fu">\def</span>\markdownRendererHeadingTwo{2}</a>
+<a class="sourceLine" id="cb327-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererHeadingThree{3}</a>
+<a class="sourceLine" id="cb327-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererHeadingFour{4}</a>
+<a class="sourceLine" id="cb327-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererHeadingFive{5}</a>
+<a class="sourceLine" id="cb327-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererHeadingSix{6}</a>
+<a class="sourceLine" id="cb327-9" data-line-number="9"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb327-10" data-line-number="10">######</a>
+<a class="sourceLine" id="cb327-11" data-line-number="11">#####</a>
+<a class="sourceLine" id="cb327-12" data-line-number="12">#####</a>
+<a class="sourceLine" id="cb327-13" data-line-number="13">###</a>
+<a class="sourceLine" id="cb327-14" data-line-number="14">######</a>
+<a class="sourceLine" id="cb327-15" data-line-number="15"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb327-16" data-line-number="16"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb328"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb328-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>65536</p>
+</blockquote>
+<h5 id="latex-example-37" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb329"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb329-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb329-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb329-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb329-4" data-line-number="4"> renderers = {</a>
+<a class="sourceLine" id="cb329-5" data-line-number="5"> interblockSeparator = {},</a>
+<a class="sourceLine" id="cb329-6" data-line-number="6"> headingOne = 1,</a>
+<a class="sourceLine" id="cb329-7" data-line-number="7"> headingTwo = 2,</a>
+<a class="sourceLine" id="cb329-8" data-line-number="8"> headingThree = 3,</a>
+<a class="sourceLine" id="cb329-9" data-line-number="9"> headingFour = 4,</a>
+<a class="sourceLine" id="cb329-10" data-line-number="10"> headingFive = 5,</a>
+<a class="sourceLine" id="cb329-11" data-line-number="11"> headingSix = 6,</a>
+<a class="sourceLine" id="cb329-12" data-line-number="12"> },</a>
+<a class="sourceLine" id="cb329-13" data-line-number="13">}</a>
+<a class="sourceLine" id="cb329-14" data-line-number="14"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb329-15" data-line-number="15"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb329-16" data-line-number="16">######</a>
+<a class="sourceLine" id="cb329-17" data-line-number="17">#####</a>
+<a class="sourceLine" id="cb329-18" data-line-number="18">#####</a>
+<a class="sourceLine" id="cb329-19" data-line-number="19">###</a>
+<a class="sourceLine" id="cb329-20" data-line-number="20">######</a>
+<a class="sourceLine" id="cb329-21" data-line-number="21"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb329-22" data-line-number="22"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb330"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb330-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>65536</p>
+</blockquote>
+<h5 id="context-example-31" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb331"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb331-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb331-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererInterblockSeparator{}</a>
+<a class="sourceLine" id="cb331-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererHeadingOne{1}</a>
+<a class="sourceLine" id="cb331-4" data-line-number="4"><span class="fu">\def</span>\markdownRendererHeadingTwo{2}</a>
+<a class="sourceLine" id="cb331-5" data-line-number="5"><span class="fu">\def</span>\markdownRendererHeadingThree{3}</a>
+<a class="sourceLine" id="cb331-6" data-line-number="6"><span class="fu">\def</span>\markdownRendererHeadingFour{4}</a>
+<a class="sourceLine" id="cb331-7" data-line-number="7"><span class="fu">\def</span>\markdownRendererHeadingFive{5}</a>
+<a class="sourceLine" id="cb331-8" data-line-number="8"><span class="fu">\def</span>\markdownRendererHeadingSix{6}</a>
+<a class="sourceLine" id="cb331-9" data-line-number="9"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb331-10" data-line-number="10"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb331-11" data-line-number="11">######</a>
+<a class="sourceLine" id="cb331-12" data-line-number="12">#####</a>
+<a class="sourceLine" id="cb331-13" data-line-number="13">#####</a>
+<a class="sourceLine" id="cb331-14" data-line-number="14">###</a>
+<a class="sourceLine" id="cb331-15" data-line-number="15">######</a>
+<a class="sourceLine" id="cb331-16" data-line-number="16"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb331-17" data-line-number="17"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb332"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb332-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>65536</p>
+</blockquote>
+<h4 id="horizontal-rule-renderer"><span class="header-section-number">2.3.1.17</span> Horizontal Rule Renderer</h4>
+<p>The <code>\markdownRendererHorizontalRule</code> macro represents a horizontal rule. The macro receives no arguments.</p>
+<h5 id="plain-tex-example-24" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb333"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb333-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb333-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererHorizontalRule{\vfil\break}</a>
+<a class="sourceLine" id="cb333-3" data-line-number="3"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb333-4" data-line-number="4">This is the first page.</a>
+<a class="sourceLine" id="cb333-5" data-line-number="5"></a>
+<a class="sourceLine" id="cb333-6" data-line-number="6">***</a>
+<a class="sourceLine" id="cb333-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb333-8" data-line-number="8">This is the second page.</a>
+<a class="sourceLine" id="cb333-9" data-line-number="9"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb333-10" data-line-number="10"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb334"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb334-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is the first page.</p>
+<hr />
+<p>This is the second page.</p>
+</blockquote>
+<h5 id="latex-example-38" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb335"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb335-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb335-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb335-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb335-4" data-line-number="4"> renderers = {</a>
+<a class="sourceLine" id="cb335-5" data-line-number="5"> horizontalRule = <span class="fu">\newpage</span>,</a>
+<a class="sourceLine" id="cb335-6" data-line-number="6"> },</a>
+<a class="sourceLine" id="cb335-7" data-line-number="7">}</a>
+<a class="sourceLine" id="cb335-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb335-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb335-10" data-line-number="10">This is the first page.</a>
+<a class="sourceLine" id="cb335-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb335-12" data-line-number="12">***</a>
+<a class="sourceLine" id="cb335-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb335-14" data-line-number="14">This is the second page.</a>
+<a class="sourceLine" id="cb335-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb335-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb336"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb336-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is the first page.</p>
+<hr />
+<p>This is the second page.</p>
+</blockquote>
+<h5 id="context-example-32" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb337"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb337-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb337-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererHorizontalRule{\page[yes]}</a>
+<a class="sourceLine" id="cb337-3" data-line-number="3"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb337-4" data-line-number="4"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb337-5" data-line-number="5">This is the first page.</a>
+<a class="sourceLine" id="cb337-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb337-7" data-line-number="7">***</a>
+<a class="sourceLine" id="cb337-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb337-9" data-line-number="9">This is the second page.</a>
+<a class="sourceLine" id="cb337-10" data-line-number="10"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb337-11" data-line-number="11"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb338"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb338-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is the first page.</p>
+<hr />
+<p>This is the second page.</p>
+</blockquote>
+<h4 id="footnote-renderer"><span class="header-section-number">2.3.1.18</span> Footnote Renderer</h4>
+<p>The <code>\markdownRendererFootnote</code> macro represents a footnote. This macro will only be produced, when the <strong><code>footnotes</code></strong> option is <code>true</code>. The macro receives a single argument that corresponds to the footnote text.</p>
+<h5 id="plain-tex-example-25" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb339"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb339-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb339-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFootnotes{true}</a>
+<a class="sourceLine" id="cb339-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererFootnote#1{ (and \lowercase{#1})}</a>
+<a class="sourceLine" id="cb339-4" data-line-number="4"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb339-5" data-line-number="5">This is some text[^1] and this is some other text[^2].</a>
+<a class="sourceLine" id="cb339-6" data-line-number="6"></a>
+<a class="sourceLine" id="cb339-7" data-line-number="7"> [^1]: this is a footnote</a>
+<a class="sourceLine" id="cb339-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb339-9" data-line-number="9"> [^2]: this is some other footnote</a>
+<a class="sourceLine" id="cb339-10" data-line-number="10"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb339-11" data-line-number="11"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb340"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb340-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is some text (and this is a footnote) and this is some other text (and this is some other footnote).</p>
+</blockquote>
+<h5 id="latex-example-39" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb341"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb341-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb341-2" data-line-number="2"><span class="bu">\usepackage</span>[footnotes]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb341-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb341-4" data-line-number="4"> renderers = {</a>
+<a class="sourceLine" id="cb341-5" data-line-number="5"> footnote = { (and <span class="fu">\MakeLowercase</span>{#1})},</a>
+<a class="sourceLine" id="cb341-6" data-line-number="6"> },</a>
+<a class="sourceLine" id="cb341-7" data-line-number="7">}</a>
+<a class="sourceLine" id="cb341-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb341-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb341-10" data-line-number="10">This is some text[^1] and this is some other text[^2].</a>
+<a class="sourceLine" id="cb341-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb341-12" data-line-number="12"> [^1]: this is a footnote</a>
+<a class="sourceLine" id="cb341-13" data-line-number="13"></a>
+<a class="sourceLine" id="cb341-14" data-line-number="14"> [^2]: this is some other footnote</a>
+<a class="sourceLine" id="cb341-15" data-line-number="15"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb341-16" data-line-number="16"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb342"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb342-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is some text (and this is a footnote) and this is some other text (and this is some other footnote).</p>
+</blockquote>
+<h5 id="context-example-33" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb343"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb343-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb343-2" data-line-number="2"><span class="fu">\def</span>\markdownOptionFootnotes{true}</a>
+<a class="sourceLine" id="cb343-3" data-line-number="3"><span class="fu">\def</span>\markdownRendererFootnote#1{ (and \lowercase{#1})}</a>
+<a class="sourceLine" id="cb343-4" data-line-number="4"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb343-5" data-line-number="5"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb343-6" data-line-number="6">This is some text[^1] and this is some other text[^2].</a>
+<a class="sourceLine" id="cb343-7" data-line-number="7"></a>
+<a class="sourceLine" id="cb343-8" data-line-number="8"> [^1]: this is a footnote</a>
+<a class="sourceLine" id="cb343-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb343-10" data-line-number="10"> [^2]: this is some other footnote</a>
+<a class="sourceLine" id="cb343-11" data-line-number="11"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb343-12" data-line-number="12"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb344"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb344-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is some text (and this is a footnote) and this is some other text (and this is some other footnote).</p>
+</blockquote>
+<h4 id="parenthesized-citations-renderer"><span class="header-section-number">2.3.1.19</span> Parenthesized Citations Renderer</h4>
+<p>The <code>\markdownRendererCite</code> macro represents a string of one or more parenthetical citations. This macro will only be produced, when the <strong><code>citations</code></strong> option is <code>true</code>. The macro receives the parameter <code>{</code>⟨<em>number of citations</em>⟩<code>}</code> followed by <code>{</code>⟨<em>prenote</em>⟩<code>}{</code>⟨<em>postnote</em>⟩<code>}{</code>⟨<em>name</em>⟩<code>}</code> repeated ⟨<em>number of citations</em>⟩ times. The ⟨<em>suppress author</em>⟩ parameter is either the token <code>-</code>, when the author’s name is to be suppressed, or <code>+</code> otherwise.</p>
+<h5 id="latex-example-40" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb345"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb345-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb345-2" data-line-number="2"><span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb345-3" data-line-number="3"><span class="fu">\newcount\citationsCounter</span></a>
+<a class="sourceLine" id="cb345-4" data-line-number="4"><span class="fu">\newcount\citationsTotal</span></a>
+<a class="sourceLine" id="cb345-5" data-line-number="5"><span class="fu">\makeatletter</span></a>
+<a class="sourceLine" id="cb345-6" data-line-number="6"><span class="fu">\def</span>\citations#1#2#3#4{<span class="co">%</span></a>
+<a class="sourceLine" id="cb345-7" data-line-number="7"> a parenthesized citation \emph{#4}</a>
+<a class="sourceLine" id="cb345-8" data-line-number="8"> \advance\citationsCounter by 1\relax</a>
+<a class="sourceLine" id="cb345-9" data-line-number="9"> \ifx\relax#2\relax</a>
+<a class="sourceLine" id="cb345-10" data-line-number="10"> \ifx\relax#3\relax\else</a>
+<a class="sourceLine" id="cb345-11" data-line-number="11"> with a postfix \emph{#3}<span class="co">%</span></a>
+<a class="sourceLine" id="cb345-12" data-line-number="12"> \fi</a>
+<a class="sourceLine" id="cb345-13" data-line-number="13"> \else</a>
+<a class="sourceLine" id="cb345-14" data-line-number="14"> with a prefix \emph{#2}<span class="co">%</span></a>
+<a class="sourceLine" id="cb345-15" data-line-number="15"> \ifx\relax#3\relax\else</a>
+<a class="sourceLine" id="cb345-16" data-line-number="16"> \ and a postfix \emph{#3}<span class="co">%</span></a>
+<a class="sourceLine" id="cb345-17" data-line-number="17"> \fi</a>
+<a class="sourceLine" id="cb345-18" data-line-number="18"> \fi</a>
+<a class="sourceLine" id="cb345-19" data-line-number="19"> \ifnum\citationsCounter&gt;\citationsTotal\relax</a>
+<a class="sourceLine" id="cb345-20" data-line-number="20"> .<span class="co">%</span></a>
+<a class="sourceLine" id="cb345-21" data-line-number="21"> \expandafter\@gobble</a>
+<a class="sourceLine" id="cb345-22" data-line-number="22"> \else</a>
+<a class="sourceLine" id="cb345-23" data-line-number="23"> , and</a>
+<a class="sourceLine" id="cb345-24" data-line-number="24"> \fi\citations}</a>
+<a class="sourceLine" id="cb345-25" data-line-number="25"><span class="fu">\makeatother</span></a>
+<a class="sourceLine" id="cb345-26" data-line-number="26"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb345-27" data-line-number="27"> renderers = {</a>
+<a class="sourceLine" id="cb345-28" data-line-number="28"> cite = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb345-29" data-line-number="29"> <span class="fu">\citationsCounter</span>=1<span class="co">%</span></a>
+<a class="sourceLine" id="cb345-30" data-line-number="30"> <span class="fu">\citationsTotal</span>=#1<span class="co">%</span></a>
+<a class="sourceLine" id="cb345-31" data-line-number="31"> This is</a>
+<a class="sourceLine" id="cb345-32" data-line-number="32"> <span class="fu">\expandafter\citations</span></a>
+<a class="sourceLine" id="cb345-33" data-line-number="33"> },</a>
+<a class="sourceLine" id="cb345-34" data-line-number="34"> },</a>
+<a class="sourceLine" id="cb345-35" data-line-number="35">}</a>
+<a class="sourceLine" id="cb345-36" data-line-number="36"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb345-37" data-line-number="37"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb345-38" data-line-number="38">[see @abrahams90, pp. 12; @eijkhout91, pp. 34]</a>
+<a class="sourceLine" id="cb345-39" data-line-number="39"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb345-40" data-line-number="40"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb346"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb346-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is a parenthesized citation <em>abrahams90</em> with a prefix see and a postfix <em>pp. &gt; 12</em>, and a citation <em>eijkhout91</em> with a postfix <em>pp. 34</em>.</p>
+</blockquote>
+<h4 id="text-citations-renderer"><span class="header-section-number">2.3.1.20</span> Text Citations Renderer</h4>
+<p>The <code>\markdownRendererTextCite</code> macro represents a string of one or more text citations. This macro will only be produced, when the <strong><code>citations</code></strong> option is <code>true</code>. The macro receives parameters in the same format as the <code>\markdownRendererCite</code> macro.</p>
+<h5 id="latex-example-41" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb347"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb347-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb347-2" data-line-number="2"><span class="bu">\usepackage</span>[citations]{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb347-3" data-line-number="3"><span class="fu">\newcount\citationsCounter</span></a>
+<a class="sourceLine" id="cb347-4" data-line-number="4"><span class="fu">\newcount\citationsTotal</span></a>
+<a class="sourceLine" id="cb347-5" data-line-number="5"><span class="fu">\makeatletter</span></a>
+<a class="sourceLine" id="cb347-6" data-line-number="6"><span class="fu">\def</span>\citations#1#2#3#4{<span class="co">%</span></a>
+<a class="sourceLine" id="cb347-7" data-line-number="7"> a text citation \emph{#4}</a>
+<a class="sourceLine" id="cb347-8" data-line-number="8"> \advance\citationsCounter by 1\relax</a>
+<a class="sourceLine" id="cb347-9" data-line-number="9"> \ifx\relax#2\relax</a>
+<a class="sourceLine" id="cb347-10" data-line-number="10"> \ifx\relax#3\relax\else</a>
+<a class="sourceLine" id="cb347-11" data-line-number="11"> with a postfix \emph{#3}<span class="co">%</span></a>
+<a class="sourceLine" id="cb347-12" data-line-number="12"> \fi</a>
+<a class="sourceLine" id="cb347-13" data-line-number="13"> \else</a>
+<a class="sourceLine" id="cb347-14" data-line-number="14"> with a prefix \emph{#2}<span class="co">%</span></a>
+<a class="sourceLine" id="cb347-15" data-line-number="15"> \ifx\relax#3\relax\else</a>
+<a class="sourceLine" id="cb347-16" data-line-number="16"> \ and a postfix \emph{#3}<span class="co">%</span></a>
+<a class="sourceLine" id="cb347-17" data-line-number="17"> \fi</a>
+<a class="sourceLine" id="cb347-18" data-line-number="18"> \fi</a>
+<a class="sourceLine" id="cb347-19" data-line-number="19"> \ifnum\citationsCounter&gt;\citationsTotal\relax</a>
+<a class="sourceLine" id="cb347-20" data-line-number="20"> .<span class="co">%</span></a>
+<a class="sourceLine" id="cb347-21" data-line-number="21"> \expandafter\@gobble</a>
+<a class="sourceLine" id="cb347-22" data-line-number="22"> \else</a>
+<a class="sourceLine" id="cb347-23" data-line-number="23"> , and</a>
+<a class="sourceLine" id="cb347-24" data-line-number="24"> \fi\citations}</a>
+<a class="sourceLine" id="cb347-25" data-line-number="25"><span class="fu">\makeatother</span></a>
+<a class="sourceLine" id="cb347-26" data-line-number="26"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb347-27" data-line-number="27"> renderers = {</a>
+<a class="sourceLine" id="cb347-28" data-line-number="28"> textCite = {<span class="co">%</span></a>
+<a class="sourceLine" id="cb347-29" data-line-number="29"> <span class="fu">\citationsCounter</span>=1<span class="co">%</span></a>
+<a class="sourceLine" id="cb347-30" data-line-number="30"> <span class="fu">\citationsTotal</span>=#1<span class="co">%</span></a>
+<a class="sourceLine" id="cb347-31" data-line-number="31"> This is</a>
+<a class="sourceLine" id="cb347-32" data-line-number="32"> <span class="fu">\expandafter\citations</span></a>
+<a class="sourceLine" id="cb347-33" data-line-number="33"> },</a>
+<a class="sourceLine" id="cb347-34" data-line-number="34"> },</a>
+<a class="sourceLine" id="cb347-35" data-line-number="35">}</a>
+<a class="sourceLine" id="cb347-36" data-line-number="36"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb347-37" data-line-number="37"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb347-38" data-line-number="38">@abrahams90 [pp. 12; also @eijkhout91]</a>
+<a class="sourceLine" id="cb347-39" data-line-number="39"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb347-40" data-line-number="40"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb348"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb348-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>This is a text citation <em>abrahams90</em> with a postfix <em>pp. 12</em>, and a citation <em>eijkhout91</em> with a prefix <em>also</em>.</p>
+</blockquote>
+<h3 id="token-renderer-prototypes"><span class="header-section-number">2.3.2</span> Token Renderer Prototypes</h3>
+<p>By default, token renderers point to package-defined <span class="tex">T<sub>e</sub>X</span> macros, further referred to as <em>prototypes</em>, which provide useful default definitions.</p>
+<h5 id="plain-tex-example-26" class="unnumbered">Plain <span class="tex">T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb349"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb349-1" data-line-number="1"><span class="fu">\input</span> markdown</a>
+<a class="sourceLine" id="cb349-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererTildePrototype{<span class="co">%</span></a>
+<a class="sourceLine" id="cb349-3" data-line-number="3"> Packages can specify token renderer prototypes.<span class="co">%</span></a>
+<a class="sourceLine" id="cb349-4" data-line-number="4">}</a>
+<a class="sourceLine" id="cb349-5" data-line-number="5"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb349-6" data-line-number="6">~</a>
+<a class="sourceLine" id="cb349-7" data-line-number="7"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb349-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb349-9" data-line-number="9"><span class="fu">\def</span>\markdownRendererTilde{<span class="co">%</span></a>
+<a class="sourceLine" id="cb349-10" data-line-number="10"> User-defined token renderers take precedence.<span class="co">%</span></a>
+<a class="sourceLine" id="cb349-11" data-line-number="11">}</a>
+<a class="sourceLine" id="cb349-12" data-line-number="12"><span class="fu">\markdownBegin</span></a>
+<a class="sourceLine" id="cb349-13" data-line-number="13">~</a>
+<a class="sourceLine" id="cb349-14" data-line-number="14"><span class="fu">\markdownEnd</span></a>
+<a class="sourceLine" id="cb349-15" data-line-number="15"><span class="fu">\bye</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb350"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb350-1" data-line-number="1"><span class="ex">luatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Packages can specify token renderer prototypes.</p>
+<p>User-defined token renderers take precedence.</p>
+</blockquote>
+<h5 id="latex-example-42" class="unnumbered"><span class="latex">L<sup>a</sup>T<sub>e</sub>X</span> Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb351"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb351-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">article</span>}</a>
+<a class="sourceLine" id="cb351-2" data-line-number="2"><span class="bu">\usepackage</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb351-3" data-line-number="3"><span class="fu">\markdownSetup</span>{</a>
+<a class="sourceLine" id="cb351-4" data-line-number="4"> rendererPrototypes = {</a>
+<a class="sourceLine" id="cb351-5" data-line-number="5"> tilde = {Packages can specify token renderer prototypes.},</a>
+<a class="sourceLine" id="cb351-6" data-line-number="6"> },</a>
+<a class="sourceLine" id="cb351-7" data-line-number="7">}</a>
+<a class="sourceLine" id="cb351-8" data-line-number="8"><span class="kw">\begin</span>{<span class="ex">document</span>}</a>
+<a class="sourceLine" id="cb351-9" data-line-number="9"><span class="kw">\begin</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb351-10" data-line-number="10">~</a>
+<a class="sourceLine" id="cb351-11" data-line-number="11"><span class="kw">\end</span>{<span class="ex">markdown</span>}</a>
+<a class="sourceLine" id="cb351-12" data-line-number="12"></a>
+<a class="sourceLine" id="cb351-13" data-line-number="13"><span class="kw">\begin</span>{<span class="ex">markdown*</span>}{</a>
+<a class="sourceLine" id="cb351-14" data-line-number="14"> renderers = {</a>
+<a class="sourceLine" id="cb351-15" data-line-number="15"> tilde = {User-defined token renderers take precedence.},</a>
+<a class="sourceLine" id="cb351-16" data-line-number="16"> },</a>
+<a class="sourceLine" id="cb351-17" data-line-number="17">}</a>
+<a class="sourceLine" id="cb351-18" data-line-number="18">~</a>
+<a class="sourceLine" id="cb351-19" data-line-number="19"><span class="kw">\end</span>{<span class="ex">markdown*</span>}</a>
+<a class="sourceLine" id="cb351-20" data-line-number="20"><span class="kw">\end</span>{<span class="ex">document</span>}</a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb352"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb352-1" data-line-number="1"><span class="ex">lualatex</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Packages can specify token renderer prototypes.</p>
+<p>User-defined token renderers take precedence.</p>
+</blockquote>
+<h5 id="context-example-34" class="unnumbered">Con<span class="tex">T<sub>e</sub>X</span>t Example</h5>
+<p>Using a text editor, create a text document named <code>document.tex</code> with the following content:</p>
+<div class="sourceCode" id="cb353"><pre class="sourceCode tex"><code class="sourceCode latex"><a class="sourceLine" id="cb353-1" data-line-number="1"><span class="fu">\usemodule</span>[t][markdown]</a>
+<a class="sourceLine" id="cb353-2" data-line-number="2"><span class="fu">\def</span>\markdownRendererTildePrototype{<span class="co">%</span></a>
+<a class="sourceLine" id="cb353-3" data-line-number="3"> Packages can specify token renderer prototypes.<span class="co">%</span></a>
+<a class="sourceLine" id="cb353-4" data-line-number="4">}</a>
+<a class="sourceLine" id="cb353-5" data-line-number="5"><span class="fu">\starttext</span></a>
+<a class="sourceLine" id="cb353-6" data-line-number="6"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb353-7" data-line-number="7">~</a>
+<a class="sourceLine" id="cb353-8" data-line-number="8"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb353-9" data-line-number="9"></a>
+<a class="sourceLine" id="cb353-10" data-line-number="10"><span class="fu">\def</span>\markdownRendererTilde{<span class="co">%</span></a>
+<a class="sourceLine" id="cb353-11" data-line-number="11"> User-defined token renderers take precedence.<span class="co">%</span></a>
+<a class="sourceLine" id="cb353-12" data-line-number="12">}</a>
+<a class="sourceLine" id="cb353-13" data-line-number="13"><span class="fu">\startmarkdown</span></a>
+<a class="sourceLine" id="cb353-14" data-line-number="14">~</a>
+<a class="sourceLine" id="cb353-15" data-line-number="15"><span class="fu">\stopmarkdown</span></a>
+<a class="sourceLine" id="cb353-16" data-line-number="16"><span class="fu">\stoptext</span></a></code></pre></div>
+<p>Next, invoke LuaTeX from the terminal:</p>
+<div class="sourceCode" id="cb354"><pre class="sourceCode sh"><code class="sourceCode bash"><a class="sourceLine" id="cb354-1" data-line-number="1"><span class="ex">context</span> document.tex</a></code></pre></div>
+<p>A PDF document named <code>document.pdf</code> should be produced and contain the following text:</p>
+<blockquote>
+<p>Packages can specify token renderer prototypes.</p>
+<p>User-defined token renderers take precedence.</p>
+</blockquote>
+<section class="footnotes">
<hr />
<ol>
-<li id="fn1"><p>Here is the footnote.<a href="#fnref1">↩</a></p></li>
-<li id="fn2"><p>Here's one with multiple blocks.</p>
+<li id="fn1"><p>Here is the footnote.<a href="#fnref1" class="footnote-back">↩</a></p></li>
+<li id="fn2"><p>Here’s one with multiple blocks.</p>
<p>Subsequent paragraphs are indented to show that they belong to the previous footnote.</p>
<pre><code>{ some.code }</code></pre>
-<p>The whole paragraph can be indented, or just the first line. In this way, multi-paragraph footnotes work like multi-paragraph list items.<a href="#fnref2">↩</a></p></li>
-<li id="fn3"><p>Here is the footnote.<a href="#fnref3">↩</a></p></li>
-<li id="fn4"><p>Here's one with multiple blocks.</p>
+<p>The whole paragraph can be indented, or just the first line. In this way, multi-paragraph footnotes work like multi-paragraph list items.<a href="#fnref2" class="footnote-back">↩</a></p></li>
+<li id="fn3"><p>Here is the footnote.<a href="#fnref3" class="footnote-back">↩</a></p></li>
+<li id="fn4"><p>Here’s one with multiple blocks.</p>
<p>Subsequent paragraphs are indented to show that they belong to the previous footnote.</p>
<pre><code>{ some.code }</code></pre>
-<p>The whole paragraph can be indented, or just the first line. In this way, multi-paragraph footnotes work like multi-paragraph list items.<a href="#fnref4">↩</a></p></li>
-<li id="fn5"><p>Inlines notes are easier to write, since you don't have to pick an identifier and move down to type the note.<a href="#fnref5">↩</a></p></li>
-<li id="fn6"><p>Inlines notes are easier to write, since you don't have to pick an identifier and move down to type the note.<a href="#fnref6">↩</a></p></li>
+<p>The whole paragraph can be indented, or just the first line. In this way, multi-paragraph footnotes work like multi-paragraph list items.<a href="#fnref4" class="footnote-back">↩</a></p></li>
+<li id="fn5"><p>Inlines notes are easier to write, since you don’t have to pick an identifier and move down to type the note.<a href="#fnref5" class="footnote-back">↩</a></p></li>
+<li id="fn6"><p>Inlines notes are easier to write, since you don’t have to pick an identifier and move down to type the note.<a href="#fnref6" class="footnote-back">↩</a></p></li>
</ol>
-</div>
+</section>
</body>
</html>
diff --git a/Master/texmf-dist/doc/generic/markdown/markdown.md b/Master/texmf-dist/doc/generic/markdown/markdown.md
index 7bbfc7fa4f1..ddd8c67dcdb 100644
--- a/Master/texmf-dist/doc/generic/markdown/markdown.md
+++ b/Master/texmf-dist/doc/generic/markdown/markdown.md
@@ -2,6 +2,7 @@
---
title: Markdown Package User Manual
author: Vít Novotný
+date: v\markdownVersion{} (\markdownLastModified{})
---
@@ -9,12 +10,12 @@ author: Vít Novotný
Introduction
============
-The [Markdown package][pkg] converts [markdown][] markup to TeX commands. The
-functionality is provided both as a Lua module, and as plain TeX, LaTeX, and
-ConTeXt macro packages that can be used to directly typeset TeX documents
+The [Markdown package][pkg] converts [markdown][] 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
makes it easy to redefine how each and every markdown element is rendered.
-Creative abuse of the markdown syntax is encouraged. <i class="em em-wink"></i>
+Creative abuse of the markdown syntax is encouraged. ;-)
[markdown]: https://daringfireball.net/projects/markdown/basics/
(Daring Fireball: Markdown Basics)
@@ -23,9 +24,9 @@ Creative abuse of the markdown syntax is encouraged. <i class="em em-wink"></i>
This document is a user manual for the [Markdown package][pkg]. It provides
-beginner tutorials and code examples. For an in-depth description of the
-package requirements, interfaces, and implementation, please refer to the
-[technical documentation][techdoc].
+tutorials and code examples. For an in-depth description of the package
+requirements, interfaces, and implementation, please refer to the [technical
+documentation][techdoc].
[techdoc]: http://mirrors.ctan.org/macros/generic/markdown/markdown.pdf
(A Markdown Interpreter for TeX)
@@ -34,19 +35,19 @@ package requirements, interfaces, and implementation, please refer to the
Requirements
------------
-The package requires a working TeX distribution. [TeX Live][] ≥ 2013 is known to
-work and so are recent installation of [MikTeX][]. If you are using a minimal
-installation of a TeX distribution, please consult the
+The package requires a working \TeX{} distribution. [\TeX{} Live][tl] ≥ 2013 is
+known to work and so are recent installation of [Mik\TeX{}][mik]. If you are
+using a minimal installation of a \TeX{} distribution, please consult the
[technical documentation][techdoc] for a detailed list of required packages.
- [TeX Live]: https://www.tug.org/texlive/ (TeX Live - TeX Users Group)
- [MikTeX]: https://miktex.org/ (Home - MiKTeXorg)
+ [tl]: https://www.tug.org/texlive/ (TeX Live - TeX Users Group)
+ [mik]: https://miktex.org/ (Home - MiKTeXorg)
Installation
------------
-The package comes pre-installed with [TeX Live][] ≥ 2016 and with recent
-installations of [MikTeX][]. Unless you explicitly wish to use the latest
+The package comes pre-installed with [\TeX{} Live][tl] ≥ 2016 and with recent
+installations of [MikTeX][mik]. Unless you explicitly wish to use the latest
version of the package, you are encouraged to skip this step.
To install the package, first download the package from the repository
@@ -55,7 +56,7 @@ using Git:
git clone https://github.com/witiko/markdown
``````
Next, enter the directory named `markdown` and interpret the file named
-`markdown.ins` file using a Unicode-aware TeX engine, such as XeTeX or
+`markdown.ins` file using a Unicode-aware \TeX{} engine, such as XeTeX or
LuaTeX:
``` sh
cd markdown
@@ -63,16 +64,17 @@ luatex markdown.ins
``````
This should produce the following files:
- * `markdown.lua` – the Lua module,
- * `markdown-cli.lua` – the Lua command-line interface,
- * `markdown.tex` – the plain TeX macro package,
- * `markdown.sty` – the LaTeX package, and
- * `t-markdown.tex` – the ConTeXt module.
+ * `markdown.lua`, the Lua module,
+ * `markdown-cli.lua`, the Lua command-line interface,
+ * `markdown.tex`, the plain \TeX{} macro package,
+ * `markdown.sty`, the \LaTeX{} package, and
+ * `t-markdown.tex`, the \Hologo{ConTeXt} module.
-### Local installation
+### Local Installation
-To perform a local installation, place the above files into your TeX directory
-structure. This is generally where the individual files should be placed:
+To perform a local installation, place the above files into your \TeX{}
+directory structure. This is generally where the individual files should be
+placed:
* `<TEXMF>/tex/luatex/markdown/markdown.lua`
* `<TEXMF>/scripts/markdown/markdown-cli.lua`
@@ -80,23 +82,23 @@ structure. This is generally where the individual files should be placed:
* `<TEXMF>/tex/latex/markdown/markdown.sty`
* `<TEXMF>/tex/context/third/markdown/t-markdown.tex`
-where `<TEXMF>` corresponds to a root of your TeX distribution, such as
+where `<TEXMF>` corresponds to a root of your \TeX{} distribution, such as
`/usr/share/texmf` and `~/texmf` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf` on Windows systems. When in doubt,
-consult the manual of your TeX distribution.
+`C:\Users\`\meta{Your username}`\texmf` on Windows systems. When in doubt,
+consult the manual of your \TeX{} distribution.
-### Portable installation ###
+### Portable Installation
Alternatively, you can also store the above files in the same folder as your
-TeX document and distribute them together. This way your document can be
-portably typeset on legacy TeX distributions.
+\TeX{} document and distribute them together. This way your document can be
+portably typeset on legacy \TeX{} distributions.
-First document
+First Document
--------------
In this section, we will take the necessary steps to typeset our first markdown
-document in TeX. This will serve as our first hands-on experience with the
+document in \TeX{}. This will serve as our first hands-on experience with the
package and also as a reassurance that the package has been correctly installed.
### Using Lua
@@ -109,7 +111,7 @@ following content:
\bye
```````
-#### Using the Lua module
+#### Using the Lua Module
Using a text editor, create a text document named `hello.lua` with the
following content:
@@ -133,7 +135,7 @@ texlua hello.lua > hello.tex
pdftex document.tex
``````
-#### Using the Lua CLI
+#### Using the Lua Command-Line Interface
Using a text editor, create a text document named `hello.md` with the
following content:
@@ -142,12 +144,12 @@ Hello *world*!
``````
Next, invoke LuaTeX from the terminal:
``` sh
-texlua <CLI␣PATHNAME> -- hello.md hello.tex
+texlua ⟨CLI pathname⟩ -- hello.md hello.tex
luatex document.tex
``````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
+where \meta{CLI pathname} corresponds to the location of the Lua CLI script file,
such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
+`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows
systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
script file using [Kpathsea][].
@@ -156,11 +158,11 @@ script file using [Kpathsea][].
A PDF document named `document.pdf` should be produced and contain the text “Hello
*world*!” Invoking pdfTeX should have the same effect:
``` sh
-texlua <CLI␣PATHNAME> -- hello.md hello.tex
+texlua ⟨CLI pathname⟩ -- hello.md hello.tex
pdftex document.tex
``````
-### Using plain TeX
+### Using Plain \TeX{}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -181,7 +183,7 @@ A PDF document named `document.pdf` should be produced and contain the text
pdftex --shell-escape document.tex
```````
-### Using LaTeX
+### Using \LaTeX{}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -221,7 +223,7 @@ lualatex latex.tex
``````
to see the effect of your changes.
-### Using ConTeXt
+### Using \Hologo{ConTeXt}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -263,3240 +265,14 @@ to see the effect of your changes.
Examples
========
-This section will show how to use the package by example.
-
-
-Lua
----
-
-The Lua part of the package makes it possible to convert a markdown document
-into TeX commands and typeset it later when convenient. Although the typical
-user will not find this terribly useful and will instead use the plain TeX,
-LaTeX, and ConTeXt macro packages to convert and typeset the markdown documents
-in a single step, they will still benefit from learning the options that
-control the behavior of the Lua parser.
-
-
-### Interfaces
-
-The Lua part of the package exposes two interfaces – the `markdown` Lua module,
-and the Lua command-line interface (CLI).
-
-#### The Lua module
-
-The `markdown` Lua module exposes the `new(options)` method, which creates a
-converter function from markdown to TeX. The properties of the converter
-function are specified by the Lua table `options`. The parameter is optional;
-when unspecified, the behaviour will be the same as if `options` were an empty
-table.
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\input example
-\bye
-```````
-Using a text editor, create a text document named `example.lua` with the
-following content:
-``` lua
-#!/usr/bin/env texlua
-local kpse = require("kpse")
-kpse.set_program_name("luatex")
-local markdown = require("markdown")
-local convert_safe = markdown.new()
-local convert_unsafe = markdown.new({hybrid = true})
-local input = [[$\sqrt{-1}$ *equals* $i$.]]
-print(convert_safe(input) .. " " .. convert_unsafe(input))
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-texlua example.lua > example.tex
-luatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the text
-“\$\\sqrt{-1}\$ *equals* \$i\$. √-̅1̅ *equals* $i$.” Invoking pdfTeX should have
-the same effect:
-``` sh
-texlua example.lua > example.tex
-pdftex document.tex
-``````
-
-***
-
-Rather than use the `texlua` interpreter, we can also access the `markdown` Lua
-module directly from our document. Using a text editor, create a text document
-named `document.tex` with the following content:
-``` tex
-\input markdown
-\input lmfonts
-\directlua{
- local markdown = require("markdown")
- local convert_safe = markdown.new()
- local convert_unsafe = markdown.new({hybrid = true})
- local input = [[$\noexpand\sqrt{-1}$ *equals* $i$.]]
- tex.sprint(convert_safe(input) .. " " .. convert_unsafe(input)) }
-\bye
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-```````
-A PDF document named `document.pdf` should be produced and contain the text
-“\$\\sqrt {-1}\$ *equals* \$i\$. √-̅1̅ *equals* $i$.” In this case, we cannot
-use pdfTeX, because pdfTeX does not define the `\directlua` TeX command.
-
-#### The Lua CLI
-
-The Lua command-line interface (CLI) accepts the same options as the `markdown`
-Lua module, but now the options are specified as command-line parameters.
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\input safe\ \input unsafe
-\bye
-```````
-Using a text editor, create a text document named `example.md` with the
-following content:
-``` md
-$\sqrt{-1}$ *equals* $i$.
-``````
-Next, invoke LuaTeX from the terminal:
-``` sh
-texlua <CLI␣PATHNAME> -- example.md safe.tex
-texlua <CLI␣PATHNAME> hybrid=true -- example.md unsafe.tex
-luatex document.tex
-``````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
-such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
-systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
-script file using [Kpathsea][].
-
-A PDF document named `document.pdf` should be produced and contain the text
-“\$\\sqrt{-1}\$ *equals* \$i\$. √-̅1̅ *equals* $i$.” Invoking pdfTeX should have
-the same effect:
-``` sh
-texlua <CLI␣PATHNAME> -- example.md safe.tex
-texlua <CLI␣PATHNAME> hybrid=true -- example.md unsafe.tex
-pdftex document.tex
-``````
-
-
-### Options
-
-This section will cover the options recognized by the Lua interface. The
-interfaces of the plain TeX, LaTeX, and ConTeXt macro packages recognize these
-options as well, in addition to their own options.
-
-
-#### File and Directory Names
-
-
-##### Option `cacheDir`
-
-`cacheDir` (default value: `"."`)
-
-: A path to the directory containing auxiliary cache files. If the last
- segment of the path does not exist, it will be created by the Lua
- command-line and plain TeX implementations. The Lua implementation expects
- that the entire path already exists.
-
- When iteratively writing and typesetting a markdown document, the cache
- files are going to accumulate over time. You are advised to clean the
- cache directory every now and then, or to set it to a temporary filesystem
- (such as `/tmp` on UN*X systems), which gets periodically emptied.
-
-
-###### Lua module example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\directlua{
- local markdown = require("markdown")
- local convert = markdown.new({cacheDir = "cache"})
- local input = "Hello *world*!"
- tex.sprint(convert(input)) }
-\bye
-```````
-Create an empty directory named `cache` next to our text document. Then, invoke
-LuaTeX from the terminal:
-``` sh
-luatex document.tex
-```````
-A PDF document named `document.pdf` should be produced and contain the text
-“Hello *world*!” Several cache files of the Markdown package will also be
-produced in the `cache` directory as we requested using the `cacheDir` option.
-
-###### Lua CLI example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input hello
-\bye
-```````
-Using a text editor, create a text document named `hello.md` with the
-following content:
-``` md
-Hello *world*!
-``````
-Next, invoke LuaTeX from the terminal:
-``` sh
-texlua <CLI␣PATHNAME> cacheDir=cache -- hello.md hello.tex
-luatex document.tex
-```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
-such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
-systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
-script file using [Kpathsea][].
-
-A PDF document named `document.pdf` should be produced and contain the text
-“Hello *world*!” A directory named `cache` containing several cache files of
-the Markdown package will also be produced as we requested using the `cacheDir`
-option.
-
-###### Plain TeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\def\markdownOptionCacheDir{cache}
-\markdownBegin
-Hello *world*!
-\markdownEnd
-\bye
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the text “Hello
-*world*!” A directory named `cache` containing several cache files of the
-Markdown package will also be produced as we requested using the `cacheDir`
-option.
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage[cacheDir=cache]{markdown}
-\begin{document}
-\begin{markdown}
-Hello *world*!
-\end{markdown}
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the text “Hello
-*world*!” A directory named `cache` containing several cache files of the
-Markdown package will also be produced as we requested using the `cacheDir`
-option.
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\def\markdownOptionCacheDir{cache}
-\starttext
-\startmarkdown
-Hello *world*!
-\stopmarkdown
-\stoptext
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the text “Hello
-*world*!” A directory named `cache` containing several cache files of the
-Markdown package will also be produced as we requested using the `cacheDir`
-option.
-
-
-#### Parser Options
-
-
-##### Option `blankBeforeBlockquote`
-
-`blankBeforeBlockquote` (default value: `false`)
-
-: true
-
- : Require a blank line between a paragraph and the following blockquote.
-
- false
-
- : Do not require a blank line between a paragraph and the following
- blockquote.
-
-
-###### Lua module example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\directlua{
- local markdown = require("markdown")
- local newline = [[^^J^^J]]
- local convert, input
-
- convert = markdown.new()
- input = "A paragraph." .. newline ..
- "> A quote." .. newline
- tex.sprint(convert(input))
-
- convert = markdown.new({blankBeforeBlockquote = true})
- input = "A paragraph." .. newline ..
- "> Not a quote." .. newline
- tex.sprint(convert(input)) }
-\bye
-```````
-Then, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-```````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> > A quote.
->
-> A paragraph > Not a quote.
-
-###### Lua CLI example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\input optionfalse
-\input optiontrue
-\bye
-```````
-Using a text editor, create a text document named `content.md` with the
-following content:
-``` md
-A paragraph.
-> A quote?
-``````
-Next, invoke LuaTeX from the terminal:
-``` sh
-texlua <CLI␣PATHNAME> -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> blankBeforeBlockquote=true -- content.md optiontrue.tex
-luatex document.tex
-```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
-such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
-systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
-script file using [Kpathsea][].
-
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> > A quote?
->
-> A paragraph. > A quote?
-
-###### Plain TeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-
-\markdownBegin
-A paragraph.
-> A quote.
-\markdownEnd
-
-\def\markdownOptionBlankBeforeBlockquote{true}
-\markdownBegin
-A paragraph.
-> Not a quote.
-\markdownEnd
-
-\bye
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> > A quote.
->
-> A paragraph > Not a quote.
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage{markdown}
-\begin{document}
-
-\begin{markdown}
-A paragraph.
-> A quote.
-\end{markdown}
-
-\begin{markdown*}{blankBeforeBlockquote}
-A paragraph.
-> Not a quote.
-\end{markdown*}
-
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> > A quote.
->
-> A paragraph > Not a quote.
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\starttext
-
-\startmarkdown
-A paragraph.
-> A quote.
-\stopmarkdown
-
-\def\markdownOptionBlankBeforeBlockquote{true}
-\startmarkdown
-A paragraph.
-> Not a quote.
-\stopmarkdown
-
-\stoptext
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> > A quote.
->
-> A paragraph > Not a quote.
-
-
-##### Option `blankBeforeCodeFence`
-
-`blankBeforeCodeFence` (default value: `false`)
-
-: true
-
- : Require a blank line between a paragraph and the following fenced code
- block.
-
- false
-
- : Do not require a blank line between a paragraph and the following
- fenced code block.
-
-
-###### Lua module example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\directlua{
- local markdown = require("markdown")
- local newline = [[^^J^^J]]
- local convert, input
-
- convert = markdown.new({fencedCode = true})
- input = "A paragraph." .. newline ..
- "```" .. newline ..
- "A code fence." .. newline ..
- "```" .. newline
- tex.sprint(convert(input))
-
- convert = markdown.new({
- fencedCode = true, blankBeforeCodeFence = true})
- input = "A paragraph." .. newline ..
- "```" .. newline ..
- "Not a code fence." .. newline ..
- "```" .. newline
- tex.sprint(convert(input)) }
-\bye
-```````
-Then, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-```````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> ```
-> A code fence.
-> ```
->
-> A paragraph. ``` Not a code fence. ```
-
-###### Lua CLI example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\input optionfalse
-\input optiontrue
-\bye
-```````
-Using a text editor, create a text document named `content.md` with the
-following content:
-```` md
-A paragraph.
-```
-A code fence?
-```
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-texlua <CLI␣PATHNAME> fencedCode=true -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> fencedCode=true blankBeforeCodeFence=true -- content.md optiontrue.tex
-luatex document.tex
-```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
-such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
-systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
-script file using [Kpathsea][].
-
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> ```
-> A code fence?
-> ```
->
-> A paragraph. ``` A code fence? ```
-
-###### Plain TeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-```` tex
-\input markdown
-\def\markdownOptionFencedCode{true}
-
-\markdownBegin
-A paragraph.
-```
-A code fence.
-```
-\markdownEnd
-
-\def\markdownOptionBlankBeforeCodeFence{true}
-\markdownBegin
-A paragraph.
-```
-Not a code fence.
-```
-\markdownEnd
-
-\bye
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> ```
-> A code fence.
-> ```
->
-> A paragraph. ``` Not a code fence. ```
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-```` tex
-\documentclass{article}
-\usepackage[fencedCode]{markdown}
-\begin{document}
-
-\begin{markdown}
-A paragraph.
-```
-A code fence.
-```
-\end{markdown}
-
-\begin{markdown*}{blankBeforeCodeFence}
-A paragraph.
-```
-Not a code fence.
-```
-\end{markdown*}
-
-\end{document}
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> ```
-> A code fence.
-> ```
->
-> A paragraph. ``` Not a code fence. ```
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-```` tex
-\usemodule[t][markdown]
-\def\markdownOptionFencedCode{true}
-\starttext
-
-\startmarkdown
-A paragraph.
-```
-A code fence.
-```
-\stopmarkdown
-
-\def\markdownOptionBlankBeforeCodeFence{true}
-\startmarkdown
-A paragraph.
-```
-Not a code fence.
-```
-\stopmarkdown
-
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> ```
-> A code fence.
-> ```
->
-> A paragraph. ``` Not a code fence. ```
-
-
-##### Option `blankBeforeHeading`
-
-`blankBeforeHeading` (default value: `false`)
-
-: true
-
- : Require a blank line between a paragraph and the following header.
-
- false
-
- : Do not require a blank line between a paragraph and the following
- header.
-
-
-###### Lua module example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\def\markdownRendererHeadingOne#1{{\bf #1}\par}
-\directlua{
- local markdown = require("markdown")
- local newline = [[^^J^^J]]
- local convert, input
-
- convert = markdown.new()
- input = "A paragraph." .. newline ..
- "A heading." .. newline ..
- "==========" .. newline
- tex.sprint(convert(input))
-
- convert = markdown.new({blankBeforeHeading = true})
- input = "A paragraph." .. newline ..
- "Not a heading." .. newline ..
- "==============" .. newline
- tex.sprint(convert(input)) }
-\bye
-```````
-Then, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-```````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> A heading.
-> ==========
->
-> A paragraph. Not a heading. ==============
-
-###### Lua CLI example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\input optionfalse
-\input optiontrue
-\bye
-```````
-Using a text editor, create a text document named `content.md` with the
-following content:
-``` md
-A paragraph.
-A heading?
-==========
-``````
-Next, invoke LuaTeX from the terminal:
-``` sh
-texlua <CLI␣PATHNAME> -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> blankBeforeHeading=true -- content.md optiontrue.tex
-luatex document.tex
-```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
-such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
-systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
-script file using [Kpathsea][].
-
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> A heading?
-> ==========
->
-> A paragraph. A heading? ==========
-
-###### Plain TeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-
-\markdownBegin
-A paragraph.
-A heading.
-==========
-\markdownEnd
-
-\def\markdownOptionBlankBeforeHeading{true}
-\markdownBegin
-A paragraph.
-Not a heading.
-==============
-\markdownEnd
-
-\bye
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> A heading.
-> ==========
->
-> A paragraph. Not a heading. ==============
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage{markdown}
-\begin{document}
-
-\begin{markdown}
-A paragraph.
-A heading.
-==========
-\end{markdown}
-
-\begin{markdown*}{blankBeforeHeading}
-A paragraph.
-Not a heading.
-==============
-\end{markdown*}
-
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> A heading.
-> ==========
->
-> A paragraph. Not a heading. ==============
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\starttext
-
-\startmarkdown
-A paragraph.
-A heading.
-==========
-\stopmarkdown
-
-\def\markdownOptionBlankBeforeHeading{true}
-\startmarkdown
-A paragraph.
-Not a heading.
-==============
-\stopmarkdown
-
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> A paragraph.
->
-> A heading.
-> ==========
->
-> A paragraph. Not a heading. ==============
-
-
-##### Option `breakableBlockquotes`
-
-`breakableBlockquotes` (default value: `false`)
-
-: true
-
- : A blank line separates block quotes.
-
- false
-
- : Blank lines in the middle of a block quote are ignored.
-
-
-###### Lua module example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\def\markdownRendererHeadingOne#1{{\bf #1}\par}
-\directlua{
- local markdown = require("markdown")
- local newline = [[^^J^^J]]
- local convert, input
-
- convert = markdown.new()
- input = "> A single" .. newline .. newline ..
- "> block quote." .. newline
- tex.sprint(convert(input))
-
- convert = markdown.new({breakableBlockquotes = true})
- input = "> A block quote." .. newline .. newline ..
- "> Another block quote." .. newline
- tex.sprint(convert(input)) }
-\bye
-```````
-Then, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-```````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> > A single block quote.
->
-> > A block quote.
->
-> > Another block quote.
-
-###### Lua CLI example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\input optionfalse
-\input optiontrue
-\bye
-```````
-Using a text editor, create a text document named `content.md` with the
-following content:
-``` md
-> A single block quote
-
-> or two block quotes?
-``````
-Next, invoke LuaTeX from the terminal:
-``` sh
-texlua <CLI␣PATHNAME> -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> breakableBlockquotes=true -- content.md optiontrue.tex
-luatex document.tex
-```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
-such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
-systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
-script file using [Kpathsea][].
-
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> > A single block quote or two block quotes?
->
-> > A single block quote
->
-> > or two block quotes?
-
-###### Plain TeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-
-\markdownBegin
-> A single
-
-> block quote.
-\markdownEnd
-
-\def\markdownOptionBreakableBlockquotes{true}
-\markdownBegin
-> A block quote.
-
-> Another block quote.
-\markdownEnd
-
-\bye
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> > A single block quote.
->
-> > A block quote.
->
-> > Another block quote.
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage{markdown}
-\begin{document}
-
-\begin{markdown}
-> A single
-
-> block quote.
-\end{markdown}
-
-\begin{markdown*}{breakableBlockquotes}
-> A block quote.
-
-> Another block quote.
-\end{markdown*}
-
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> > A single block quote.
->
-> > A block quote.
->
-> > Another block quote.
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\starttext
-
-\startmarkdown
-> A single
-
-> block quote.
-\stopmarkdown
-
-\def\markdownOptionBreakableBlockquotes{true}
-\startmarkdown
-> A block quote.
-
-> Another block quote.
-\stopmarkdown
-
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> > A single block quote.
->
-> > A block quote.
->
-> > Another block quote.
-
-
-##### Option `citationNbsps`
-
-`citationNbsps` (default value: `true`)
-
-: true
-
- : Replace regular spaces with non-breakable spaces inside the prenotes
- and postnotes of citations produced via the pandoc citation syntax
- extension.
-
- false
-
- : Do not replace regular spaces with non-breakable spaces inside the
- prenotes and postnotes of citations produced via the pandoc citation
- syntax extension.
-
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.bib` with the
-following content:
-``` bib
-@book{knuth:tex,
- author = "Knuth, Donald Ervin",
- title = "The \TeX book, volume A of Computers and typesetting",
- publisher = "Addison-Wesley",
- year = "1984" }
-```````
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage[citations]{markdown}
-\begin{document}
-
-\begin{markdown}
-The TeXbook [@knuth:tex, p. 123 and 130] is good.
-\end{markdown}
-
-\begin{markdown*}{citationNbsps = false}
-The TeXbook [@knuth:tex, p. 123 and 130] is good.
-\end{markdown*}
-
-\bibliographystyle{plain}
-\bibliography{document.bib}
-\end{document}
-```````
-Next, invoke LuaTeX and BibTeX from the terminal:
-``` sh
-lualatex document.tex
-bibtex document.aux
-lualatex document.tex
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text, where the middot (`·`) denotes a non-breakable space:
-
-> The TeXbook [1, p.·123·and·130] is good.
->
-> The TeXbook [1, p. 123 and 130] is good.
->
-> ### References
-> [1] Donald·Ervin Knuth. _The TeXbook, volume A of Computers and typesetting._
-> Addison-Wesley, 1984.
-
-
-##### Option `citations`
-
-`citations` (default value: `false`)
-
-: true
-
- : Enable the pandoc citation syntax extension:
-
- ``` md
- Here is a simple parenthetical citation [@doe99] and here
- is a string of several [see @doe99, pp. 33-35; also
- @smith04, chap. 1].
-
- A parenthetical citation can have a [prenote @doe99] and
- a [@smith04 postnote]. The name of the author can be
- suppressed by inserting a dash before the name of an
- author as follows [-@smith04].
-
- Here is a simple text citation @doe99 and here is
- a string of several @doe99 [pp. 33-35; also @smith04,
- chap. 1]. Here is one with the name of the author
- suppressed -@doe99.
- ``````
-
-: false
-
- : Disable the pandoc citation syntax extension.
-
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.bib` with the
-following content:
-``` bib
-@book{knuth:tex,
- author = "Knuth, Donald Ervin",
- title = "The \TeX book, volume A of Computers and typesetting",
- publisher = "Addison-Wesley",
- year = "1984" }
-```````
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage[backend=biber]{biblatex}
-\addbibresource{document.bib}
-\usepackage[citations]{markdown}
-\begin{document}
-
-\begin{markdown}
-The TeXbook [@knuth:tex, p. 123 and 130] was written by @knuth:tex.
-\end{markdown}
-
-\printbibliography
-\end{document}
-```````
-Next, invoke LuaTeX and Biber from the terminal:
-``` sh
-lualatex document.tex
-biber document.bcf
-lualatex document.tex
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> The TeXbook [1, p.·123 and 130] was written by Knuth [1].
->
-> ### References
-> [1] Donald Ervin Knuth. _The TeXbook, volume A of Computers and typesetting._
-> Addison-Wesley, 1984.
-
-
-##### Option `codeSpans`
-
-`codeSpans` (default value: `true`)
-
-: true
-
- : Enable the code span syntax:
-
- ~~~ md
- Use the `printf()` function.
- ``There is a literal backtick (`) here.``
- ~~~
-
-: false
-
- : Disable the code span syntax. This allows you to easily
- use the quotation mark ligatures in texts that do not contain code
- spans:
-
- ~~~
- ``This is a quote.''
- ~~~~~~
-
-
-###### Lua module example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\directlua{
- local markdown = require("markdown")
- local convert = markdown.new()
- local input =
- "``This is a code span.'' " ..
- "``This is no longer a code span.''"
- tex.sprint(convert(input)) }
-\par
-\directlua{
- local markdown = require("markdown")
- local convert = markdown.new({codeSpans = false})
- local input =
- "``This is a quote.'' " ..
- "``This is another quote.''"
- tex.sprint(convert(input)) }
-\bye
-```````
-Then, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-```````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> ``This is a code span.'' ``This is no longer a code span.''
->
-> “This is a quote.” “This is another quote.”
-
-###### Lua CLI example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\input optionfalse
-\par
-\input optiontrue
-\bye
-```````
-Using a text editor, create a text document named `content.md` with the
-following content:
-``` md
-``Is this a code span?'' ``Or a quote?''
-``````
-Next, invoke LuaTeX from the terminal:
-``` sh
-texlua <CLI␣PATHNAME> codeSpans=false -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> -- content.md optiontrue.tex
-luatex document.tex
-```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
-such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
-systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
-script file using [Kpathsea][].
-
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> “Is this a code span?” “Or a quote?”
->
-> ``Is this a code span?'' ``Or a quote?''
-
-###### Plain TeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-
-\markdownBegin
-``This is a code span.''
-``This is no longer a code span.''
-\markdownEnd
-
-\def\markdownOptionCodeSpans{false}
-\markdownBegin
-``This is a quote.''
-``This is another quote.''
-\markdownEnd
-
-\bye
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> ``This is a code span.'' ``This is no longer a code span.''
->
-> “This is a quote.” “This is another quote.”
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage{markdown}
-\begin{document}
-
-\begin{markdown}
-``This is a code span.''
-``This is no longer a code span.''
-\end{markdown}
-
-\begin{markdown*}{codeSpans=false}
-``This is a quote.''
-``This is another quote.''
-\end{markdown*}
-
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> ``This is a code span.'' ``This is no longer a code span.''
->
-> “This is a quote.” “This is another quote.”
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\starttext
-
-\startmarkdown
-``This is a code span.''
-``This is no longer a code span.''
-\stopmarkdown
-
-\def\markdownOptionCodeSpans{false}
-\startmarkdown
-``This is a quote.''
-``This is another quote.''
-\stopmarkdown
-
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> ``This is a code span.'' ``This is no longer a code span.''
->
-> “This is a quote.” “This is another quote.”
-
-
-##### Option `contentBlocks`
-
-`contentBlocks` (default value: `false`)
-
-: true
-
- : Enable the
- iA Writer content blocks syntax extension:
-
- ``` md
- http://example.com/minard.jpg (Napoleon's
- disastrous Russian campaign of 1812)
- /Flowchart.png "Engineering Flowchart"
- /Savings Account.csv 'Recent Transactions'
- /Example.swift
- /Lorem Ipsum.txt
- ``````
-
-: false
-
- : Disable the
- iA Writer content blocks syntax extension.
-
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `table.csv` with the
-following content:
-``` csv
-Name,Surname,Born
-Albert,Einstein,1879
-Marie,Curie,1867
-Thomas,Edison,1847
-```````
-Create also a text document named `markdown-languages.json` with the following
-content:
-``` js
-{
- "tex": "LaTeX"
-}
-``````
-Create also a text document named `code.tex` with the following content:
-``` tex
-This is an example code listing in \LaTeX.
-```````
-Create also a text document named `part.md` with the following content:
-``` md
-This is a *transcluded markdown document*.
-``````
-Create also a text document named `document.tex` with the following content:
-``` tex
-\documentclass{article}
-\usepackage{minted}
-\usepackage[contentBlocks]{markdown}
-\begin{document}
-\begin{markdown}
-/table.csv (An example table)
-/code.tex (An example code listing)
-/part.md (A file transclusion example)
-\end{markdown}
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex --shell-escape document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> | Name | Surname | Born |
-> | ------ | ---------| ---- |
-> | Albert | Einstein | 1879 |
-> | Marie | Curie | 1867 |
-> | Thomas | Edison | 1847 |
->
-> Table 1: An example table
->
-> ``` tex
-> This is an example code listing in \LaTeX.
-> ```````
->
-> This is a *transcluded markdown document*.
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `table.csv` with the
-following content:
-``` csv
-Name,Surname,Born
-Albert,Einstein,1879
-Marie,Curie,1867
-Thomas,Edison,1847
-```````
-Create also a text document named `markdown-languages.json` with the following
-content:
-``` js
-{
- "tex": "ConTeXt"
-}
-``````
-Create also a text document named `code.tex` with the following content:
-``` tex
-This is an example code listing in \ConTeXt.
-```````
-Create also a text document named `part.md` with the following content:
-``` md
-This is a *transcluded markdown document*.
-``````
-Create also a text document named `document.tex` with the following content:
-``` tex
-\usemodule[t][markdown]
-\def\markdownOptionContentBlocks{true}
-\definetyping [ConTeXt]
-\setuptyping [ConTeXt] [option=TEX]
-\starttext
-\startmarkdown
-/table.csv (An example table)
-/code.tex (An example code listing)
-/part.md (A file transclusion example)
-\stopmarkdown
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> | Name | Surname | Born |
-> | ------ | ---------| ---- |
-> | Albert | Einstein | 1879 |
-> | Marie | Curie | 1867 |
-> | Thomas | Edison | 1847 |
->
-> Table 1: An example table
->
-> ``` tex
-> This is an example code listing in \ConTeXt.
-> ```````
->
-> This is a *transcluded markdown document*.
-
-
-##### Option `contentBlocksLanguageMap`
-
-`contentBlocksLanguageMap` (default value: `"markdown-languages.json"`)
-
-: The filename of the JSON file that maps filename extensions to
- programming language names in the iA Writer content blocks.
-
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `table.csv` with the
-following content:
-``` csv
-Name,Surname,Born
-Albert,Einstein,1879
-Marie,Curie,1867
-Thomas,Edison,1847
-```````
-Create also a text document named `language-map.json` with the following
-content:
-``` js
-{
- "tex": "LaTeX"
-}
-``````
-Create also a text document named `code.tex` with the following content:
-``` tex
-This is an example code listing in \LaTeX.
-```````
-Create also a text document named `part.md` with the following content:
-``` md
-This is a *transcluded markdown document*.
-``````
-Create also a text document named `document.tex` with the following content:
-``` tex
-\documentclass{article}
-\usepackage{minted}
-\usepackage[contentBlocks]{markdown}
-\markdownSetup{
- contentBlocksLanguageMap = {language-map.json},
-}
-\begin{document}
-\begin{markdown}
-/table.csv (An example table)
-/code.tex (An example code listing)
-/part.md (A file transclusion example)
-\end{markdown}
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex --shell-escape document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> | Name | Surname | Born |
-> | ------ | ---------| ---- |
-> | Albert | Einstein | 1879 |
-> | Marie | Curie | 1867 |
-> | Thomas | Edison | 1847 |
->
-> Table 1: An example table
->
-> ``` tex
-> This is an example code listing in \LaTeX.
-> ```````
->
-> This is a *transcluded markdown document*.
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `table.csv` with the
-following content:
-``` csv
-Name,Surname,Born
-Albert,Einstein,1879
-Marie,Curie,1867
-Thomas,Edison,1847
-```````
-Create also a text document named `language-map.json` with the following
-content:
-``` js
-{
- "tex": "ConTeXt"
-}
-``````
-Create also a text document named `code.tex` with the following content:
-``` tex
-This is an example code listing in \ConTeXt.
-```````
-Create also a text document named `part.md` with the following content:
-``` md
-This is a *transcluded markdown document*.
-``````
-Create also a text document named `document.tex` with the following content:
-``` tex
-\usemodule[t][markdown]
-\def\markdownOptionContentBlocks{true}
-\def\markdownOptionContentBlocksLanguageMap{language-map.json}
-\definetyping [ConTeXt]
-\setuptyping [ConTeXt] [option=TEX]
-\starttext
-\startmarkdown
-/table.csv (An example table)
-/code.tex (An example code listing)
-/part.md (A file transclusion example)
-\stopmarkdown
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> | Name | Surname | Born |
-> | ------ | ---------| ---- |
-> | Albert | Einstein | 1879 |
-> | Marie | Curie | 1867 |
-> | Thomas | Edison | 1847 |
->
-> Table 1: An example table
->
-> ``` tex
-> This is an example code listing in \ConTeXt.
-> ```````
->
-> This is a *transcluded markdown document*.
-
-
-##### Option `definitionLists`
-
-`definitionLists` (default value: `false`)
-
-: true
-
- : Enable the pandoc definition list syntax extension:
-
- ``` md
- Term 1
-
- : Definition 1
-
- Term 2 with *inline markup*
-
- : Definition 2
-
- { some code, part of Definition 2 }
-
- Third paragraph of definition 2.
- `````
-
-: false
-
- : Disable the pandoc definition list syntax extension.
-
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage[definitionLists]{markdown}
-\begin{document}
-\begin{markdown}
-Term 1
-
-: Definition 1
-
-Term 2 with *inline markup*
-
-: Definition 2
-
- { some code, part of Definition 2 }
-
- Third paragraph of definition 2.
-\end{markdown}
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> Term 1
->
-> : Definition 1
->
-> Term 2 with *inline markup*
->
-> : Definition 2
->
-> { some code, part of Definition 2 }
->
-> Third paragraph of definition 2.
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\def\markdownOptionDefinitionLists{true}
-\starttext
-\startmarkdown
-Term 1
-
-: Definition 1
-
-Term 2 with *inline markup*
-
-: Definition 2
-
- { some code, part of Definition 2 }
-
- Third paragraph of definition 2.
-\stopmarkdown
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> Term 1
->
-> : Definition 1
->
-> Term 2 with *inline markup*
->
-> : Definition 2
->
-> { some code, part of Definition 2 }
->
-> Third paragraph of definition 2.
-
-
-##### Option `fencedCode`
-
-`fencedCode` (default value: `false`)
-
-: true
-
- : Enable the commonmark fenced code block extension:
-
- ~~~~~~~~ md
- ~~~ js
- if (a > 3) {
- moveShip(5 * gravity, DOWN);
- }
- ~~~~~~
-
- ``` html
- <pre>
- <code>
- // Some comments
- line 1 of code
- line 2 of code
- line 3 of code
- </code>
- </pre>
- ```
- ~~~~~~~~~~~
-
-: false
-
- : Disable the commonmark fenced code block extension.
-
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage{minted}
-\usepackage[fencedCode]{markdown}
-\begin{document}
-\begin{markdown}
-~~~ js
-if (a > 3) {
- moveShip(5 * gravity, DOWN);
-}
-~~~~~~
-
- ``` html
- <pre>
- <code>
- // Some comments
- line 1 of code
- line 2 of code
- line 3 of code
- </code>
- </pre>
- ```
-\end{markdown}
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex --shell-escape document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> ~~~ js
-> if (a > 3) {
-> moveShip(5 * gravity, DOWN);
-> }
-> ~~~~~~
->
-> ``` html
-> <pre>
-> <code>
-> // Some comments
-> line 1 of code
-> line 2 of code
-> line 3 of code
-> </code>
-> </pre>
-> ```
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\def\markdownOptionFencedCode{true}
-\definetyping [js]
-\definetyping [html]
-\setuptyping [html] [option=XML]
-\starttext
-\startmarkdown
-~~~ js
-if (a > 3) {
- moveShip(5 * gravity, DOWN);
-}
-~~~~~~
-
- ``` html
- <pre>
- <code>
- // Some comments
- line 1 of code
- line 2 of code
- line 3 of code
- </code>
- </pre>
- ```
-\stopmarkdown
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> ~~~ js
-> if (a > 3) {
-> moveShip(5 * gravity, DOWN);
-> }
-> ~~~~~~
->
-> ``` html
-> <pre>
-> <code>
-> // Some comments
-> line 1 of code
-> line 2 of code
-> line 3 of code
-> </code>
-> </pre>
-> ```
-
-
-##### Option `footnotes`
-
-`footnotes` (default value: `false`)
-
-: true
-
- : Enable the pandoc footnote syntax extension:
-
- ``` md
- Here is a footnote reference,[^1] and another.[^longnote]
-
- [^1]: Here is the footnote.
-
- [^longnote]: Here's one with multiple blocks.
-
- Subsequent paragraphs are indented to show that they
- belong to the previous footnote.
-
- { some.code }
-
- The whole paragraph can be indented, or just the
- first line. In this way, multi-paragraph footnotes
- work like multi-paragraph list items.
-
- This paragraph won't be part of the note, because it
- isn't indented.
- ``````
-
-: false
-
- : Disable the pandoc footnote syntax extension.
-
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage[footnotes]{markdown}
-\begin{document}
-\begin{markdown}
-Here is a footnote reference,[^1] and another.[^longnote]
-
-[^1]: Here is the footnote.
-
-[^longnote]: Here's one with multiple blocks.
-
- Subsequent paragraphs are indented to show that they
-belong to the previous footnote.
-
- { some.code }
-
- The whole paragraph can be indented, or just the
- first line. In this way, multi-paragraph footnotes
- work like multi-paragraph list items.
-
-This paragraph won't be part of the note, because it
-isn't indented.
-\end{markdown}
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> Here is a footnote reference,[^1] and another.[^longnote]
->
-> [^1]: Here is the footnote.
->
-> [^longnote]: Here's one with multiple blocks.
->
-> Subsequent paragraphs are indented to show that they
-> belong to the previous footnote.
->
-> { some.code }
->
-> The whole paragraph can be indented, or just the
-> first line. In this way, multi-paragraph footnotes
-> work like multi-paragraph list items.
->
-> This paragraph won't be part of the note, because it
-> isn't indented.
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\def\markdownOptionFootnotes{true}
-\starttext
-\startmarkdown
-Here is a footnote reference,[^1] and another.[^longnote]
-
-[^1]: Here is the footnote.
-
-[^longnote]: Here's one with multiple blocks.
-
- Subsequent paragraphs are indented to show that they
-belong to the previous footnote.
-
- { some.code }
-
- The whole paragraph can be indented, or just the
- first line. In this way, multi-paragraph footnotes
- work like multi-paragraph list items.
-
-This paragraph won't be part of the note, because it
-isn't indented.
-\stopmarkdown
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> Here is a footnote reference,[^1] and another.[^longnote]
->
-> [^1]: Here is the footnote.
->
-> [^longnote]: Here's one with multiple blocks.
->
-> Subsequent paragraphs are indented to show that they
-> belong to the previous footnote.
->
-> { some.code }
->
-> The whole paragraph can be indented, or just the
-> first line. In this way, multi-paragraph footnotes
-> work like multi-paragraph list items.
->
-> This paragraph won't be part of the note, because it
-> isn't indented.
-
-
-##### Option `hashEnumerators`
-
-`hashEnumerators` (default value: `false`)
-
-: true
-
- : Enable the use of hash symbols (`#`) as ordered item list
- markers:
-
- ``` md
- #. Bird
- #. McHale
- #. Parish
- ``````
-
-: false
-
- : Disable the use of hash symbols (`#`) as ordered item list
- markers.
-
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage{markdown}
-\begin{document}
-
-\begin{markdown}
-#. Bird
-#. McHale
-#. Parish
-\end{markdown}
-
-\begin{markdown*}{hashEnumerators}
-#. Bird
-#. McHale
-#. Parish
-\end{markdown*}
-
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> . Bird
-> ========
-> . McHale
-> ========
-> . Parish
-> ========
->
-> #. Bird
-> #. McHale
-> #. Parish
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\starttext
-
-\startmarkdown
-#. Bird
-#. McHale
-#. Parish
-\stopmarkdown
-
-\def\markdownOptionHashEnumerators{true}
-\startmarkdown
-#. Bird
-#. McHale
-#. Parish
-\stopmarkdown
-
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> . Bird
-> ========
-> . McHale
-> ========
-> . Parish
-> ========
->
-> #. Bird
-> #. McHale
-> #. Parish
-
-
-##### Option `html`
-
-`html` (default value: `false`)
-
-: true
-
- : Enable the recognition of HTML tags, block elements, comments, HTML
- instructions, and entities in the input. Tags, block elements (along
- with contents), HTML instructions, and comments will be ignored and
- HTML entities will be replaced with the corresponding Unicode
- codepoints.
-
-: false
-
- : Disable the recognition of HTML markup. Any HTML markup in the input
- will be rendered as plain text.
-
-
-When the option is enabled, HTML entities are currently incorrectly parsed.
-See [the corresponding issue][issue-38] in the package repository.
-
- [issue-36]: https://github.com/Witiko/markdown/issues/36
- (HTML entities with the `html` Lua option enabled produce a Lua
- parser error)
-
-###### Lua module example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\directlua{
- local markdown = require("markdown")
- local convert = markdown.new()
- local newline = [[^^J^^J]]
- local input =
- "<div>*There is no block tag support.*</div>" .. newline ..
- "*There is no <inline tag="tag"></inline> support.*" .. newline ..
- "_There is no <!-- comment --> support._" .. newline ..
- "_There is no <? HTML instruction ?> support._"
- tex.sprint(convert(input)) }
-\par
-\directlua{
- local markdown = require("markdown")
- local convert = markdown.new({html = true})
- local input =
- "<div>*There is block tag support.*</div>" .. newline ..
- "*There is <inline tag="tag"></inline> support.*" .. newline ..
- "_There is <!-- comment --> support._" .. newline ..
- "_There is <? HTML instruction ?> support._"
- tex.sprint(convert(input)) }
-\bye
-```````
-Then, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-```````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> \<div>There is no block tag support.\</div>
-> There is no \<inline tag=”tag”>\</inline> support.
-> There is no \<!-- comment --> support.
-> There is no <? HTML instruction ?> support.
->
-> There is support. There is support. There is support.
-
-###### Lua CLI example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\input optionfalse
-\par
-\input optiontrue
-\bye
-```````
-Using a text editor, create a text document named `content.md` with the
-following content:
-``` html
-<div>
-*Is there block tag support?*
-</div>
-*Is there <inline tag="tag"></inline> support?*
-_Is there <!-- comment --> support?_
-_Is there <? HTML instruction ?> support?_
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-texlua <CLI␣PATHNAME> -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> html=true -- content.md optiontrue.tex
-luatex document.tex
-```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
-such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
-systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
-script file using [Kpathsea][].
-
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> \<div>Is there block tag support?\</div>
-> Is there \<inline tag=”tag”>\</inline> support?
-> Is there \<!-- comment --> support?
-> Is there <? HTML instruction ?> support?
->
-> Is there support? Is there support? Is there support?
-
-###### Plain TeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-
-\markdownBegin
-<div>
-*There is no block tag support.*
-</div>
-*There is no <inline tag="tag"></inline> support.*
-_There is no <!-- comment --> support._
-_There is no <? HTML instruction ?> support._
-\markdownEnd
-
-\def\markdownOptionHtml{true}
-\markdownBegin
-<div>
-*There is block tag support.*
-</div>
-*There is <inline tag="tag"></inline> support.*
-_There is <!-- comment --> support._
-_There is <? HTML instruction ?> support._
-\markdownEnd
-
-\bye
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> \<div>There is no block tag support.\</div>
-> There is no \<inline tag=”tag”>\</inline> support.
-> There is no \<!-- comment --> support.
-> There is no <? HTML instruction ?> support.
->
-> There is support. There is support. There is support.
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage{markdown}
-\begin{document}
-
-\begin{markdown}
-<div>
-*There is no block tag support.*
-</div>
-*There is no <inline tag="tag"></inline> support.*
-_There is no <!-- comment --> support._
-_There is no <? HTML instruction ?> support._
-\end{markdown}
-
-\begin{markdown*}{html}
-<div>
-*There is block tag support.*
-</div>
-*There is <inline tag="tag"></inline> support.*
-_There is <!-- comment --> support._
-_There is <? HTML instruction ?> support._
-\end{markdown*}
-
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> \<div>There is no block tag support.\</div>
-> There is no \<inline tag=”tag”>\</inline> support.
-> There is no \<!-- comment --> support.
-> There is no <? HTML instruction ?> support.
->
-> There is support. There is support. There is support.
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\starttext
-
-\startmarkdown
-<div>
-*There is no block tag support.*
-</div>
-*There is no <inline tag="tag"></inline> support.*
-_There is no <!-- comment --> support._
-_There is no <? HTML instruction ?> support._
-\stopmarkdown
-
-\def\markdownOptionHtml{true}
-\startmarkdown
-<div>
-*There is block tag support.*
-</div>
-*There is <inline tag="tag"></inline> support.*
-_There is <!-- comment --> support._
-_There is <? HTML instruction ?> support._
-\stopmarkdown
-
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> \<div>There is no block tag support.\</div>
-> There is no \<inline tag=”tag”>\</inline> support.
-> There is no \<!-- comment --> support.
-> There is no <? HTML instruction ?> support.
->
-> There is support. There is support. There is support.
-
-
-##### Option `hybrid`
-
-`hybrid` (default value: `true`)
-
-: true
-
- : Disable the escaping of special plain TeX characters, which makes it
- possible to intersperse your markdown markup with TeX code. The
- intended usage is in documents prepared manually by a human author.
- In such documents, it can often be desirable to mix TeX and markdown
- markup freely.
-
-: false
-
- : Enable the escaping of special plain TeX characters outside verbatim
- environments, so that they are not interpretted by TeX. This is
- encouraged when typesetting automatically generated content or
- markdown documents that were not prepared with this package in mind.
-
-
-###### Lua module example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\directlua{
- local markdown = require("markdown")
- local convert_safe = markdown.new()
- local convert_unsafe = markdown.new({hybrid = true})
- local input = [[$\noexpand\sqrt{-1}$ *equals* $i$.]]
- tex.sprint(convert_safe(input) .. " " .. convert_unsafe(input)) }
-\bye
-```````
-Then, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-```````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> \$\\sqrt {-1}\$ *equals* \$i\$.
-> √-̅1̅ *equals* $i$.
-
-###### Lua CLI example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\input optionfalse
-\input optiontrue
-\bye
-```````
-Using a text editor, create a text document named `content.md` with the
-following content:
-``` md
-$\sqrt{-1}$ *equals* $i$.
-``````
-Next, invoke LuaTeX from the terminal:
-``` sh
-texlua <CLI␣PATHNAME> -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> hybrid=true -- content.md optiontrue.tex
-luatex document.tex
-```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
-such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
-systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
-script file using [Kpathsea][].
-
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> \$\\sqrt {-1}\$ *equals* \$i\$.
-> √-̅1̅ *equals* $i$.
-
-###### Plain TeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\input lmfonts
-\markdownBegin
-$\sqrt{-1}$ *equals* $i$.
-\markdownEnd
-\def\markdownOptionHybrid{true}
-\markdownBegin
-$\sqrt{-1}$ *equals* $i$.
-\markdownEnd
-\bye
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> \$\\sqrt {-1}\$ *equals* \$i\$.
-> √-̅1̅ *equals* $i$.
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage{markdown}
-\begin{document}
-\begin{markdown}
-$\sqrt{-1}$ *equals* $i$.
-\end{markdown}
-\begin{markdown*}{hybrid}
-$\sqrt{-1}$ *equals* $i$.
-\end{markdown*}
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> \$\\sqrt {-1}\$ *equals* \$i\$.
-> √-̅1̅ *equals* $i$.
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\starttext
-\startmarkdown
-$\sqrt{-1}$ *equals* $i$.
-\stopmarkdown
-\def\markdownOptionHybrid{true}
-\startmarkdown
-$\sqrt{-1}$ *equals* $i$.
-\stopmarkdown
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> \$\\sqrt {-1}\$ *equals* \$i\$.
-> √-̅1̅ *equals* $i$.
-
-
-##### Option `inlineFootnotes`
-
-`inlineFootnotes` (default value: `false`)
-
-: true
-
- : Enable the pandoc inline footnote syntax extension:
-
- ``` md
- Here is an inline note.^[Inlines notes are easier to
- write, since you don't have to pick an identifier and
- move down to type the note.]
- ``````
-
-: false
-
- : Disable the pandoc inline footnote syntax extension.
-
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage[footnotes, inlineFootnotes]{markdown}
-\begin{document}
-\begin{markdown}
-Here is an inline note.^[Inlines notes are easier to
-write, since you don't have to pick an identifier and
-move down to type the note.]
-\end{markdown}
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> Here is an inline note.^[Inlines notes are easier to
-> write, since you don't have to pick an identifier and
-> move down to type the note.]
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\def\markdownOptionFootnotes{true}
-\def\markdownOptionInlineFootnotes{true}
-\starttext
-\startmarkdown
-Here is an inline note.^[Inlines notes are easier to
-write, since you don't have to pick an identifier and
-move down to type the note.]
-\stopmarkdown
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> Here is an inline note.^[Inlines notes are easier to
-> write, since you don't have to pick an identifier and
-> move down to type the note.]
-
-
-##### Option `preserveTabs`
-
-`preserveTabs` (default value: `false`)
-
-: true
-
- : Preserve all tabs in the input.
-
-: false
-
- : Convert any tabs in the input to spaces.
-
-
-This option is currently non-functional. See [the corresponding
-issue][issue-38] in the package repository.
-
- [issue-38]: https://github.com/Witiko/markdown/issues/38
- (Tabs are stripped even with the `preserveTabs=true`
- Lua option enabled)
-
-
-##### Option `smartEllipses`
-
-`smartEllipses` (default value: `false`)
-
-: true
-
- : Convert any ellipses in the input to the
- `\markdownRendererEllipsis` TeX macro.
-
-: false
-
- : Preserve all ellipses in the input.
-
-
-###### Lua module example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\def\markdownRendererEllipsis{. . .}
-\input lmfonts
-\directlua{
- local markdown = require("markdown")
- local convert = markdown.new()
- input = "These are just three regular dots ..."
- tex.sprint(convert(input)) }
-\par
-\directlua{
- local markdown = require("markdown")
- local convert = markdown.new({smartEllipses = true})
- input = "... and this is a victorian ellipsis."
- tex.sprint(convert(input)) }
-\bye
-```````
-Then, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-```````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> These are just three regular dots ...
->
-> . . . and this is a victorian ellipsis.
-
-###### Lua CLI example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\def\markdownRendererEllipsis{. . .}
-\input lmfonts
-\input optionfalse
-\par
-\input optiontrue
-\bye
-```````
-Using a text editor, create a text document named `content.md` with the
-following content:
-``` md
-Are these just three regular dots, a victorian ellipsis, or ... ?
-``````
-Next, invoke LuaTeX from the terminal:
-``` sh
-texlua <CLI␣PATHNAME> -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> smartEllipses=true -- content.md optiontrue.tex
-luatex document.tex
-```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
-such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
-systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
-script file using [Kpathsea][].
-
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> Are these just three regular dots, a victorian ellipsis, or ... ?
->
-> Are these just three regular dots, a victorian ellipsis, or . . . ?
-
-###### Plain TeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\def\markdownRendererEllipsis{. . .}
-
-\markdownBegin
-These are just three regular dots ...
-\markdownEnd
-
-\def\markdownOptionSmartEllipses{true}
-\markdownBegin
-... and this is a victorian ellipsis.
-\markdownEnd
-
-\bye
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> These are just three regular dots ...
->
-> . . . and this is a victorian ellipsis.
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage{markdown}
-\markdownSetup{
- renderers = {
- ellipsis = {. . .} }}
-\begin{document}
-
-\begin{markdown}
-These are just three regular dots ...
-\end{markdown}
-
-\begin{markdown*}{smartEllipses}
-... and this is a victorian ellipsis.
-\end{markdown*}
-
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> These are just three regular dots ...
->
-> . . . and this is a victorian ellipsis.
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\def\markdownRendererEllipsis{. . .}
-\starttext
-
-\startmarkdown
-These are just three regular dots ...
-\stopmarkdown
-
-\def\markdownOptionSmartEllipses{true}
-\startmarkdown
-... and this is a victorian ellipsis.
-\stopmarkdown
-
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> These are just three regular dots ...
->
-> . . . and this is a victorian ellipsis.
-
-
-##### Option `startNumber`
-
-`startNumber` (default value: `true`)
-
-: true
-
- : Make the number in the first item of an ordered lists significant. The
- item numbers will be passed to the
- `\markdownRendererOlItemWithNumber` TeX macro.
-
-: false
-
- : Ignore the numbers in the ordered list items. Each item will only
- produce a
- `\markdownRendererOlItem` TeX macro.
-
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage{markdown}
-\begin{document}
-
-\begin{markdown}
-The following list respects the numbers specified in the markup:
-
-3. third item
-4. fourth item
-5. fifth item
-\end{markdown}
-
-\begin{markdown*}{startNumber=false}
-The following list does not respect the numbers specified in the
-markup:
-
-3. third item
-4. fourth item
-5. fifth item
-\end{markdown*}
-
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> The following list respects the numbers specified in the markup:
->
-> 3. third item
-> 4. fourth item
-> 5. fifth item
->
-> The following list does not respect the numbers specified in the markup:
->
-> 1. third item
-> 2. fourth item
-> 3. fifth item
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\starttext
-
-\startmarkdown
-The following list respects the numbers specified in the markup:
-
-3. third item
-4. fourth item
-5. fifth item
-\stopmarkdown
-
-\def\markdownOptionStartNumber{false}
-\startmarkdown
-The following list respects the numbers specified in the markup:
-
-3. third item
-4. fourth item
-5. fifth item
-\stopmarkdown
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> The following list respects the numbers specified in the markup:
->
-> 3. third item
-> 4. fourth item
-> 5. fifth item
->
-> The following list does not respect the numbers specified in the markup:
->
-> 1. third item
-> 2. fourth item
-> 3. fifth item
-
-
-##### Option `tightLists`
-
-`tightLists` (default value: `true`)
-
-: true
-
- : Lists whose bullets do not consist of multiple paragraphs will be
- passed to the
- `\markdownRendererOlBeginTight`, `\markdownRendererOlEndTight`,
- `\markdownRendererUlBeginTight`, `\markdownRendererUlEndTight`,
- `\markdownRendererDlBeginTight`, and
- `\markdownRendererDlEndTight` TeX macros.
-
-: false
-
- : Lists whose bullets do not consist of multiple paragraphs will be
- treated the same way as lists that do consist of multiple paragraphs.
-
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage{markdown}
-\begin{document}
-
-\begin{markdown}
-The following list is tight:
-
- - first item
- - second item
- - third item
-
-The following list is loose:
-
- - first item
- - second item that spans
-
- multiple paragraphs
- - third item
-\end{markdown}
-
-\begin{markdown*}{tightLists=false}
-The following list is now also loose:
-
- - first item
- - second item
- - third item
-\end{markdown*}
-
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> The following list is tight:
->
-> - first item
-> - second item
-> - third item
->
-> The following list is loose:
->
-> - first item
-> - second item that spans
->
-> multiple paragraphs
-> - third item
->
-> The following list is now also loose:
->
-> - first item
->
-> - second item
->
-> - third item
-
-
-##### Option `underscores`
-
-`underscores` (default value: `true`)
-
-: true
-
- : Both underscores and asterisks can be used to denote emphasis and
- strong emphasis:
-
- ``` md
- *single asterisks*
- _single underscores_
- **double asterisks**
- __double underscores__
- ``````
-
-: false
-
- : Only asterisks can be used to denote emphasis and strong emphasis.
- This makes it easy to write math with the \Opt{hybrid} option
- without the need to constantly escape subscripts.
-
-
-###### Plain TeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\input markdown
-\def\markdownOptionHybrid{true}
-
-\markdownBegin
-This is _emphasized text_ and this is a math subscript: $m\_n$.
-\markdownEnd
-
-\def\markdownOptionUnderscores{false}
-\markdownBegin
-This is *emphasized text* and this is a math subscript: $m_n$.
-\markdownEnd
-
-\bye
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-luatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> This is _emphasized text_ and this is a math subscript: *mₙ*.
->
-> This is _emphasized text_ and this is a math subscript: *mₙ*.
-
-###### LaTeX example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\documentclass{article}
-\usepackage[hybrid]{markdown}
-\begin{document}
-
-\begin{markdown}
-This is _emphasized text_ and this is a math subscript: $m\_n$.
-\end{markdown}
-
-\begin{markdown*}{underscores=false}
-This is *emphasized text* and this is a math subscript: $m_n$.
-\end{markdown*}
-
-\end{document}
-```````
-Next, invoke LuaTeX from the terminal:
-``` sh
-lualatex document.tex
-``````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> This is _emphasized text_ and this is a math subscript: *mₙ*.
->
-> This is _emphasized text_ and this is a math subscript: *mₙ*.
-
-###### ConTeXt example {.unnumbered}
-
-Using a text editor, create a text document named `document.tex` with the
-following content:
-``` tex
-\usemodule[t][markdown]
-\def\markdownOptionHybrid{true}
-\starttext
-
-\startmarkdown
-This is _emphasized text_ and this is a math subscript: $m\_n$.
-\stopmarkdown
-
-\def\markdownOptionUnderscores{false}
-\startmarkdown
-This is *emphasized text* and this is a math subscript: $m_n$.
-\stopmarkdown
-
-\stoptext
-````````
-Next, invoke LuaTeX from the terminal:
-``` sh
-context document.tex
-`````
-A PDF document named `document.pdf` should be produced and contain the
-following text:
-
-> This is _emphasized text_ and this is a math subscript: *mₙ*.
->
-> This is _emphasized text_ and this is a math subscript: *mₙ*.
-
-
-Plain TeX
----------
-
-The plain TeX macro package provides TeX commands for typesetting markdown
-documents that invoke the Lua parser in the background. Beside TeX commands
-that correspond to the Lua options, the macro package also provides commands
-corresponding to additional plain TeX-specific options, and so-called *token
-renderer* commands that define how the individual markdown elements will be
-typeset.
-
-### Interfaces
-
-<!-- TODO -->
-
-
-### Options
-
-<!-- TODO -->
-
-
-### Token renderers
-
-<!-- TODO -->
-
-
-LaTeX
------
-
-The LaTeX macro package provides additional syntactic sugar on top of the plain
-TeX macro package and provides sane default definitions of the token renderers.
-
-<!-- TODO -->
-
-### Interfaces
-
-<!-- TODO -->
-
-
-### Options
-
-<!-- TODO -->
-
-
-### Token renderers
-
-<!-- TODO -->
-
-
-ConTeXt
--------
-
-The ConTeXt macro package provides additional syntactic sugar on top of the
-plain TeX macro package and provides sane default definitions of the token
-renderers.
-
-### Interfaces
-
-<!-- TODO -->
-
-### Options
-
-<!-- TODO -->
+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].
-### Token renderers
+ [techdoc]: http://mirrors.ctan.org/macros/generic/markdown/markdown.pdf
+ (A Markdown Interpreter for \TeX{})
-<!-- TODO -->
+/markdown-interfaces.md
+/markdown-options.md
+/markdown-tokens.md
diff --git a/Master/texmf-dist/doc/generic/markdown/markdown.pdf b/Master/texmf-dist/doc/generic/markdown/markdown.pdf
index 567f99aed14..b445d4cc577 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/scripts/markdown/markdown-cli.lua b/Master/texmf-dist/scripts/markdown/markdown-cli.lua
index d5a65a518f4..0bc1754a39e 100644
--- a/Master/texmf-dist/scripts/markdown/markdown-cli.lua
+++ b/Master/texmf-dist/scripts/markdown/markdown-cli.lua
@@ -20,7 +20,7 @@
-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--
--- Copyright (C) 2018 Vít Novotný
+-- Copyright (C) 2016-2019 Vít Novotný
--
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -58,11 +58,11 @@
-- those in the standard .ins files.
--
local metadata = {
- version = "2.5.6",
+ version = "2.7.0",
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-2018 Vít Novotný"},
+ "2016-2019 Vít Novotný"},
license = "LPPL 1.3"
}
@@ -81,10 +81,12 @@ defaultOptions.definitionLists = false
defaultOptions.fencedCode = false
defaultOptions.footnotes = false
defaultOptions.hashEnumerators = false
+defaultOptions.headerAttributes = false
defaultOptions.html = false
defaultOptions.hybrid = false
defaultOptions.inlineFootnotes = false
defaultOptions.preserveTabs = false
+defaultOptions.slice = "^ $"
defaultOptions.smartEllipses = false
defaultOptions.startNumber = true
defaultOptions.tightLists = true
diff --git a/Master/texmf-dist/source/generic/markdown/docstrip.cfg b/Master/texmf-dist/source/generic/markdown/docstrip.cfg
index 11f5397ec77..a03b51c87b3 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) 2018 Vít Novotný^^J%
+-- Copyright (C) 2016-2019 Vít Novotný^^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) 2018 Vít Novotný
+Copyright (C) 2016-2019 Vít Novotný
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
diff --git a/Master/texmf-dist/source/generic/markdown/markdown.dtx b/Master/texmf-dist/source/generic/markdown/markdown.dtx
index 0222985095c..3897b1f0b6f 100644
--- a/Master/texmf-dist/source/generic/markdown/markdown.dtx
+++ b/Master/texmf-dist/source/generic/markdown/markdown.dtx
@@ -53,14 +53,25 @@
citations,
definitionLists,
fencedCode,
+ headerAttributes,
hybrid,
html,
stripPercentSigns,
- underscores=false]{markdown}
+ underscores=false,
+]{markdown}
\markdownSetup{
renderers = {
codeSpan = {\inline{#1}},
- link = {#1\footnote{See \url{#3}.}}}}
+ link = {#1\footnote{See \url{#3}.}},
+ headingFour = {%
+ \paragraph{#1}\leavevmode
+ \def\markdownRendererInterblockSeparator{%
+ \let\markdownRendererInterblockSeparator\par
+ }%
+ \noindent
+ },
+ },
+}
% Set up the catcodes.
\catcode`\_=12 % We won't be typesetting math and Lua contains lots of `_`.
@@ -476,12 +487,38 @@ table td {
}
}
+.tex sub, .latex sub, .latex sup {
+ text-transform: uppercase;
+}
+
+.tex sub, .latex sub {
+ vertical-align: -0.1ex;
+ margin-left: -0.1667em;
+ margin-right: -0.125em;
+}
+
+.tex, .latex, .tex sub, .latex sub {
+ font-size: 1em;
+}
+
+.latex sup {
+ font-size: 0.85em;
+ vertical-align: -0.35em;
+ margin-left: -0.36em;
+ margin-right: -0.15em;
+}
+
+abbr {
+ font-variant: small-caps;
+}
+
%</manual-css>
%<*manual>
---
title: Markdown Package User Manual
author: Vít Novotný
+date: v\markdownVersion{} (\markdownLastModified{})
---
% \fi
@@ -492,12 +529,12 @@ author: Vít Novotný
Introduction
============
-The [Markdown package][pkg] converts [markdown][] markup to TeX commands. The
-functionality is provided both as a Lua module, and as plain TeX, LaTeX, and
-ConTeXt macro packages that can be used to directly typeset TeX documents
+The [Markdown package][pkg] converts [markdown][] 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
makes it easy to redefine how each and every markdown element is rendered.
-Creative abuse of the markdown syntax is encouraged. <i class="em em-wink"></i>
+Creative abuse of the markdown syntax is encouraged. ;-)
[markdown]: https://daringfireball.net/projects/markdown/basics/
(Daring Fireball: Markdown Basics)
@@ -518,9 +555,9 @@ Creative abuse of the markdown syntax is encouraged. <i class="em em-wink"></i>
% \iffalse
This document is a user manual for the [Markdown package][pkg]. It provides
-beginner tutorials and code examples. For an in-depth description of the
-package requirements, interfaces, and implementation, please refer to the
-[technical documentation][techdoc].
+tutorials and code examples. For an in-depth description of the package
+requirements, interfaces, and implementation, please refer to the [technical
+documentation][techdoc].
[techdoc]: http://mirrors.ctan.org/macros/generic/markdown/markdown.pdf
(A Markdown Interpreter for TeX)
@@ -530,11 +567,11 @@ package requirements, interfaces, and implementation, please refer to the
% \fi
% \begin{macrocode}
local metadata = {
- version = "2.5.6",
+ version = "2.7.0",
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-2018 Vít Novotný"},
+ "2016-2019 Vít Novotný"},
license = "LPPL 1.3"
}
@@ -569,9 +606,9 @@ modules['markdown'] = metadata
%
% The \TeX{} implementation of the package draws inspiration from several
% sources including the source code of \Hologo{LaTeX2e}, the \pkg{minted}
-% package by Geoffrey M. Poore -- which likewise tackles the issue of
+% package by Geoffrey M. Poore, which likewise tackles the issue of
% interfacing with an external interpreter from \TeX{}, the \pkg{filecontents}
-% package by Scott Pakin, and others.
+% package by Scott Pakin and others.
%
% \end{markdown}
% \iffalse
@@ -581,19 +618,19 @@ modules['markdown'] = metadata
Requirements
------------
-The package requires a working TeX distribution. [TeX Live][] ≥ 2013 is known to
-work and so are recent installation of [MikTeX][]. If you are using a minimal
-installation of a TeX distribution, please consult the
+The package requires a working \TeX{} distribution. [\TeX{} Live][tl] ≥ 2013 is
+known to work and so are recent installation of [Mik\TeX{}][mik]. If you are
+using a minimal installation of a \TeX{} distribution, please consult the
[technical documentation][techdoc] for a detailed list of required packages.
- [TeX Live]: https://www.tug.org/texlive/ (TeX Live - TeX Users Group)
- [MikTeX]: https://miktex.org/ (Home - MiKTeXorg)
+ [tl]: https://www.tug.org/texlive/ (TeX Live - TeX Users Group)
+ [mik]: https://miktex.org/ (Home - MiKTeXorg)
Installation
------------
-The package comes pre-installed with [TeX Live][] ≥ 2016 and with recent
-installations of [MikTeX][]. Unless you explicitly wish to use the latest
+The package comes pre-installed with [\TeX{} Live][tl] ≥ 2016 and with recent
+installations of [MikTeX][mik]. Unless you explicitly wish to use the latest
version of the package, you are encouraged to skip this step.
To install the package, first download the package from the repository
@@ -602,7 +639,7 @@ using Git:
git clone https://github.com/witiko/markdown
``````
Next, enter the directory named `markdown` and interpret the file named
-`markdown.ins` file using a Unicode-aware TeX engine, such as XeTeX or
+`markdown.ins` file using a Unicode-aware \TeX{} engine, such as XeTeX or
LuaTeX:
``` sh
cd markdown
@@ -610,16 +647,17 @@ luatex markdown.ins
``````
This should produce the following files:
- * `markdown.lua` – the Lua module,
- * `markdown-cli.lua` – the Lua command-line interface,
- * `markdown.tex` – the plain TeX macro package,
- * `markdown.sty` – the LaTeX package, and
- * `t-markdown.tex` – the ConTeXt module.
+ * `markdown.lua`, the Lua module,
+ * `markdown-cli.lua`, the Lua command-line interface,
+ * `markdown.tex`, the plain \TeX{} macro package,
+ * `markdown.sty`, the \LaTeX{} package, and
+ * `t-markdown.tex`, the \Hologo{ConTeXt} module.
-### Local installation
+### Local Installation
-To perform a local installation, place the above files into your TeX directory
-structure. This is generally where the individual files should be placed:
+To perform a local installation, place the above files into your \TeX{}
+directory structure. This is generally where the individual files should be
+placed:
* `<TEXMF>/tex/luatex/markdown/markdown.lua`
* `<TEXMF>/scripts/markdown/markdown-cli.lua`
@@ -627,16 +665,16 @@ structure. This is generally where the individual files should be placed:
* `<TEXMF>/tex/latex/markdown/markdown.sty`
* `<TEXMF>/tex/context/third/markdown/t-markdown.tex`
-where `<TEXMF>` corresponds to a root of your TeX distribution, such as
+where `<TEXMF>` corresponds to a root of your \TeX{} distribution, such as
`/usr/share/texmf` and `~/texmf` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf` on Windows systems. When in doubt,
-consult the manual of your TeX distribution.
+`C:\Users\`\meta{Your username}`\texmf` on Windows systems. When in doubt,
+consult the manual of your \TeX{} distribution.
-### Portable installation ###
+### Portable Installation
Alternatively, you can also store the above files in the same folder as your
-TeX document and distribute them together. This way your document can be
-portably typeset on legacy TeX distributions.
+\TeX{} document and distribute them together. This way your document can be
+portably typeset on legacy \TeX{} distributions.
%</manual>
%<*lua>
@@ -845,6 +883,17 @@ local md5 = require("md5")
% \begin{macrocode}
\RequirePackage{csvsimple}
% \end{macrocode}
+% \par
+% \begin{markdown}
+%
+% \pkg{gobble}
+%
+%: A package that provides the \m{\@gobblethree} \TeX{} command.
+%
+% \end{markdown}
+% \begin{macrocode}
+\RequirePackage{gobble}
+% \end{macrocode}
% \iffalse
%</latex>
%<*context>
@@ -852,7 +901,7 @@ local md5 = require("md5")
% \par
% \begin{markdown}
%
-%### \Hologo{ConTeXt} prerequisites
+%### \Hologo{ConTeXt} Prerequisites
% The \Hologo{ConTeXt} part of the package requires that either the Mark II or
% the Mark IV format is loaded, all the plain \TeX{} prerequisites (see
% Section \ref{sec:texprerequisites}), and the following \Hologo{ConTeXt}
@@ -881,11 +930,11 @@ local md5 = require("md5")
%</context>
%<*manual>
-First document
+First Document
--------------
In this section, we will take the necessary steps to typeset our first markdown
-document in TeX. This will serve as our first hands-on experience with the
+document in \TeX{}. This will serve as our first hands-on experience with the
package and also as a reassurance that the package has been correctly installed.
### Using Lua
@@ -898,7 +947,7 @@ following content:
\bye
```````
-#### Using the Lua module
+#### Using the Lua Module
Using a text editor, create a text document named `hello.lua` with the
following content:
@@ -922,7 +971,7 @@ texlua hello.lua > hello.tex
pdftex document.tex
``````
-#### Using the Lua CLI
+#### Using the Lua Command-Line Interface
Using a text editor, create a text document named `hello.md` with the
following content:
@@ -931,12 +980,12 @@ Hello *world*!
``````
Next, invoke LuaTeX from the terminal:
``` sh
-texlua <CLI␣PATHNAME> -- hello.md hello.tex
+texlua ⟨CLI pathname⟩ -- hello.md hello.tex
luatex document.tex
``````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
+where \meta{CLI pathname} corresponds to the location of the Lua CLI script file,
such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
+`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows
systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
script file using [Kpathsea][].
@@ -945,11 +994,11 @@ script file using [Kpathsea][].
A PDF document named `document.pdf` should be produced and contain the text “Hello
*world*!” Invoking pdfTeX should have the same effect:
``` sh
-texlua <CLI␣PATHNAME> -- hello.md hello.tex
+texlua ⟨CLI pathname⟩ -- hello.md hello.tex
pdftex document.tex
``````
-### Using plain TeX
+### Using Plain \TeX{}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -970,7 +1019,7 @@ A PDF document named `document.pdf` should be produced and contain the text
pdftex --shell-escape document.tex
```````
-### Using LaTeX
+### Using \LaTeX{}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1010,7 +1059,7 @@ lualatex latex.tex
``````
to see the effect of your changes.
-### Using ConTeXt
+### Using \Hologo{ConTeXt}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1052,7 +1101,16 @@ to see the effect of your changes.
Examples
========
-This section will show how to use the package by example.
+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]: http://mirrors.ctan.org/macros/generic/markdown/markdown.pdf
+ (A Markdown Interpreter for \TeX{})
+
+/markdown-interfaces.md
+/markdown-options.md
+/markdown-tokens.md
%</manual>
%<*lua>
@@ -1066,19 +1124,28 @@ This section will show how to use the package by example.
%
% \iffalse
%</lua>
-%<*manual>
+%<*manual-interfaces>
-Lua
----
+Interfaces
+----------
-The Lua part of the package makes it possible to convert a markdown document
-into TeX commands and typeset it later when convenient. Although the typical
-user will not find this terribly useful and will instead use the plain TeX,
-LaTeX, and ConTeXt macro packages to convert and typeset the markdown documents
-in a single step, they will still benefit from learning the options that
-control the behavior of the Lua parser.
+In this section, I will describe the individual interfaces exposed by the
+Markdown package starting with the low-level Lua interfaces and all the way up
+to the \LaTeX{} and \Hologo{ConTeXt} interfaces intended for the ordinary
+user.
-%</manual>
+### Lua
+
+The Lua programming language is what drives the conversion from markdown to
+\TeX{} in the Markdown package. Based on the [Lunamark][] Lua library by John
+MacFarlane, the Lua implementation is largely independent on \TeX{}, and can be
+used separately from typesetting a document. Lua provides two interfaces: a Lua
+module and a command-line interface (CLI).
+
+ [Lunamark]: https://github.com/jgm/lunamark
+ (Lua library for conversion between markup formats)
+
+%</manual-interfaces>
%<*lua>
% \fi
%
@@ -1117,20 +1184,19 @@ local M = {metadata = metadata}
% \end{markdown}
% \iffalse
%</lua>
-%<*manual>
+%<*manual-interfaces>
-### Interfaces
+#### Lua Module
-The Lua part of the package exposes two interfaces – the `markdown` Lua module,
-and the Lua command-line interface (CLI).
+A Lua module is a software library that can be used from in other programs.
+The `markdown` Lua module makes it possible to convert markdown to \TeX{} from
+within Lua\TeX{} documents and Lua scripts.
-#### The Lua module
-
-The `markdown` Lua module exposes the `new(options)` method, which creates a
-converter function from markdown to TeX. The properties of the converter
-function are specified by the Lua table `options`. The parameter is optional;
-when unspecified, the behaviour will be the same as if `options` were an empty
-table.
+The `markdown` Lua module exposes the `new(`\meta{options}`)` method, which
+creates a converter function from markdown to \TeX{}. The properties of the
+converter function are specified by the Lua table `options`. The parameter is
+optional; when unspecified, the behaviour will be the same as if \meta{options}
+were an empty table.
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1147,19 +1213,31 @@ following content:
local kpse = require("kpse")
kpse.set_program_name("luatex")
local markdown = require("markdown")
-local convert_safe = markdown.new()
-local convert_unsafe = markdown.new({hybrid = true})
-local input = [[$\sqrt{-1}$ *equals* $i$.]]
-print(convert_safe(input) .. " " .. convert_unsafe(input))
+local input, convert_safe, convert_unsafe, paragraph
+
+input = [[$\sqrt{-1}$ *equals* $i$.]]
+convert_safe = markdown.new()
+convert_unsafe = markdown.new({hybrid = true})
+paragraph = [[\par]]
+
+print(
+ convert_safe(input) .. paragraph ..
+ convert_unsafe(input)
+)
```````
Next, invoke LuaTeX from the terminal:
``` sh
texlua example.lua > example.tex
luatex document.tex
``````
-A PDF document named `document.pdf` should be produced and contain the text
-“\$\\sqrt{-1}\$ *equals* \$i\$. √-̅1̅ *equals* $i$.” Invoking pdfTeX should have
-the same effect:
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> \$\\sqrt{-1}\$ *equals* \$i\$.
+>
+> √-̅1̅ *equals* $i$.
+
+Invoking pdfTeX should have the same effect:
``` sh
texlua example.lua > example.tex
pdftex document.tex
@@ -1175,31 +1253,52 @@ named `document.tex` with the following content:
\input lmfonts
\directlua{
local markdown = require("markdown")
- local convert_safe = markdown.new()
- local convert_unsafe = markdown.new({hybrid = true})
- local input = [[$\noexpand\sqrt{-1}$ *equals* $i$.]]
- tex.sprint(convert_safe(input) .. " " .. convert_unsafe(input)) }
+ local input, convert_safe, convert_unsafe, paragraph
+
+ input = [[$\string\sqrt{-1}$ *equals* $i$.]]
+ convert_safe = markdown.new()
+ convert_unsafe = markdown.new({hybrid = true})
+ paragraph = [[\par]]
+
+ tex.sprint(
+ convert_safe(input) .. paragraph ..
+ convert_unsafe(input)
+ )
+}
\bye
```````
Next, invoke LuaTeX from the terminal:
``` sh
luatex document.tex
```````
-A PDF document named `document.pdf` should be produced and contain the text
-“\$\\sqrt {-1}\$ *equals* \$i\$. √-̅1̅ *equals* $i$.” In this case, we cannot
-use pdfTeX, because pdfTeX does not define the `\directlua` TeX command.
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> \$\\sqrt{-1}\$ *equals* \$i\$.
+>
+> √-̅1̅ *equals* $i$.
+
+In this case, we cannot use pdfTeX, because pdfTeX does not define the
+`\directlua` \TeX{} command.
+
+#### Lua Command-Line Interface
-#### The Lua CLI
+The Lua command-line interface (CLI) of the Markdown package makes the
+functionality of the Lua module accessible from the command line. This makes
+it possible to convert documents from markdown to \TeX{} manually without any
+knowledge of the Lua programming language.
-The Lua command-line interface (CLI) accepts the same options as the `markdown`
-Lua module, but now the options are specified as command-line parameters.
+The Lua command-line interface accepts the same options as the `markdown` Lua
+module, but now the options are specified as command-line parameters.
Using a text editor, create a text document named `document.tex` with the
following content:
``` tex
\input markdown
\input lmfonts
-\input safe\ \input unsafe
+\input safe
+
+\input unsafe
\bye
```````
Using a text editor, create a text document named `example.md` with the
@@ -1209,26 +1308,31 @@ $\sqrt{-1}$ *equals* $i$.
``````
Next, invoke LuaTeX from the terminal:
``` sh
-texlua <CLI␣PATHNAME> -- example.md safe.tex
-texlua <CLI␣PATHNAME> hybrid=true -- example.md unsafe.tex
+texlua ⟨CLI pathname⟩ -- example.md safe.tex
+texlua ⟨CLI pathname⟩ hybrid=true -- example.md unsafe.tex
luatex document.tex
``````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
+where \meta{CLI pathname} corresponds to the location of the Lua CLI script file,
such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
+`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows
systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
script file using [Kpathsea][].
-A PDF document named `document.pdf` should be produced and contain the text
-“\$\\sqrt{-1}\$ *equals* \$i\$. √-̅1̅ *equals* $i$.” Invoking pdfTeX should have
-the same effect:
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> \$\\sqrt{-1}\$ *equals* \$i\$.
+>
+> √-̅1̅ *equals* $i$.
+
+Invoking pdfTeX should have the same effect:
``` sh
-texlua <CLI␣PATHNAME> -- example.md safe.tex
-texlua <CLI␣PATHNAME> hybrid=true -- example.md unsafe.tex
+texlua ⟨CLI pathname⟩ -- example.md safe.tex
+texlua ⟨CLI pathname⟩ hybrid=true -- example.md unsafe.tex
pdftex document.tex
``````
-%</manual>
+%</manual-interfaces>
%<*lua>
% \fi
% \begin{markdown}
@@ -1241,15 +1345,14 @@ pdftex document.tex
% \end{markdown}
% \iffalse
%</lua>
-%<*manual>
+%<*manual-options>
-### Options
+## Options
-This section will cover the options recognized by the Lua interface. The
-interfaces of the plain TeX, LaTeX, and ConTeXt macro packages recognize these
-options as well, in addition to their own options.
+In this section, I will describe all the options recognized by the Markdown
+package.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -1279,17 +1382,24 @@ local defaultOptions = {}
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
-% \fi
-% \begin{markdown}
+%<*manual-options>
-#### File and Directory Names
+### Lua
+Lua options control the conversion from markdown to \TeX{}. They are supported
+by all interfaces of the Markdown package starting with the low-level Lua
+interfaces and all the way up to the \LaTeX{} and \Hologo{ConTeXt} interfaces.
+
+% \fi
+% \begin{markdown}
+%
+%### File and Directory Names
+%
% \end{markdown}
% \par
% \iffalse
-##### Option `cacheDir`
+#### Option `cacheDir`
`cacheDir` (default value: `"."`)
@@ -1300,8 +1410,8 @@ local defaultOptions = {}
%
: A path to the directory containing auxiliary cache files. If the last
segment of the path does not exist, it will be created by the Lua
- command-line and plain TeX implementations. The Lua implementation expects
- that the entire path already exists.
+ command-line and plain \TeX{} implementations. The Lua implementation
+ expects that the entire path already exists.
When iteratively writing and typesetting a markdown document, the cache
files are going to accumulate over time. You are advised to clean the
@@ -1311,7 +1421,7 @@ local defaultOptions = {}
% \end{markdown}
% \iffalse
-###### Lua module example {.unnumbered}
+##### Lua Module Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1333,7 +1443,7 @@ A PDF document named `document.pdf` should be produced and contain the text
“Hello *world*!” Several cache files of the Markdown package will also be
produced in the `cache` directory as we requested using the `cacheDir` option.
-###### Lua CLI example {.unnumbered}
+##### Lua CLI Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1349,12 +1459,12 @@ Hello *world*!
``````
Next, invoke LuaTeX from the terminal:
``` sh
-texlua <CLI␣PATHNAME> cacheDir=cache -- hello.md hello.tex
+texlua ⟨CLI pathname⟩ cacheDir=cache -- hello.md hello.tex
luatex document.tex
```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
+where \meta{CLI pathname} corresponds to the location of the Lua CLI script file,
such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
+`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows
systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
script file using [Kpathsea][].
@@ -1363,7 +1473,7 @@ A PDF document named `document.pdf` should be produced and contain the text
the Markdown package will also be produced as we requested using the `cacheDir`
option.
-###### Plain TeX example {.unnumbered}
+##### Plain \TeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1384,7 +1494,7 @@ A PDF document named `document.pdf` should be produced and contain the text “H
Markdown package will also be produced as we requested using the `cacheDir`
option.
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1406,7 +1516,7 @@ A PDF document named `document.pdf` should be produced and contain the text “H
Markdown package will also be produced as we requested using the `cacheDir`
option.
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1428,7 +1538,7 @@ A PDF document named `document.pdf` should be produced and contain the text “H
Markdown package will also be produced as we requested using the `cacheDir`
option.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -1437,17 +1547,17 @@ defaultOptions.cacheDir = "."
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
% \fi
% \begin{markdown}
-
-#### Parser Options
-
+%
+%### Parser Options
+%
% \end{markdown}
% \par
% \iffalse
-##### Option `blankBeforeBlockquote`
+#### Option `blankBeforeBlockquote`
`blankBeforeBlockquote` (default value: `false`)
@@ -1467,7 +1577,7 @@ defaultOptions.cacheDir = "."
% \end{markdown}
% \iffalse
-###### Lua module example {.unnumbered}
+##### Lua Module Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1503,7 +1613,7 @@ following text:
>
> A paragraph > Not a quote.
-###### Lua CLI example {.unnumbered}
+##### Lua CLI Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1522,13 +1632,13 @@ A paragraph.
``````
Next, invoke LuaTeX from the terminal:
``` sh
-texlua <CLI␣PATHNAME> -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> blankBeforeBlockquote=true -- content.md optiontrue.tex
+texlua ⟨CLI pathname⟩ -- content.md optionfalse.tex
+texlua ⟨CLI pathname⟩ blankBeforeBlockquote=true -- content.md optiontrue.tex
luatex document.tex
```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
+where \meta{CLI pathname} corresponds to the location of the Lua CLI script file,
such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
+`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows
systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
script file using [Kpathsea][].
@@ -1541,7 +1651,7 @@ following text:
>
> A paragraph. > A quote?
-###### Plain TeX example {.unnumbered}
+##### Plain \TeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1574,7 +1684,7 @@ following text:
>
> A paragraph > Not a quote.
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1608,7 +1718,7 @@ following text:
>
> A paragraph > Not a quote.
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1642,7 +1752,7 @@ following text:
>
> A paragraph > Not a quote.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -1651,9 +1761,9 @@ defaultOptions.blankBeforeBlockquote = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `blankBeforeCodeFence`
+#### Option `blankBeforeCodeFence`
`blankBeforeCodeFence` (default value: `false`)
@@ -1675,7 +1785,7 @@ defaultOptions.blankBeforeBlockquote = false
% \end{markdown}
% \iffalse
-###### Lua module example {.unnumbered}
+##### Lua Module Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1718,7 +1828,7 @@ following text:
>
> A paragraph. ``` Not a code fence. ```
-###### Lua CLI example {.unnumbered}
+##### Lua CLI Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1739,13 +1849,13 @@ A code fence?
```````
Next, invoke LuaTeX from the terminal:
``` sh
-texlua <CLI␣PATHNAME> fencedCode=true -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> fencedCode=true blankBeforeCodeFence=true -- content.md optiontrue.tex
+texlua ⟨CLI pathname⟩ fencedCode=true -- content.md optionfalse.tex
+texlua ⟨CLI pathname⟩ fencedCode=true blankBeforeCodeFence=true -- content.md optiontrue.tex
luatex document.tex
```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
+where \meta{CLI pathname} corresponds to the location of the Lua CLI script file,
such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
+`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows
systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
script file using [Kpathsea][].
@@ -1760,7 +1870,7 @@ following text:
>
> A paragraph. ``` A code fence? ```
-###### Plain TeX example {.unnumbered}
+##### Plain \TeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1800,7 +1910,7 @@ following text:
>
> A paragraph. ``` Not a code fence. ```
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1840,7 +1950,7 @@ following text:
>
> A paragraph. ``` Not a code fence. ```
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1881,7 +1991,7 @@ following text:
>
> A paragraph. ``` Not a code fence. ```
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -1890,9 +2000,9 @@ defaultOptions.blankBeforeCodeFence = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `blankBeforeHeading`
+#### Option `blankBeforeHeading`
`blankBeforeHeading` (default value: `false`)
@@ -1913,7 +2023,7 @@ defaultOptions.blankBeforeCodeFence = false
% \end{markdown}
% \iffalse
-###### Lua module example {.unnumbered}
+##### Lua Module Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1953,7 +2063,7 @@ following text:
>
> A paragraph. Not a heading. ==============
-###### Lua CLI example {.unnumbered}
+##### Lua CLI Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -1973,13 +2083,13 @@ A heading?
``````
Next, invoke LuaTeX from the terminal:
``` sh
-texlua <CLI␣PATHNAME> -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> blankBeforeHeading=true -- content.md optiontrue.tex
+texlua ⟨CLI pathname⟩ -- content.md optionfalse.tex
+texlua ⟨CLI pathname⟩ blankBeforeHeading=true -- content.md optiontrue.tex
luatex document.tex
```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
+where \meta{CLI pathname} corresponds to the location of the Lua CLI script file,
such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
+`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows
systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
script file using [Kpathsea][].
@@ -1993,7 +2103,7 @@ following text:
>
> A paragraph. A heading? ==========
-###### Plain TeX example {.unnumbered}
+##### Plain \TeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2029,7 +2139,7 @@ following text:
>
> A paragraph. Not a heading. ==============
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2066,7 +2176,7 @@ following text:
>
> A paragraph. Not a heading. ==============
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2103,7 +2213,7 @@ following text:
>
> A paragraph. Not a heading. ==============
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -2112,9 +2222,9 @@ defaultOptions.blankBeforeHeading = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `breakableBlockquotes`
+#### Option `breakableBlockquotes`
`breakableBlockquotes` (default value: `false`)
@@ -2134,7 +2244,7 @@ defaultOptions.blankBeforeHeading = false
% \end{markdown}
% \iffalse
-###### Lua module example {.unnumbered}
+##### Lua Module Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2171,7 +2281,7 @@ following text:
>
> > Another block quote.
-###### Lua CLI example {.unnumbered}
+##### Lua CLI Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2191,13 +2301,13 @@ following content:
``````
Next, invoke LuaTeX from the terminal:
``` sh
-texlua <CLI␣PATHNAME> -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> breakableBlockquotes=true -- content.md optiontrue.tex
+texlua ⟨CLI pathname⟩ -- content.md optionfalse.tex
+texlua ⟨CLI pathname⟩ breakableBlockquotes=true -- content.md optiontrue.tex
luatex document.tex
```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
+where \meta{CLI pathname} corresponds to the location of the Lua CLI script file,
such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
+`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows
systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
script file using [Kpathsea][].
@@ -2210,7 +2320,7 @@ following text:
>
> > or two block quotes?
-###### Plain TeX example {.unnumbered}
+##### Plain \TeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2245,7 +2355,7 @@ following text:
>
> > Another block quote.
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2281,7 +2391,7 @@ following text:
>
> > Another block quote.
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2317,7 +2427,7 @@ following text:
>
> > Another block quote.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -2326,9 +2436,9 @@ defaultOptions.breakableBlockquotes = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `citationNbsps`
+#### Option `citationNbsps`
`citationNbsps` (default value: `true`)
@@ -2352,7 +2462,7 @@ defaultOptions.breakableBlockquotes = false
% \end{markdown}
% \iffalse
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.bib` with the
following content:
@@ -2361,7 +2471,8 @@ following content:
author = "Knuth, Donald Ervin",
title = "The \TeX book, volume A of Computers and typesetting",
publisher = "Addison-Wesley",
- year = "1984" }
+ year = "1984"
+}
```````
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2400,7 +2511,7 @@ following text, where the middot (`·`) denotes a non-breakable space:
> [1] Donald·Ervin Knuth. _The TeXbook, volume A of Computers and typesetting._
> Addison-Wesley, 1984.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -2409,9 +2520,9 @@ defaultOptions.citationNbsps = true
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `citations`
+#### Option `citations`
`citations` (default value: `false`)
@@ -2447,7 +2558,7 @@ defaultOptions.citationNbsps = true
% \end{markdown}
% \iffalse
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.bib` with the
following content:
@@ -2456,7 +2567,8 @@ following content:
author = "Knuth, Donald Ervin",
title = "The \TeX book, volume A of Computers and typesetting",
publisher = "Addison-Wesley",
- year = "1984" }
+ year = "1984"
+}
```````
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2487,10 +2599,10 @@ following text:
> The TeXbook [1, p.·123 and 130] was written by Knuth [1].
>
> ### References
-> [1] Donald Ervin Knuth. _The TeXbook, volume A of Computers and typesetting._
+> [1] Donald Ervin Knuth. _The \TeX{}book, volume A of Computers and typesetting._
> Addison-Wesley, 1984.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -2499,9 +2611,9 @@ defaultOptions.citations = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `codeSpans`
+#### Option `codeSpans`
`codeSpans` (default value: `true`)
@@ -2532,7 +2644,7 @@ defaultOptions.citations = false
% \end{markdown}
% \iffalse
-###### Lua module example {.unnumbered}
+##### Lua Module Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2567,7 +2679,7 @@ following text:
>
> “This is a quote.” “This is another quote.”
-###### Lua CLI example {.unnumbered}
+##### Lua CLI Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2586,13 +2698,13 @@ following content:
``````
Next, invoke LuaTeX from the terminal:
``` sh
-texlua <CLI␣PATHNAME> codeSpans=false -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> -- content.md optiontrue.tex
+texlua ⟨CLI pathname⟩ codeSpans=false -- content.md optionfalse.tex
+texlua ⟨CLI pathname⟩ -- content.md optiontrue.tex
luatex document.tex
```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
+where \meta{CLI pathname} corresponds to the location of the Lua CLI script file,
such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
+`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows
systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
script file using [Kpathsea][].
@@ -2603,7 +2715,7 @@ following text:
>
> ``Is this a code span?'' ``Or a quote?''
-###### Plain TeX example {.unnumbered}
+##### Plain \TeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2634,7 +2746,7 @@ following text:
>
> “This is a quote.” “This is another quote.”
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2666,7 +2778,7 @@ following text:
>
> “This is a quote.” “This is another quote.”
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -2698,7 +2810,7 @@ following text:
>
> “This is a quote.” “This is another quote.”
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -2707,9 +2819,9 @@ defaultOptions.codeSpans = true
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `contentBlocks`
+#### Option `contentBlocks`
`contentBlocks` (default value: `false`)
@@ -2723,7 +2835,7 @@ defaultOptions.codeSpans = true
: Enable the
% iA\,Writer content blocks syntax extension~[@sotkov17]:
% \iffalse
- iA Writer content blocks syntax extension:
+ iA\,Writer content blocks syntax extension:
% \fi
``` md
@@ -2738,15 +2850,12 @@ defaultOptions.codeSpans = true
: false
: Disable the
-% iA\,Writer content blocks syntax extension.
-% \iffalse
- iA Writer content blocks syntax extension.
-% \fi
+ iA\,Writer content blocks syntax extension.
% \end{markdown}
% \iffalse
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `table.csv` with the
following content:
@@ -2805,7 +2914,7 @@ following text:
>
> This is a *transcluded markdown document*.
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `table.csv` with the
following content:
@@ -2865,7 +2974,7 @@ following text:
>
> This is a *transcluded markdown document*.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -2874,9 +2983,9 @@ defaultOptions.contentBlocks = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `contentBlocksLanguageMap`
+#### Option `contentBlocksLanguageMap`
`contentBlocksLanguageMap` (default value: `"markdown-languages.json"`)
@@ -2886,13 +2995,13 @@ defaultOptions.contentBlocks = false
% \Valitem[markdown-languages.json]{contentBlocksLanguageMap}{filename}
%
: The filename of the JSON file that maps filename extensions to
- programming language names in the iA Writer content blocks.
+ programming language names in the iA\,Writer content blocks.
% See Section~\ref{sec:texcontentblockrenderers} for more information.
% \end{markdown}
% \iffalse
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `table.csv` with the
following content:
@@ -2954,7 +3063,7 @@ following text:
>
> This is a *transcluded markdown document*.
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `table.csv` with the
following content:
@@ -3015,7 +3124,7 @@ following text:
>
> This is a *transcluded markdown document*.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3024,9 +3133,9 @@ defaultOptions.contentBlocksLanguageMap = "markdown-languages.json"
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `definitionLists`
+#### Option `definitionLists`
`definitionLists` (default value: `false`)
@@ -3060,7 +3169,7 @@ defaultOptions.contentBlocksLanguageMap = "markdown-languages.json"
% \end{markdown}
% \iffalse
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3102,7 +3211,7 @@ following text:
>
> Third paragraph of definition 2.
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3144,7 +3253,7 @@ following text:
>
> Third paragraph of definition 2.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3153,9 +3262,9 @@ defaultOptions.definitionLists = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `fencedCode`
+#### Option `fencedCode`
`fencedCode` (default value: `false`)
@@ -3194,11 +3303,11 @@ defaultOptions.definitionLists = false
% \end{markdown}
% \iffalse
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
-``` tex
+```` tex
\documentclass{article}
\usepackage{minted}
\usepackage[fencedCode]{markdown}
@@ -3247,11 +3356,11 @@ following text:
> </pre>
> ```
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
-``` tex
+```` tex
\usemodule[t][markdown]
\def\markdownOptionFencedCode{true}
\definetyping [js]
@@ -3302,7 +3411,7 @@ following text:
> </pre>
> ```
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3311,9 +3420,9 @@ defaultOptions.fencedCode = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `footnotes`
+#### Option `footnotes`
`footnotes` (default value: `false`)
@@ -3353,7 +3462,7 @@ defaultOptions.fencedCode = false
% \end{markdown}
% \iffalse
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3407,7 +3516,7 @@ following text:
> This paragraph won't be part of the note, because it
> isn't indented.
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3461,7 +3570,7 @@ following text:
> This paragraph won't be part of the note, because it
> isn't indented.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3470,9 +3579,9 @@ defaultOptions.footnotes = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `hashEnumerators`
+#### Option `hashEnumerators`
`hashEnumerators` (default value: `false`)
@@ -3500,7 +3609,7 @@ defaultOptions.footnotes = false
% \end{markdown}
% \iffalse
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3510,15 +3619,15 @@ following content:
\begin{document}
\begin{markdown}
-#. Bird
-#. McHale
-#. Parish
+. Bird
+. McHale
+. Parish
\end{markdown}
\begin{markdown*}{hashEnumerators}
-#. Bird
-#. McHale
-#. Parish
+. Bird
+. McHale
+. Parish
\end{markdown*}
\end{document}
@@ -3541,7 +3650,7 @@ following text:
> #. McHale
> #. Parish
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3550,16 +3659,16 @@ following content:
\starttext
\startmarkdown
-#. Bird
-#. McHale
-#. Parish
+. Bird
+. McHale
+. Parish
\stopmarkdown
\def\markdownOptionHashEnumerators{true}
\startmarkdown
-#. Bird
-#. McHale
-#. Parish
+. Bird
+. McHale
+. Parish
\stopmarkdown
\stoptext
@@ -3582,7 +3691,7 @@ following text:
> #. McHale
> #. Parish
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3591,9 +3700,54 @@ defaultOptions.hashEnumerators = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
+
+#### Option `headerAttributes` {#header-attributes}
+
+`headerAttributes` (default value: `false`)
+
+% \fi
+% \begin{markdown}
+%
+% \Optitem[false]{headerAttributes}{\opt{true}, \opt{false}}
+%
+: true
+
+ : Enable the assignment of HTML attributes to headings:
+
+ ``` md
+ # My first heading {#foo}
+
+ ## My second heading ## {#bar .baz}
+
+ Yet another heading {key=value}
+ ===================
+ ``````
+
+ These HTML attributes have currently no effect other than enabling
+% content slicing, see the \Opt{slice} option.
+% \iffalse
+ [content slicing](#slice).
+% \fi
+
+: false
-##### Option `html`
+ : Disable the assignment of HTML attributes to headings.
+
+% \end{markdown}
+% \iffalse
+%</manual-options>
+%<*lua,lua-cli>
+% \fi
+% \begin{macrocode}
+defaultOptions.headerAttributes = false
+% \end{macrocode}
+% \par
+% \iffalse
+%</lua,lua-cli>
+%<*manual-options>
+
+#### Option `html`
`html` (default value: `false`)
@@ -3625,7 +3779,7 @@ See [the corresponding issue][issue-38] in the package repository.
(HTML entities with the `html` Lua option enabled produce a Lua
parser error)
-###### Lua module example {.unnumbered}
+##### Lua Module Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3668,7 +3822,7 @@ following text:
>
> There is support. There is support. There is support.
-###### Lua CLI example {.unnumbered}
+##### Lua CLI Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3692,13 +3846,13 @@ _Is there <? HTML instruction ?> support?_
````````
Next, invoke LuaTeX from the terminal:
``` sh
-texlua <CLI␣PATHNAME> -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> html=true -- content.md optiontrue.tex
+texlua ⟨CLI pathname⟩ -- content.md optionfalse.tex
+texlua ⟨CLI pathname⟩ html=true -- content.md optiontrue.tex
luatex document.tex
```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
+where \meta{CLI pathname} corresponds to the location of the Lua CLI script file,
such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
+`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows
systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
script file using [Kpathsea][].
@@ -3712,7 +3866,7 @@ following text:
>
> Is there support? Is there support? Is there support?
-###### Plain TeX example {.unnumbered}
+##### Plain \TeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3755,7 +3909,7 @@ following text:
>
> There is support. There is support. There is support.
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3798,7 +3952,7 @@ following text:
>
> There is support. There is support. There is support.
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3841,7 +3995,7 @@ following text:
>
> There is support. There is support. There is support.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -3850,9 +4004,9 @@ defaultOptions.html = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `hybrid`
+#### Option `hybrid`
`hybrid` (default value: `true`)
@@ -3863,23 +4017,23 @@ defaultOptions.html = false
%
: true
- : Disable the escaping of special plain TeX characters, which makes it
- possible to intersperse your markdown markup with TeX code. The
+ : Disable the escaping of special plain \TeX{} characters, which makes it
+ possible to intersperse your markdown markup with \TeX{} code. The
intended usage is in documents prepared manually by a human author.
- In such documents, it can often be desirable to mix TeX and markdown
+ In such documents, it can often be desirable to mix \TeX{} and markdown
markup freely.
: false
- : Enable the escaping of special plain TeX characters outside verbatim
- environments, so that they are not interpretted by TeX. This is
+ : Enable the escaping of special plain \TeX{} characters outside verbatim
+ environments, so that they are not interpretted by \TeX{}. This is
encouraged when typesetting automatically generated content or
markdown documents that were not prepared with this package in mind.
% \end{markdown}
% \iffalse
-###### Lua module example {.unnumbered}
+##### Lua Module Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3888,10 +4042,18 @@ following content:
\input lmfonts
\directlua{
local markdown = require("markdown")
- local convert_safe = markdown.new()
- local convert_unsafe = markdown.new({hybrid = true})
- local input = [[$\noexpand\sqrt{-1}$ *equals* $i$.]]
- tex.sprint(convert_safe(input) .. " " .. convert_unsafe(input)) }
+ local input, convert_safe, convert_unsafe, paragraph
+
+ input = [[$\string\sqrt{-1}$ *equals* $i$.]]
+ convert_safe = markdown.new()
+ convert_unsafe = markdown.new({hybrid = true})
+ paragraph = [[\par]]
+
+ tex.sprint(
+ convert_safe(input) .. paragraph ..
+ convert_unsafe(input)
+ )
+}
\bye
```````
Then, invoke LuaTeX from the terminal:
@@ -3902,9 +4064,10 @@ A PDF document named `document.pdf` should be produced and contain the
following text:
> \$\\sqrt {-1}\$ *equals* \$i\$.
+>
> √-̅1̅ *equals* $i$.
-###### Lua CLI example {.unnumbered}
+##### Lua CLI Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3912,6 +4075,7 @@ following content:
\input markdown
\input lmfonts
\input optionfalse
+
\input optiontrue
\bye
```````
@@ -3922,13 +4086,13 @@ $\sqrt{-1}$ *equals* $i$.
``````
Next, invoke LuaTeX from the terminal:
``` sh
-texlua <CLI␣PATHNAME> -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> hybrid=true -- content.md optiontrue.tex
+texlua ⟨CLI pathname⟩ -- content.md optionfalse.tex
+texlua ⟨CLI pathname⟩ hybrid=true -- content.md optiontrue.tex
luatex document.tex
```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
+where \meta{CLI pathname} corresponds to the location of the Lua CLI script file,
such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
+`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows
systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
script file using [Kpathsea][].
@@ -3936,22 +4100,26 @@ A PDF document named `document.pdf` should be produced and contain the
following text:
> \$\\sqrt {-1}\$ *equals* \$i\$.
+>
> √-̅1̅ *equals* $i$.
-###### Plain TeX example {.unnumbered}
+##### Plain \TeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
``` tex
\input markdown
\input lmfonts
+
\markdownBegin
$\sqrt{-1}$ *equals* $i$.
\markdownEnd
+
\def\markdownOptionHybrid{true}
\markdownBegin
$\sqrt{-1}$ *equals* $i$.
\markdownEnd
+
\bye
```````
Next, invoke LuaTeX from the terminal:
@@ -3962,9 +4130,10 @@ A PDF document named `document.pdf` should be produced and contain the
following text:
> \$\\sqrt {-1}\$ *equals* \$i\$.
+>
> √-̅1̅ *equals* $i$.
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -3972,12 +4141,15 @@ following content:
\documentclass{article}
\usepackage{markdown}
\begin{document}
+
\begin{markdown}
$\sqrt{-1}$ *equals* $i$.
\end{markdown}
+
\begin{markdown*}{hybrid}
$\sqrt{-1}$ *equals* $i$.
\end{markdown*}
+
\end{document}
```````
Next, invoke LuaTeX from the terminal:
@@ -3988,22 +4160,26 @@ A PDF document named `document.pdf` should be produced and contain the
following text:
> \$\\sqrt {-1}\$ *equals* \$i\$.
+>
> √-̅1̅ *equals* $i$.
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
``` tex
\usemodule[t][markdown]
\starttext
+
\startmarkdown
$\sqrt{-1}$ *equals* $i$.
\stopmarkdown
+
\def\markdownOptionHybrid{true}
\startmarkdown
$\sqrt{-1}$ *equals* $i$.
\stopmarkdown
+
\stoptext
````````
Next, invoke LuaTeX from the terminal:
@@ -4014,9 +4190,10 @@ A PDF document named `document.pdf` should be produced and contain the
following text:
> \$\\sqrt {-1}\$ *equals* \$i\$.
+>
> √-̅1̅ *equals* $i$.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4025,9 +4202,9 @@ defaultOptions.hybrid = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `inlineFootnotes`
+#### Option `inlineFootnotes`
`inlineFootnotes` (default value: `false`)
@@ -4053,7 +4230,7 @@ defaultOptions.hybrid = false
% \end{markdown}
% \iffalse
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4079,7 +4256,7 @@ following text:
> write, since you don't have to pick an identifier and
> move down to type the note.]
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4106,7 +4283,7 @@ following text:
> write, since you don't have to pick an identifier and
> move down to type the note.]
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4115,9 +4292,9 @@ defaultOptions.inlineFootnotes = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `preserveTabs`
+#### Option `preserveTabs`
`preserveTabs` (default value: `false`)
@@ -4144,7 +4321,7 @@ issue][issue-38] in the package repository.
(Tabs are stripped even with the `preserveTabs=true`
Lua option enabled)
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4153,9 +4330,217 @@ defaultOptions.preserveTabs = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
+
+#### Option `slice` {#slice}
-##### Option `smartEllipses`
+`slice` (default value: `^ $`)
+
+% \fi
+% \begin{markdown}
+%
+% \Valitem[\textasciicircum{} \$]{slice}{the beginning and the end of a slice}
+%
+: Two space-separated selectors that specify the slice of a document that
+ will be processed, whereas the remainder of the document will be ignored.
+ The following selectors are recognized:
+
+ - The circumflex (`^`) selects the beginning of a document.
+ - The dollar sign (`$`) selects the end of a document.
+ - `^`\meta{identifier} selects the beginning of a section with the
+% HTML attribute `#`\meta{identifier} (see the
+% \Opt{headerAttributes} option).
+ \iffalse
+ [HTML attribute](#header-attributes) `#`\meta{identifier}.
+% \fi
+ - `$`\meta{identifier} selects the end of a section with the HTML
+ attribute `#`\meta{identifier}.
+ - \meta{identifier} corresponds to `^`\meta{identifier} for the first
+ selector and to `$`\meta{identifier} for the second selector.
+
+ Specifying only a single selector, \meta{identifier}, is equivalent
+ to specifying the two selectors \meta{identifier} \meta{identifier},
+ which is equivalent to `^`\meta{identifier} `$`\meta{identifier}.
+
+% \end{markdown}
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `hamlet.md` with the
+following content:
+
+``` md
+# The Tragedy of Hamlet
+Shakespeare's longest play.
+
+## Act III {#act-3}
+Hamlet kills Polonius.
+
+## Act V {#act-5}
+Hamlet dies.
+
+## Act I {#act-1}
+Hamlet talks to ghost.
+```
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownOptionHeaderAttributes{true}
+
+\font\normal=cmr10\normal
+\font\big=cmr10 at 12pt
+\def\markdownRendererHeadingTwo#1{{\big #1\par}}
+\font\bigger=cmr10 scaled 1440
+\def\markdownRendererHeadingOne#1{{\bigger #1\par}}
+
+\def\markdownOptionSlice{^ ^act-3}
+\markdownInput{hamlet.md}
+
+\def\markdownOptionSlice{act-1}
+\markdownInput{hamlet.md}
+
+\def\markdownOptionSlice{act-3 act-5}
+\markdownInput{hamlet.md}
+
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> # The Tragedy of Hamlet
+> Shakespeare's longest play.
+>
+> ## Act I
+> Hamlet talks to ghost.
+>
+> ## Act III
+> Hamlet kills Polonius.
+>
+> ## Act V
+> Hamlet dies.
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage[headerAttributes]{markdown}
+\usepackage{filecontents}
+\begin{filecontents*}{hamlet.md}
+# The Tragedy of Hamlet
+Shakespeare's longest play.
+
+## Act III {#act-3}
+Hamlet kills Polonius.
+
+## Act V {#act-5}
+Hamlet dies.
+
+## Act I {#act-1}
+Hamlet talks to ghost.
+\end{filecontents*}
+\begin{document}
+\markdownInput[slice=^ ^act-3]{hamlet.md}
+\markdownInput[slice=act-1]{hamlet.md}
+\markdownInput[slice=act-3 act-5]{hamlet.md}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> # The Tragedy of Hamlet
+> Shakespeare's longest play.
+>
+> ## Act I
+> Hamlet talks to ghost.
+>
+> ## Act III
+> Hamlet kills Polonius.
+>
+> ## Act V
+> Hamlet dies.
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `hamlet.md` with the
+following content:
+
+``` md
+# The Tragedy of Hamlet
+Shakespeare's longest play.
+
+## Act III {#act-3}
+Hamlet kills Polonius.
+
+## Act V {#act-5}
+Hamlet dies.
+
+## Act I {#act-1}
+Hamlet talks to ghost.
+```
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownOptionHeaderAttributes{true}
+\starttext
+
+\def\markdownOptionSlice{^ ^act-3}
+\markdownInput{hamlet.md}
+
+\def\markdownOptionSlice{act-1}
+\markdownInput{hamlet.md}
+
+\def\markdownOptionSlice{act-3 act-5}
+\markdownInput{hamlet.md}
+
+\stoptext
+````````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+`````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> # The Tragedy of Hamlet
+> Shakespeare's longest play.
+>
+> ## Act I
+> Hamlet talks to ghost.
+>
+> ## Act III
+> Hamlet kills Polonius.
+>
+> ## Act V
+> Hamlet dies.
+
+%</manual-options>
+%<*lua,lua-cli>
+% \fi
+% \begin{macrocode}
+defaultOptions.slice = "^ $"
+% \end{macrocode}
+% \par
+% \iffalse
+%</lua,lua-cli>
+%<*manual-options>
+
+
+#### Option `smartEllipses`
`smartEllipses` (default value: `false`)
@@ -4167,10 +4552,7 @@ defaultOptions.preserveTabs = false
: true
: Convert any ellipses in the input to the
-% \m{markdownRendererEllipsis} \TeX{} macro.
-% \iffalse
- `\markdownRendererEllipsis` TeX macro.
-% \fi
+ \m{markdownRendererEllipsis} \TeX{} macro.
: false
@@ -4179,7 +4561,7 @@ defaultOptions.preserveTabs = false
% \end{markdown}
% \iffalse
-###### Lua module example {.unnumbered}
+##### Lua Module Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4190,13 +4572,13 @@ following content:
\directlua{
local markdown = require("markdown")
local convert = markdown.new()
- input = "These are just three regular dots ..."
+ local input = "These are just three regular dots ..."
tex.sprint(convert(input)) }
\par
\directlua{
local markdown = require("markdown")
local convert = markdown.new({smartEllipses = true})
- input = "... and this is a victorian ellipsis."
+ local input = "... and this is a victorian ellipsis."
tex.sprint(convert(input)) }
\bye
```````
@@ -4211,7 +4593,7 @@ following text:
>
> . . . and this is a victorian ellipsis.
-###### Lua CLI example {.unnumbered}
+##### Lua CLI Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4231,13 +4613,13 @@ Are these just three regular dots, a victorian ellipsis, or ... ?
``````
Next, invoke LuaTeX from the terminal:
``` sh
-texlua <CLI␣PATHNAME> -- content.md optionfalse.tex
-texlua <CLI␣PATHNAME> smartEllipses=true -- content.md optiontrue.tex
+texlua ⟨CLI pathname⟩ -- content.md optionfalse.tex
+texlua ⟨CLI pathname⟩ smartEllipses=true -- content.md optiontrue.tex
luatex document.tex
```````
-where `<CLI␣PATHNAME>` corresponds to the location of the Lua CLI script file,
+where \meta{CLI pathname} corresponds to the location of the Lua CLI script file,
such as `~/texmf/scripts/markdown/markdown-cli.lua` on UN\*X systems or
-`C:\Users\<YOUR␣USERNAME>\texmf\scripts\markdown\markdown-cli.lua` on Windows
+`C:\Users\`\meta{Your username}`\texmf\scripts\markdown\markdown-cli.lua` on Windows
systems. Use the command `kpsewhich markdown-cli.lua` to locate the Lua CLI
script file using [Kpathsea][].
@@ -4248,7 +4630,7 @@ following text:
>
> Are these just three regular dots, a victorian ellipsis, or . . . ?
-###### Plain TeX example {.unnumbered}
+##### Plain \TeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4278,7 +4660,7 @@ following text:
>
> . . . and this is a victorian ellipsis.
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4311,7 +4693,7 @@ following text:
>
> . . . and this is a victorian ellipsis.
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4342,7 +4724,7 @@ following text:
>
> . . . and this is a victorian ellipsis.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4351,9 +4733,9 @@ defaultOptions.smartEllipses = false
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `startNumber`
+#### Option `startNumber`
`startNumber` (default value: `true`)
@@ -4366,24 +4748,17 @@ defaultOptions.smartEllipses = false
: Make the number in the first item of an ordered lists significant. The
item numbers will be passed to the
-% \m{markdownRendererOlItemWithNumber} \TeX{} macro.
-% \iffalse
- `\markdownRendererOlItemWithNumber` TeX macro.
-% \fi
+ \m{markdownRendererOlItemWithNumber} \TeX{} macro.
: false
: Ignore the numbers in the ordered list items. Each item will only
- produce a
-% \m{markdownRendererOlItem} \TeX{} macro.
-% \iffalse
- `\markdownRendererOlItem` TeX macro.
-% \fi
+ produce a \m{markdownRendererOlItem} \TeX{} macro.
% \end{markdown}
% \iffalse
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4430,7 +4805,7 @@ following text:
> 2. fourth item
> 3. fifth item
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4475,7 +4850,7 @@ following text:
> 2. fourth item
> 3. fifth item
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4484,9 +4859,9 @@ defaultOptions.startNumber = true
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `tightLists`
+#### Option `tightLists`
`tightLists` (default value: `true`)
@@ -4499,16 +4874,10 @@ defaultOptions.startNumber = true
: Lists whose bullets do not consist of multiple paragraphs will be
passed to the
-% \m{markdownRendererOlBeginTight}, \m{markdownRendererOlEndTight},
-% \m{markdownRendererUlBeginTight}, \m{markdownRendererUlEndTight},
-% \m{markdownRendererDlBeginTight}, and
-% \m{markdownRendererDlEndTight} \TeX{} macros.
-% \iffalse
- `\markdownRendererOlBeginTight`, `\markdownRendererOlEndTight`,
- `\markdownRendererUlBeginTight`, `\markdownRendererUlEndTight`,
- `\markdownRendererDlBeginTight`, and
- `\markdownRendererDlEndTight` TeX macros.
-% \fi
+ \m{markdownRendererOlBeginTight}, \m{markdownRendererOlEndTight},
+ \m{markdownRendererUlBeginTight}, \m{markdownRendererUlEndTight},
+ \m{markdownRendererDlBeginTight}, and
+ \m{markdownRendererDlEndTight} \TeX{} macros.
: false
@@ -4518,7 +4887,7 @@ defaultOptions.startNumber = true
% \end{markdown}
% \iffalse
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4582,7 +4951,7 @@ following text:
>
> - third item
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4591,9 +4960,9 @@ defaultOptions.tightLists = true
% \par
% \iffalse
%</lua,lua-cli>
-%<*manual>
+%<*manual-options>
-##### Option `underscores`
+#### Option `underscores`
`underscores` (default value: `true`)
@@ -4623,7 +4992,7 @@ defaultOptions.tightLists = true
% \end{markdown}
% \iffalse
-###### Plain TeX example {.unnumbered}
+##### Plain \TeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4653,7 +5022,7 @@ following text:
>
> This is _emphasized text_ and this is a math subscript: *mₙ*.
-###### LaTeX example {.unnumbered}
+##### \LaTeX{} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4683,7 +5052,7 @@ following text:
>
> This is _emphasized text_ and this is a math subscript: *mₙ*.
-###### ConTeXt example {.unnumbered}
+##### \Hologo{ConTeXt} Example {.unnumbered}
Using a text editor, create a text document named `document.tex` with the
following content:
@@ -4714,7 +5083,7 @@ following text:
>
> This is _emphasized text_ and this is a math subscript: *mₙ*.
-%</manual>
+%</manual-options>
%<*lua,lua-cli>
% \fi
% \begin{macrocode}
@@ -4876,7 +5245,7 @@ end
% ```````
%
% This shows another advantage of using the command-line interface compared to
-% using a higher-level \TeX{} interface -- it is unnecessary to provide shell
+% using a higher-level \TeX{} interface: it is unnecessary to provide shell
% access for the \TeX{} engine.
%
% \end{markdown}
@@ -4893,35 +5262,66 @@ end
%
% \iffalse
%</tex>
-%<*manual>
+%<*manual-interfaces>
+
+### Plain \TeX{}
+
+The plain \TeX{} interface provides \TeX{} commands that typeset markdown
+documents by using the Lua interface behind the scenes. Unlike the Lua
+interface, the plain TeX interface does not provide low-level tools for
+converting markdown to \TeX{}. Instead, its goal is to provide high-level
+typesetting capabilities.
+
+The plain \TeX{} interface accepts the same options as the `markdown` Lua
+module, in addition to its own options, but now the options are specified as
+\TeX{} commands.
-Plain TeX
----------
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\input lmfonts
-The plain TeX macro package provides TeX commands for typesetting markdown
-documents that invoke the Lua parser in the background. Beside TeX commands
-that correspond to the Lua options, the macro package also provides commands
-corresponding to additional plain TeX-specific options, and so-called *token
-renderer* commands that define how the individual markdown elements will be
-typeset.
+\markdownBegin
+$\sqrt{-1}$ *equals* $i$.
+\markdownEnd
-### Interfaces
+\def\markdownOptionHybrid{true}
+\markdownBegin
+$\sqrt{-1}$ *equals* $i$.
+\markdownEnd
-<!-- TODO -->
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
-%</manual>
+> \$\\sqrt{-1}\$ *equals* \$i\$.
+>
+> √-̅1̅ *equals* $i$.
+
+Invoking pdfTeX should have the same effect:
+``` sh
+pdftex --shell-escape document.tex
+``````
+
+%</manual-interfaces>
%<*tex>
% \fi
%
% The plain \TeX{} interface provides macros for the typesetting of markdown
% input from within plain \TeX{}, for setting the Lua interface options (see
% Section \ref{sec:luaoptions}) used during the conversion from markdown to
-% plain \TeX{}, and for changing the way markdown the tokens are rendered.
+% plain \TeX{} and for changing the way markdown the tokens are rendered.
%
% \end{markdown}
% \begin{macrocode}
-\def\markdownLastModified{2018/04/08}%
-\def\markdownVersion{2.5.6}%
+\def\markdownLastModified{2019/04/04}%
+\def\markdownVersion{2.7.0}%
% \end{macrocode}
% \par
% \begin{markdown}
@@ -5021,24 +5421,35 @@ typeset.
%### Options
% \label{sec:texoptions}
%
+% The plain \TeX{} options are represented by \TeX{} commands. Some of them map
+% directly to the options recognized by the Lua interface (see
+% Section~\ref{sec:luaoptions}), while some of them are specific to the plain
+% \TeX{} interface.
+%
+% \end{markdown}
% \iffalse
%</tex>
-%<*manual>
+%<*manual-options>
-### Options
+### Plain \TeX{}
-<!-- TODO -->
+Plain \TeX{} options control the communication between the \TeX{} interface and
+the `markdown` Lua module. They are supported by all higher-level interfaces of
+the Markdown package, i.e. the plain \TeX{}, \LaTeX{} and \Hologo{ConTeXt}
+interfaces.
-%</manual>
+% \fi
+% \begin{markdown}
+
+#### File and Directory Names
+
+% \end{markdown}
+% \iffalse
+%</manual-options>
%<*tex>
% \fi
+% \begin{markdown}
%
-% The plain \TeX{} options are represented by \TeX{} macros. Some of them map
-% directly to the options recognized by the Lua interface (see
-% Section~\ref{sec:luaoptions}), while some of them are specific to the plain
-% \TeX{} interface.
-%
-%#### File and Directory names
% The \mdef{markdownOptionHelperScriptFileName} macro sets the filename of the
% helper Lua script file that is created during the conversion from markdown to
% plain \TeX{} in \TeX{} engines without the \m{directlua} primitive. It
@@ -5096,35 +5507,97 @@ typeset.
% \par
% \begin{markdown}
%
-% The \mdef{markdownOptionCacheDir} macro corresponds to the Lua interface
-% \Opt{cacheDir} option that sets the path to the directory that will contain
-% the produced cache files. The option defaults to `_markdown_`\m{jobname},
-% which is a similar naming scheme to the one used by the \pkg{minted} \LaTeX{}
-% package. The same limitations apply here as in the case of the
+% The \mdef{markdownOptionOutputDir} macro sets the path to the directory that
+% will contain the cache files produced by the Lua implementation and also the
+% auxiliary files produced by the plain \TeX{} implementation. The option
+% defaults to `.`.
+%
+% The path must be set to the same value as the `-output-directory` option of
+% your \TeX{} engine for the package to function correctly. We need this macro
+% to make the Lua implementation aware where it should store the helper files.
+% The same limitations apply here as in the case of the
% \m{markdownOptionHelperScriptFileName} macro.
%
% \end{markdown}
% \begin{macrocode}
-\def\markdownOptionCacheDir{\markdownOptionOutputDir/_markdown_\jobname}%
+\def\markdownOptionOutputDir{.}%
% \end{macrocode}
% \par
% \begin{markdown}
%
-% The \mdef{markdownOptionOutputDir} macro sets the path to the directory that
-% will contain the cache files produced by the Lua implementation and also the
-% auxiliary files produced by the plain TeX implementation. The option defaults
-% to `.`.
-%
-% The path must be set to the same value as the `-output-directory` option of
-% your TeX engine for the package to function correctly. We need this macro to
-% make the Lua implementation aware where it should store the helper files.
-% The same limitations apply here as in the case of the
+% The \mdef{markdownOptionCacheDir} macro corresponds to the Lua interface
+% \Opt{cacheDir} option that sets the path to the directory that will contain
+% the produced cache files. The option defaults to `_markdown_`\m{jobname},
+% which is a similar naming scheme to the one used by the \pkg{minted} \LaTeX{}
+% package. The same limitations apply here as in the case of the
% \m{markdownOptionHelperScriptFileName} macro.
%
% \end{markdown}
% \begin{macrocode}
-\def\markdownOptionOutputDir{.}%
+\def\markdownOptionCacheDir{\markdownOptionOutputDir/_markdown_\jobname}%
% \end{macrocode}
+%
+% \iffalse
+%</tex>
+%<*manual-options>
+
+The plain \TeX{} interface provides the following commands that you can use to
+specify the location of temporary files produced during the conversion from
+Markdown to \TeX{}:
+
+- `\markdownOptionHelperScriptFileName`,
+- `\markdownOptionInputTempFileName`,
+- `\markdownOptionOutputTempFileName`,
+- `\markdownOptionErrorTempFileName`,
+- `\markdownOptionOutputDir`, and
+- `\markdownOptionCacheDir`.
+
+Using a text editor, create a folder named `output-directory` and a text
+document named `document.tex` with the following content:
+``` tex
+\input lmfonts
+\input markdown
+\def\markdownOptionHelperScriptFileName{helper-script.lua}
+\def\markdownOptionInputTempFileName{temporary-input.md}
+\def\markdownOptionOutputTempFileName{temporary-output.tex}
+\def\markdownOptionErrorTempFileName{error-output.txt}
+\def\markdownOptionOutputDir{output-directory}
+\def\markdownOptionCacheDir{output-directory/cache-directory}
+\markdownBegin
+Hello *world*!
+\markdownEnd
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex --output-directory output-directory document.tex
+``````
+A text document named `temporary-input.md` should be produced in the folder
+named `output-directory` and contain the following text:
+
+> Hello \*world\*!
+
+A folder named `output-directory/cache-directory` should also be produced and
+contain fragments of the converted markdown document. LuaTeX does not need
+other temporary files to perform the conversion from markdown to \TeX{}. To
+produce the remaining temporary files, invoke pdfTeX from the terminal:
+``` sh
+pdftex --output-directory output-directory --shell-escape document.tex
+``````
+Text documents named `helper-script.lua`, and `temporary-output.md` should be
+produced in the folder named `output-directory`. The document named
+`helper-script.lua` will contain Lua code that was executed to convert markdown
+to plain \TeX{}. The document named `temporary-output.tex` will contain the
+input markdown document converted to \TeX{}.
+
+No document named `error-output.txt` should be produced in the folder named
+`output-directory`. This document would only be produced if an error had occured
+while executing the Lua code. If this happens, please [file a
+bug](https://github.com/witiko/markdown/issues).
+
+%</manual-options>
+%<*tex>
+% \fi
% \par
% \begin{markdown}
%
@@ -5152,24 +5625,68 @@ typeset.
\let\markdownOptionFootnotes\undefined
\let\markdownOptionFencedCode\undefined
\let\markdownOptionHashEnumerators\undefined
+\let\markdownOptionHeaderAttributes\undefined
\let\markdownOptionHtml\undefined
\let\markdownOptionHybrid\undefined
\let\markdownOptionInlineFootnotes\undefined
\let\markdownOptionPreserveTabs\undefined
+\let\markdownOptionSlice\undefined
\let\markdownOptionSmartEllipses\undefined
\let\markdownOptionStartNumber\undefined
\let\markdownOptionTightLists\undefined
% \end{macrocode}
% \par
+% \iffalse
+%</tex>
+%<*manual-options>
+
+#### Package Documentation
+
+The \mdef{markdownOptionStripPercentSigns} macro controls whether a percent
+sign (`%`) at the beginning of a line will be discarded when reading Markdown
+input from a \TeX{} document. This enables the use of markdown when writing
+\TeX{} package documentation using the [Doc \LaTeX{} package][doc] by Frank
+Mittelbach.
+
+ [doc]: https://ctan.org/pkg/doc (doc – Format LaTeX documentation)
+
+Using a text editor, create a text document named `document.dtx` with the
+following content:
+
+ ``` tex
+ % \iffalse
+ \documentclass{ltxdoc}
+ \usepackage[stripPercentSigns]{markdown}
+ \begin{document}
+ \DocInput{document.dtx}
+ \end{document}
+ % \fi
+ %
+ % \begin{markdown}
+ % Hello *world*!
+ % \end{markdown}
+ ```````
+
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.dtx
+``````
+A PDF document named `document.pdf` should be produced and contain the text
+“Hello *world*!”
+
+%</manual-options>
+%<*tex>
+% \fi
% \begin{markdown}
%
-%#### Miscellaneous options
+%#### Miscellaneous Options
+%
% The \mdef{markdownOptionStripPercentSigns} macro controls whether a percent
% sign (`%`) at the beginning of a line will be discarded when buffering
% Markdown input (see Section~\ref{sec:buffering}) or not. Notably, this
% enables the use of markdown when writing \TeX{} package documentation using
% the \pkg{Doc} \LaTeX{}~package~[@mittelbach17] or similar. The recognized
-% values of the macro are `true` (discard), and `false` (retain).
+% values of the macro are `true` (discard) and `false` (retain).
%
% \end{markdown}
% \begin{macrocode}
@@ -5196,22 +5713,32 @@ typeset.
\csname markdownOption#1\endcsname\relax\relax\relax\relax\relax}
% \end{macrocode}
% \par
-% \begin{markdown}
-%
-%### Token Renderers
-% \label{sec:texrenderersuser}
%
% \iffalse
%</tex>
-%<*manual>
+%<*manual-tokens>
-### Token renderers
+## Markdown Tokens
-<!-- TODO -->
+A key feature of the Markdown package is the support for manipulating markdown
+tokens, such as headings, emphasized text, links, and lists, in \TeX{}. Instead
+of reducing \TeX{} to a PDF document producer, the Markdown package allows the
+user to specify how every markdown token should be processed and rendered.
-%</manual>
-%<*tex>
% \fi
+% \begin{markdown}
+
+### Token Renderers
+
+% \label{sec:texrenderersuser}
+% \end{markdown}
+% \iffalse
+
+Token renderers are user-defined \TeX{} macros, which render markdown tokens.
+In this section, I will describe the individual token renderers.
+
+% \fi
+% \begin{markdown}
%
% The following \TeX{} macros may occur inside the output of the
% converter functions exposed by the Lua interface (see Section
@@ -5219,62 +5746,550 @@ typeset.
% macros are intended to be redefined by the user who is typesetting a
% document. By default, they point to the corresponding prototypes (see Section
% \ref{sec:texrendererprototypes}).
+
+#### Interblock Separator Renderer
+The \mdef{markdownRendererInterblockSeparator} macro represents a separator
+between two markdown block elements. The macro receives no arguments.
+
+% \end{markdown}
%
-%#### Interblock Separator Renderer
-% The \mdef{markdownRendererInterblockSeparator} macro represents a separator
-% between two markdown block elements. The macro receives no arguments.
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownRendererInterblockSeparator{%
+ \par
+ {\it(The end of a block)}%
+ \par
+}
+\markdownBegin
+Hello *world*!
+
+_Foo_ bar!
+\markdownEnd
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Hello *world*!
+>
+> *(The end of a block)*
+>
+> _Foo_ bar!
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage{markdown}
+\markdownSetup{
+ renderers = {
+ interblockSeparator = {%
+ \par
+ \emph{(The end of a block)}%
+ \par
+ },
+ },
+}
+\begin{document}
+\begin{markdown}
+Hello *world*!
+
+_Foo_ bar!
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Hello *world*!
+>
+> *(The end of a block)*
+>
+> _Foo_ bar!
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownRendererInterblockSeparator{%
+ \par
+ \emph{(The end of a block)}%
+ \par
+}
+\starttext
+\startmarkdown
+Hello *world*!
+
+_Foo_ bar!
+\stopmarkdown
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Hello *world*!
+>
+> *(The end of a block)*
+>
+> _Foo_ bar!
+
+%</manual-tokens>
+%<*tex>
+% \fi
%
-% \end{markdown}
% \begin{macrocode}
\def\markdownRendererInterblockSeparator{%
\markdownRendererInterblockSeparatorPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Line Break Renderer
-% The \mdef{markdownRendererLineBreak} macro represents a forced line break.
-% The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Line Break Renderer
+The \mdef{markdownRendererLineBreak} macro represents a forced line break.
+The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownRendererLineBreak{%
+ \par
+ {\it(A forced linebreak)}%
+ \par
+}
+\markdownInput{example.md}
+\bye
+```````
+Using a text editor, create a text document named `example.md` with the
+following content. Note the two spaces at the end of the first line, which
+specify a hard linebreak. Due to the limitations of the \TeX{} input
+processor, hard linebreaks would be ignored if we typed them directly into the
+`document.tex` document.
+
+<pre><code>Hello world! <br/>_Foo_ bar!</code></pre>
+
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Hello *world*!
+>
+> *(A forced linebreak)*
+>
+> _Foo_ bar!
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage{markdown}
+\markdownSetup{
+ renderers = {
+ lineBreak = {%
+ \par
+ \emph{(A forced linebreak)}%
+ \par
+ },
+ },
+}
+\begin{document}
+\markdownInput{example.md}
+\end{document}
+```````
+Using a text editor, create a text document named `example.md` with the
+following content. Note the two spaces at the end of the first line, which
+specify a hard linebreak. Due to the limitations of the \TeX{} input
+processor, hard linebreaks would be ignored if we typed them directly into the
+`document.tex` document.
+
+<pre><code>Hello world! <br/>_Foo_ bar!</code></pre>
+
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Hello *world*!
+>
+> *(A forced linebreak)*
+>
+> _Foo_ bar!
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownRendererLineBreak{%
+ \par
+ \emph{(A forced linebreak)}%
+ \par
+}
+\starttext
+\markdownInput{example.md}
+\stoptext
+```````
+Using a text editor, create a text document named `example.md` with the
+following content. Note the two spaces at the end of the first line, which
+specify a hard linebreak. Due to the limitations of the \TeX{} input
+processor, hard linebreaks would be ignored if we typed them directly into the
+`document.tex` document.
+
+<pre><code>Hello world! <br/>_Foo_ bar!</code></pre>
+
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Hello *world*!
+>
+> *(A forced linebreak)*
+>
+> _Foo_ bar!
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererLineBreak{%
\markdownRendererLineBreakPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Ellipsis Renderer
-% The \mdef{markdownRendererEllipsis} macro replaces any occurance of ASCII
-% ellipses in the input text. This macro will only be produced, when the
-% \Opt{smartEllipses} option is `true`. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Ellipsis Renderer
+ The \mdef{markdownRendererEllipsis} macro replaces any occurance of ASCII
+ ellipses in the input text. This macro will only be produced, when the
+ \Opt{smartEllipses} option is `true`. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownOptionSmartEllipses{true}
+\def\markdownRendererEllipsis{{\it SHAZAM}!}
+\markdownBegin
+The secret word is ...
+\markdownEnd
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> The secret word is *SHAZAM*!
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage[smartEllipses]{markdown}
+\markdownSetup{
+ renderers = {
+ ellipsis = \emph{SHAZAM}!,
+ },
+}
+\begin{document}
+\begin{markdown}
+The secret word is ...
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> The secret word is *SHAZAM*!
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownOptionSmartEllipses{true}
+\def\markdownRendererEllipsis{\emph{SHAZAM}!}
+\starttext
+\startmarkdown
+The secret word is ...
+\stopmarkdown
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Hello *world*!
+>
+> *(The end of a block)*
+>
+> _Foo_ bar!
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererEllipsis{%
\markdownRendererEllipsisPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Non-breaking Space Renderer
-% The \mdef{markdownRendererNbsp} macro represents a non-breaking space.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Non-Breaking Space Renderer
+The \mdef{markdownRendererNbsp} macro represents a non-breaking space.
+
% \end{markdown}
+%
+% \iffalse
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.bib` with the
+following content:
+``` bib
+@book{knuth:tex,
+ author = "Knuth, Donald Ervin",
+ title = "The \TeX book, volume A of Computers and typesetting",
+ publisher = "Addison-Wesley",
+ year = "1984"
+}
+```````
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage[
+ citations,
+ citationNbsps,
+]{markdown}
+\markdownSetup{
+ renderers = {
+ nbsp = {$\cdot$},
+ },
+}
+\begin{document}
+
+\begin{markdown}
+The TeXbook [@knuth:tex, p. 123 and 130] is good.
+\end{markdown}
+
+\bibliographystyle{plain}
+\bibliography{document.bib}
+
+\end{document}
+```````
+Next, invoke LuaTeX and BibTeX from the terminal:
+``` sh
+lualatex document.tex
+bibtex document.aux
+lualatex document.tex
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> The TeXbook [1, p.·123·and·130] is good.
+>
+> ### References
+> [1] Donald Ervin Knuth. _The TeXbook, volume A of Computers and typesetting._
+> Addison-Wesley, 1984.
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererNbsp{%
\markdownRendererNbspPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Special Character Renderers
-% The following macros replace any special plain \TeX{} characters (including
-% the active pipe character (`|`) of \Hologo{ConTeXt}) in the input text.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
+%
+% \begin{markdown}
+
+#### Special Character Renderers
+The following macros replace any special plain \TeX{} characters, including
+% \iffalse
+the active pipe character (`|`) of \Hologo{ConTeXt}, in the input text:
+
+- \mdef{markdownRendererAmpersand} replaces the ampersand (`&`).
+- \mdef{markdownRendererBackslash} replaces the backslash (`\`).
+- \mdef{markdownRendererCircumflex} replaces the circumflex (`^`).
+- \mdef{markdownRendererDollarSign} replaces the dollar sign (`$`).
+- \mdef{markdownRendererHash} replaces the hash sign (`#`).
+- \mdef{markdownRendererLeftBrace} replaces the left brace (`{`).
+- \mdef{markdownRendererPercentSign} replaces the percent sign (`%`).
+- \mdef{markdownRendererPipe} replaces the pipe character (`|`).
+- \mdef{markdownRendererRightBrace} replaces the right brace (`}`).
+- \mdef{markdownRendererTilde} replaces the tilde (`~`).
+- \mdef{markdownRendererUnderscore} replaces the underscore (`_`).
+
+% \fi
+% the active pipe character (`|`) of \Hologo{ConTeXt}, in the input text.
% These macros will only be produced, when the \Opt{hybrid} option is
% `false`.
-%
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content. We will make the tilde behave as if it were written in
+\TeX{}, where it represents a non-breaking space.
+``` tex
+\input markdown
+\def\markdownRendererTilde{~}
+\markdownBegin
+Bartel~Leendert van~der~Waerden
+\markdownEnd
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text, where the middot (`·`) denotes a non-breakable space:
+
+> Bartel·Leendert van·der·Waerden
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content. We will make the tilde behave as if it were written in
+\TeX{}, where it represents a non-breaking space.
+``` tex
+\documentclass{article}
+\usepackage{markdown}
+\markdownSetup{
+ renderers = {
+ tilde = ~,
+ },
+}
+\begin{document}
+\begin{markdown}
+Bartel~Leendert van~der~Waerden
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text, where the middot (`·`) denotes a non-breakable space:
+
+> Bartel·Leendert van·der·Waerden
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content. We will make the tilde behave as if it were written in
+\TeX{}, where it represents a non-breaking space.
+``` tex
+\usemodule[t][markdown]
+\def\markdownRendererTilde{~}
+\starttext
+\startmarkdown
+Bartel~Leendert van~der~Waerden
+\stopmarkdown
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text, where the middot (`·`) denotes a non-breakable space:
+
+> Bartel·Leendert van·der·Waerden
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererLeftBrace{%
\markdownRendererLeftBracePrototype}%
@@ -5300,570 +6315,3078 @@ typeset.
\markdownRendererPipePrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Code Span Renderer
-% The \mdef{markdownRendererCodeSpan} macro represents inlined code span in the
-% input text. It receives a single argument that corresponds to the inlined
-% code span.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Code Span Renderer
+The \mdef{markdownRendererCodeSpan} macro represents inlined code span in the
+input text. It receives a single argument that corresponds to the inlined
+code span.
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\input lmfonts
+
+\def\markdownRendererCodeSpan#1{#1}
+
+\markdownBegin
+`$\sqrt{-1}$ *equals* $i$`
+
+$\sqrt{-1}$ *equals* $i$
+\markdownEnd
+
+\def\markdownOptionHybrid{true}
+\markdownBegin
+$\sqrt{-1}$ *equals* $i$
+\markdownEnd
+
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> \$\\sqrt{-1}\$ \*equals\* \$i\$.
+>
+> \$\\sqrt{-1}\$ *equals* \$i\$.
+>
+> √-̅1̅ *equals* $i$.
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage[smartEllipses]{markdown}
+\markdownSetup{
+ renderers = {
+ codeSpan = {#1},
+ },
+}
+\begin{document}
+
+\begin{markdown}
+`$\sqrt{-1}$ *equals* $i$`
+
+$\sqrt{-1}$ *equals* $i$
+\end{markdown}
+
+\begin{markdown*}{hybrid}
+$\sqrt{-1}$ *equals* $i$
+\end{markdown*}
+
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> \$\\sqrt{-1}\$ \*equals\* \$i\$.
+>
+> \$\\sqrt{-1}\$ *equals* \$i\$.
+>
+> √-̅1̅ *equals* $i$.
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownRendererCodeSpan#1{#1}
+\starttext
+
+\startmarkdown
+`$\sqrt{-1}$ *equals* $i$`
+
+$\sqrt{-1}$ *equals* $i$
+\stopmarkdown
+
+\def\markdownOptionHybrid{true}
+\startmarkdown
+$\sqrt{-1}$ *equals* $i$
+\stopmarkdown
+
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> \$\\sqrt{-1}\$ \*equals\* \$i\$.
+>
+> \$\\sqrt{-1}\$ *equals* \$i\$.
+>
+> √-̅1̅ *equals* $i$.
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererCodeSpan{%
\markdownRendererCodeSpanPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Link Renderer
-% The \mdef{markdownRendererLink} macro represents a hyperlink. It receives
-% four arguments: the label, the fully escaped \acro{uri} that can be directly
-% typeset, the raw \acro{uri} that can be used outside typesetting, and the
-% title of the link.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Link Renderer
+The \mdef{markdownRendererLink} macro represents a hyperlink. It receives
+four arguments: the label, the fully escaped \acro{uri} that can be directly
+typeset, the raw \acro{uri} that can be used outside typesetting, and the
+title of the link.
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownRendererLink#1#2#3#4{%
+ #1 {\tt#2} titled {\it#4}%
+}
+\markdownBegin
+Please visit [the link][ctan].
+
+ [ctan]: https://ctan.org/
+ (the Comprehensive TeX Archive Network)
+\markdownEnd
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Please visit the link <https://ctan.org/> titled *the Comprehensive TeX
+> Archive Network*.
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage{markdown}
+\markdownSetup{
+ renderers = {
+ link = {%
+ #1 \texttt{#2} titled \emph{#4}%
+ },
+ },
+}
+\begin{document}
+\begin{markdown}
+Please visit [the link][ctan].
+
+ [ctan]: https://ctan.org/
+ (the Comprehensive TeX Archive Network)
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Please visit the link <https://ctan.org/> titled *the Comprehensive TeX
+> Archive Network*.
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownRendererLink#1#2#3#4{%
+ #1 {\tt#2} titled \emph{#4}%
+}
+\starttext
+\startmarkdown
+Please visit [the link][ctan].
+
+ [ctan]: https://ctan.org/
+ (the Comprehensive TeX Archive Network)
+\stopmarkdown
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Please visit the link <https://ctan.org/> titled *the Comprehensive TeX
+> Archive Network*.
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererLink{%
\markdownRendererLinkPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Image Renderer
-% The \mdef{markdownRendererImage} macro represents an image. It receives
-% four arguments: the label, the fully escaped \acro{uri} that can be directly
-% typeset, the raw \acro{uri} that can be used outside typesetting, and the
-% title of the link.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Image Renderer
+The \mdef{markdownRendererImage} macro represents an image. It receives
+four arguments: the label, the fully escaped \acro{uri} that can be directly
+typeset, the raw \acro{uri} that can be used outside typesetting, and the
+title of the link.
+
% \end{markdown}
+%
+% \iffalse
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage{markdown}
+\begingroup
+\catcode`\@=11
+\catcode`\%=12
+\catcode`\^^A=14
+\global\def\markdownRendererImage#1#2#3#4{^^A
+ \immediate\write18{^^A
+ if printf '%s' "#3" | grep -q ^http; then
+ OUTPUT="$(printf '%s' "#3" | md5sum | cut -d' ' -f1).^^A
+ $(printf '%s' "#3" | sed 's/.*[.]//')";
+ if ! [ -e "$OUTPUT" ]; then
+ wget -O "$OUTPUT" '#3' || rm "$OUTPUT";
+ convert "$OUTPUT" png:"$OUTPUT";
+ fi;
+ printf '%s%%' "$OUTPUT" > \jobname.fetched;
+ else
+ printf '%s%%' "#3" > \jobname.fetched;
+ fi^^A
+ }^^A
+ {^^A
+ \everyeof={\noexpand}^^A
+ \edef\filename{\@@input"\jobname.fetched" }^^A
+ \includegraphics[width=\textwidth]{\filename}^^A
+ }^^A
+}
+\endgroup
+\begin{document}
+\begin{markdown}
+![TUGboat](https://tug.org/tugboat/noword.jpg)
+\end{markdown}
+\end{document}
+``````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex --shell-escape document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following content. This assumes that you use a Unix-like operating system with
+Bourne or Bourne again shell as the default shell of the current user. It also
+assumes that the `md5sum`, `wget`, and `convert` binaries are installed and
+that the \TeX{} engine has shell access.
+
+> ![](https://tug.org/tugboat/noword.jpg "The Communications of the TeX Users Group")
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererImage{%
\markdownRendererImagePrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Content Block Renderers
-% \label{sec:texcontentblockrenderers}
-% The \mdef{markdownRendererContentBlock} macro represents an iA\,Writer content
-% block. It receives four arguments: the local file or online image filename
-% extension cast to the lower case, the fully escaped \acro{uri} that can be
-% directly typeset, the raw \acro{uri} that can be used outside typesetting,
-% and the title of the content block.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Content Block Renderers
+\label{sec:texcontentblockrenderers}
+The \mdef{markdownRendererContentBlock} macro represents an iA\,Writer content
+block. It receives four arguments: the local file or online image filename
+extension cast to the lower case, the fully escaped \acro{uri} that can be
+directly typeset, the raw \acro{uri} that can be used outside typesetting,
+and the title of the content block.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererContentBlock{%
\markdownRendererContentBlockPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererContentBlockOnlineImage} macro represents an
-% iA\,Writer online image content block. The macro receives the same arguments
-% as \m{markdownRendererContentBlock}.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererContentBlockOnlineImage} macro represents an
+iA\,Writer online image content block. The macro receives the same arguments
+as \m{markdownRendererContentBlock}.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererContentBlockOnlineImage{%
\markdownRendererContentBlockOnlineImagePrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
-%
-% The \mdef{markdownRendererContentBlockCode} macro represents an iA\,Writer
-% content block that was recognized as a file in a known programming language
-% by its filename extension $s$. If any `markdown-languages.json` file found
-% by \pkg{kpathsea}\footnote{Local files take precedence. Filenames other
-% than `markdown-languages.json` may be specified using the
-% `contentBlocksLanguageMap` Lua option.} contains a record $(k, v)$, then a
-% non-online-image content block with the filename extension $s,
-% s$`:lower()`${}=k$ is considered to be in a known programming language $v$.
-% The macro receives five arguments: the local file name extension $s$ cast to
-% the lower case, the language $v$, the fully escaped \acro{uri} that can be
-% directly typeset, the raw \acro{uri} that can be used outside typesetting,
-% and the title of the content block.
%
-% Note that you will need to place place a `markdown-languages.json` file
-% inside your working directory or inside your local TeX directory structure.
-% In this file, you will define a mapping between filename extensions and the
-% language names recognized by your favorite syntax highlighter; there may
-% exist other creative uses beside syntax highlighting. The `Languages.json`
-% file provided by @sotkov17 is a good starting point.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererContentBlockCode} macro represents an iA\,Writer
+content block that was recognized as a file in a known programming language
+by its filename extension $s$. If any `markdown-languages.json` file found
+by \pkg{kpathsea}\footnote{Local files take precedence. Filenames other
+than `markdown-languages.json` may be specified using the
+`contentBlocksLanguageMap` Lua option.} contains a record $(k, v)$, then a
+non-online-image content block with the filename extension $s,
+s$`:lower()`${}=k$ is considered to be in a known programming language $v$.
+The macro receives five arguments: the local file name extension $s$ cast to
+the lower case, the language $v$, the fully escaped \acro{uri} that can be
+directly typeset, the raw \acro{uri} that can be used outside typesetting,
+and the title of the content block.
+
+Note that you will need to place place a `markdown-languages.json` file
+inside your working directory or inside your local \TeX{} directory
+structure. In this file, you will define a mapping between filename
+extensions and the language names recognized by your favorite syntax
+highlighter; there may exist other creative uses beside syntax highlighting.
+% The `Languages.json` file provided by @sotkov17 is a good starting point.
% \end{markdown}
+%
+% \iffalse
+[The `Languages.json` file provided by Anton Sotkov][sotkov17] is a good
+starting point.
+
+ [sotkov17]: https://github.com/iainc/Markdown-Content-Blocks
+ (File transclusion syntax for Markdown)
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownOptionContentBlocks{true}
+\def\markdownRendererContentBlock#1#2#3#4{%
+ This is {\tt #2}, #4.
+}
+\def\markdownRendererContentBlockOnlineImage#1#2#3#4{%
+ This is the image {\tt #2}, #4.
+}
+\def\markdownRendererContentBlockCode#1#2#3#4#5{%
+ This is the #2 (\uppercase{#1}) document {\tt #3}, #5.
+}
+\markdownBegin
+/document.tex (the document that we are currently typesetting)
+/markdown-languages.json (the mapping between filename extensions
+ and programming language names)
+https://tug.org/tugboat/noword.jpg (the logotype of TUGboat)
+\markdownEnd
+\bye
+```````
+Create also a text document named `markdown-languages.json` with the following
+content:
+``` js
+{
+ "json": "JavaScript Object Notation",
+}
+``````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is `document.tex`, the document that we are currently typesetting.
+>
+> This is the JavaScript Object Notation (JSON) document
+> `markdown-languages.json`, the mapping between filename extensions and
+> programming language names.
+>
+> This is the image `https://tug.org/tugboat/noword.jpg`, the logotype of
+> TUGboat.
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage{filecontents}
+\begin{filecontents*}{markdown-languages.json}
+{
+ "json": "JavaScript Object Notation",
+}
+\end{filecontents*}
+\usepackage[contentBlocks]{markdown}
+\markdownSetup{
+ renderers = {
+ contentBlock = {This is \texttt{#2}, #4.},
+ contentBlockOnlineImage = {This is the image \texttt{#2}, #4.},
+ contentBlockCode = {%
+ This is the #2 (\MakeUppercase{#1}) document \texttt{#3}, #5.
+ },
+ },
+}
+\begin{document}
+\begin{markdown}
+/document.tex (the document that we are currently typesetting)
+/markdown-languages.json (the mapping between filename extensions
+ and programming language names)
+https://tug.org/tugboat/noword.jpg (the logotype of TUGboat)
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is `document.tex`, the document that we are currently typesetting.
+>
+> This is the JavaScript Object Notation (JSON) document
+> `markdown-languages.json`, the mapping between filename extensions and
+> programming language names.
+>
+> This is the image `https://tug.org/tugboat/noword.jpg`, the logotype of
+> TUGboat.
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownOptionContentBlocks{true}
+\def\markdownRendererContentBlock#1#2#3#4{%
+ This is {\tt #2}, #4.
+}
+\def\markdownRendererContentBlockOnlineImage#1#2#3#4{%
+ This is the image {\tt #2}, #4.
+}
+\def\markdownRendererContentBlockCode#1#2#3#4#5{%
+ This is the #2 (\uppercase{#1}) document {\tt #3}, #5.
+}
+\starttext
+\startmarkdown
+/document.tex (the document that we are currently typesetting)
+/markdown-languages.json (the mapping between filename extensions
+ and programming language names)
+https://tug.org/tugboat/noword.jpg (the logotype of TUGboat)
+\stopmarkdown
+\stoptext
+```````
+Create also a text document named `markdown-languages.json` with the following
+content:
+``` js
+{
+ "json": "JavaScript Object Notation",
+}
+``````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is `document.tex`, the document that we are currently typesetting.
+>
+> This is the JavaScript Object Notation (JSON) document
+> `markdown-languages.json`, the mapping between filename extensions and
+> programming language names.
+>
+> This is the image `https://tug.org/tugboat/noword.jpg`, the logotype of
+> TUGboat.
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererContentBlockCode{%
\markdownRendererContentBlockCodePrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Bullet List Renderers
-% The \mdef{markdownRendererUlBegin} macro represents the beginning of a
-% bulleted list that contains an item with several paragraphs of text (the
-% list is not tight). The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Bullet List Renderers
+The \mdef{markdownRendererUlBegin} macro represents the beginning of a
+bulleted list that contains an item with several paragraphs of text (the
+list is not tight). The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererUlBegin{%
\markdownRendererUlBeginPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererUlBeginTight} macro represents the beginning of a
-% bulleted list that contains no item with several paragraphs of text (the list
-% is tight). This macro will only be produced, when the \Opt{tightLists} option
-% is `false`. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererUlBeginTight} macro represents the beginning of a
+bulleted list that contains no item with several paragraphs of text (the list
+is tight). This macro will only be produced, when the \Opt{tightLists} option
+is `false`. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererUlBeginTight{%
\markdownRendererUlBeginTightPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererUlItem} macro represents an item in a bulleted
-% list. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererUlItem} macro represents an item in a bulleted
+list. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererUlItem{%
\markdownRendererUlItemPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererUlItemEnd} macro represents the end of an item in a
-% bulleted list. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererUlItemEnd} macro represents the end of an item in a
+bulleted list. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererUlItemEnd{%
\markdownRendererUlItemEndPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererUlEnd} macro represents the end of a bulleted list
-% that contains an item with several paragraphs of text (the list is not
-% tight). The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererUlEnd} macro represents the end of a bulleted list
+that contains an item with several paragraphs of text (the list is not
+tight). The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererUlEnd{%
\markdownRendererUlEndPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererUlEndTight} macro represents the end of a bulleted
-% list that contains no item with several paragraphs of text (the list is
-% tight). This macro will only be produced, when the \Opt{tightLists} option is
-% `false`. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererUlEndTight} macro represents the end of a bulleted
+list that contains no item with several paragraphs of text (the list is
+tight). This macro will only be produced, when the \Opt{tightLists} option is
+`false`. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownOptionTightLists{true}
+
+\def\markdownRendererInterblockSeparator{}
+\def\markdownRendererUlBeginTight{ (}
+\def\markdownRendererUlItem{%
+ \def\markdownRendererUlItem{%
+ ,
+ \def\markdownRendererUlItem{, and }%
+ }%
+}
+\def\markdownRendererUlItemEnd{}
+\def\markdownRendererUlEndTight{).}
+
+\markdownBegin
+This is a tight list
+
+- the first item
+- the second item
+- the third item
+\markdownEnd
+
+\def\markdownRendererInterblockSeparator{%
+ :\par
+ \def\markdownRendererInterblockSeparator{\par}%
+}
+\def\markdownRendererUlBegin{}
+\def\markdownRendererUlItem{--\kern 0.5em}
+\def\markdownRendererUlItemEnd{.\par}
+\def\markdownRendererUlEnd{}
+
+\markdownBegin
+This is a loose list
+
+- This is the first item
+
+- This is the second item
+
+- This is the third item
+\markdownEnd
+
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is a tight list (the first item, the second item, and the third item).
+>
+> This is a loose list:
+>
+> - This is the first item.
+>
+> - This is the second item.
+>
+> - This is the third item.
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage[tightLists]{markdown}
+\begin{document}
+
+\begin{markdown*}{
+ renderers = {
+ interblockSeparator = {},
+ ulBeginTight = { (},
+ ulItem = {%
+ \def\markdownRendererUlItem{%
+ ,
+ \def\markdownRendererUlItem{, and }%
+ }%
+ },
+ ulItemEnd = {},
+ ulEndTight = {).},
+ },
+}
+This is a tight list
+
+- the first item
+- the second item
+- the third item
+\end{markdown*}
+
+\begin{markdown*}{
+ renderers = {
+ interblockSeparator = {%
+ :\par
+ \def\markdownRendererInterblockSeparator{\par}%
+ },
+ ulBeginTight = {\begin{itemize}},
+ ulItem = {\item},
+ ulItemEnd = {.},
+ ulEnd = {\end{itemize}},
+ },
+}
+This is a loose list
+
+- This is the first item
+
+- This is the second item
+
+- This is the third item
+\end{markdown*}
+
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is a tight list (the first item, the second item, and the third item).
+>
+> This is a loose list:
+>
+> - This is the first item.
+>
+> - This is the second item.
+>
+> - This is the third item.
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownOptionTightLists{true}
+\starttext
+
+\def\markdownRendererInterblockSeparator{}
+\def\markdownRendererUlBeginTight{ (}
+\def\markdownRendererUlItem{%
+ \def\markdownRendererUlItem{%
+ ,
+ \def\markdownRendererUlItem{, and }%
+ }%
+}
+\def\markdownRendererUlItemEnd{}
+\def\markdownRendererUlEndTight{).}
+
+\startmarkdown
+This is a tight list
+
+- the first item
+- the second item
+- the third item
+\stopmarkdown
+
+\def\markdownRendererInterblockSeparator{%
+ :\par
+ \def\markdownRendererInterblockSeparator{\par}%
+}
+\def\markdownRendererUlBegin{\startitemize}
+\def\markdownRendererUlItem{\item}
+\def\markdownRendererUlItemEnd{.}
+\def\markdownRendererUlEnd{\stopitemize}
+
+\startmarkdown
+This is a loose list
+
+- This is the first item
+
+- This is the second item
+
+- This is the third item
+\stopmarkdown
+
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is a tight list (the first item, the second item, and the third item).
+>
+> This is a loose list:
+>
+> - This is the first item.
+>
+> - This is the second item.
+>
+> - This is the third item.
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererUlEndTight{%
\markdownRendererUlEndTightPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Ordered List Renderers
-% The \mdef{markdownRendererOlBegin} macro represents the beginning of an
-% ordered list that contains an item with several paragraphs of text (the
-% list is not tight). The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Ordered List Renderers
+The \mdef{markdownRendererOlBegin} macro represents the beginning of an
+ordered list that contains an item with several paragraphs of text (the
+list is not tight). The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererOlBegin{%
\markdownRendererOlBeginPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererOlBeginTight} macro represents the beginning of an
-% ordered list that contains no item with several paragraphs of text (the
-% list is tight). This macro will only be produced, when the \Opt{tightLists}
-% option is `false`. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererOlBeginTight} macro represents the beginning of an
+ordered list that contains no item with several paragraphs of text (the
+list is tight). This macro will only be produced, when the \Opt{tightLists}
+option is `false`. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererOlBeginTight{%
\markdownRendererOlBeginTightPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererOlItem} macro represents an item in an ordered list.
-% This macro will only be produced, when the \Opt{startNumber} option is
-% `false`. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererOlItem} macro represents an item in an ordered list.
+This macro will only be produced, when the \Opt{startNumber} option is
+`false`. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererOlItem{%
\markdownRendererOlItemPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererOlItemEnd} macro represents the end of an item in
-% an ordered list. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererOlItemEnd} macro represents the end of an item in
+an ordered list. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererOlItemEnd{%
\markdownRendererOlItemEndPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererOlItemWithNumber} macro represents an item in an
-% ordered list. This macro will only be produced, when the \Opt{startNumber}
-% option is `true`. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererOlItemWithNumber} macro represents an item in an
+ordered list. This macro will only be produced, when the \Opt{startNumber}
+option is `true`. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererOlItemWithNumber{%
\markdownRendererOlItemWithNumberPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererOlEnd} macro represents the end of an ordered list
-% that contains an item with several paragraphs of text (the list is not
-% tight). The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererOlEnd} macro represents the end of an ordered list
+that contains an item with several paragraphs of text (the list is not
+tight). The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererOlEnd{%
\markdownRendererOlEndPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererOlEndTight} macro represents the end of an ordered
-% list that contains no item with several paragraphs of text (the list is
-% tight). This macro will only be produced, when the \Opt{tightLists} option is
-% `false`. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererOlEndTight} macro represents the end of an ordered
+list that contains no item with several paragraphs of text (the list is
+tight). This macro will only be produced, when the \Opt{tightLists} option is
+`false`. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownOptionTightLists{true}
+\def\markdownOptionStartNumber{true}
+
+\def\markdownRendererInterblockSeparator{}
+\def\markdownRendererOlBeginTight{ (}
+\def\markdownRendererOlItemWithNumber#1{%
+ \ifnum #1=1\relax
+ the first
+ \else
+ \ifnum #1=2\relax
+ , the second
+ \else
+ , and the third
+ \fi
+ \fi
+}
+\def\markdownRendererOlItemEnd{}
+\def\markdownRendererOlEndTight{).}
+
+\markdownBegin
+This is a tight list
+
+1. item
+2. item
+3. item
+\markdownEnd
+
+\def\markdownRendererInterblockSeparator{%
+ :\par
+ \def\markdownRendererInterblockSeparator{\par}%
+}
+\def\markdownRendererOlBegin{}
+\def\markdownRendererOlItemWithNumber#1{%
+ #1.\kern 0.5em%
+ This is the
+ \ifnum #1=1\relax
+ first
+ \else
+ \ifnum #1=2\relax
+ second
+ \else
+ third
+ \fi
+ \fi
+}
+\def\markdownRendererOlItemEnd{.\par}
+\def\markdownRendererOlEnd{}
+
+\markdownBegin
+This is a loose list
+
+1. item
+
+2. item
+
+3. item
+\markdownEnd
+
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is a tight list (the first item, the second item, and the third item).
+>
+> This is a loose list:
+>
+> 1. This is the first item.
+>
+> 2. This is the second item.
+>
+> 3. This is the third item.
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage[tightLists, startNumber]{markdown}
+\begin{document}
+
+\begin{markdown*}{
+ renderers = {
+ interblockSeparator = {},
+ olBeginTight = { (},
+ olItemWithNumber = {%
+ \ifnum #1=1\relax
+ the first
+ \else
+ \ifnum #1=2\relax
+ , the second
+ \else
+ , and the third
+ \fi
+ \fi
+ },
+ olItemEnd = {},
+ olEndTight = {).},
+ },
+}
+This is a tight list
+
+1. item
+2. item
+3. item
+\end{markdown*}
+
+\begin{markdown*}{
+ renderers = {
+ interblockSeparator = {%
+ :\par
+ \def\markdownRendererInterblockSeparator{\par}%
+ },
+ olBeginTight = {\begin{enumerate}},
+ olItemWithNumber = {%
+ \item This is the
+ \ifnum #1=1\relax
+ first
+ \else
+ \ifnum #1=2\relax
+ second
+ \else
+ third
+ \fi
+ \fi
+ },
+ olItemEnd = {.},
+ olEnd = {\end{enumerate}},
+ },
+}
+This is a loose list
+
+1. item
+
+2. item
+
+3. item
+\end{markdown*}
+
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is a tight list (the first item, the second item, and the third item).
+>
+> This is a loose list:
+>
+> 1. This is the first item.
+>
+> 2. This is the second item.
+>
+> 3. This is the third item.
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownOptionTightLists{true}
+\def\markdownOptionStartNumber{true}
+\starttext
+
+\def\markdownRendererInterblockSeparator{}
+\def\markdownRendererOlBeginTight{ (}
+\def\markdownRendererOlItemWithNumber#1{%
+ \ifnum #1=1\relax
+ the first
+ \else
+ \ifnum #1=2\relax
+ , the second
+ \else
+ , and the third
+ \fi
+ \fi
+}
+\def\markdownRendererOlItemEnd{}
+\def\markdownRendererOlEndTight{).}
+
+\startmarkdown
+This is a tight list
+
+1. item
+2. item
+3. item
+\stopmarkdown
+
+\def\markdownRendererInterblockSeparator{%
+ :\par
+ \def\markdownRendererInterblockSeparator{\par}%
+}
+\def\markdownRendererOlBegin{\startitemize}
+\def\markdownRendererOlItemWithNumber#1{%
+ \sym{#1.}
+ This is the
+ \ifnum #1=1\relax
+ first
+ \else
+ \ifnum #1=2\relax
+ second
+ \else
+ third
+ \fi
+ \fi
+}
+\def\markdownRendererOlItemEnd{.\par}
+\def\markdownRendererOlEnd{\stopitemize}
+
+\startmarkdown
+This is a loose list
+
+1. item
+
+2. item
+
+3. item
+\stopmarkdown
+
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is a tight list (the first item, the second item, and the third item).
+>
+> This is a loose list:
+>
+> 1. This is the first item.
+>
+> 2. This is the second item.
+>
+> 3. This is the third item.
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererOlEndTight{%
\markdownRendererOlEndTightPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
-%
-%#### Definition List Renderers
-% The following macros are only produces, when the \Opt{definitionLists} option
-% is `true`.
%
-% The \mdef{markdownRendererDlBegin} macro represents the beginning of a
-% definition list that contains an item with several paragraphs of text (the
-% list is not tight). The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Definition List Renderers
+The following macros are only produced, when the \Opt{definitionLists} option
+is `true`.
+
+The \mdef{markdownRendererDlBegin} macro represents the beginning of a
+definition list that contains an item with several paragraphs of text (the
+list is not tight). The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererDlBegin{%
\markdownRendererDlBeginPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererDlBeginTight} macro represents the beginning of a
-% definition list that contains an item with several paragraphs of text (the
-% list is not tight). This macro will only be produced, when the
-% \Opt{tightLists} option is `false`. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererDlBeginTight} macro represents the beginning of a
+definition list that contains an item with several paragraphs of text (the
+list is not tight). This macro will only be produced, when the
+\Opt{tightLists} option is `false`. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererDlBeginTight{%
\markdownRendererDlBeginTightPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererDlItem} macro represents a term in a definition
-% list. The macro receives a single argument that corresponds to the term
-% being defined.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererDlItem} macro represents a term in a definition
+list. The macro receives a single argument that corresponds to the term
+being defined.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererDlItem{%
\markdownRendererDlItemPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererDlItemEnd} macro represents the end of a list of
-% definitions for a single term.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererDlItemEnd} macro represents the end of a list of
+definitions for a single term.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererDlItemEnd{%
\markdownRendererDlItemEndPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererDlDefinitionBegin} macro represents the beginning
-% of a definition in a definition list. There can be several definitions for
-% a single term.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererDlDefinitionBegin} macro represents the beginning
+of a definition in a definition list. There can be several definitions for
+a single term.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererDlDefinitionBegin{%
\markdownRendererDlDefinitionBeginPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererDlDefinitionEnd} macro represents the end of a
-% definition in a definition list. There can be several definitions for a
-% single term.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererDlDefinitionEnd} macro represents the end of a
+definition in a definition list. There can be several definitions for a
+single term.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererDlDefinitionEnd{%
\markdownRendererDlDefinitionEndPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererDlEnd} macro represents the end of a definition
-% list that contains an item with several paragraphs of text (the list is not
-% tight). The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererDlEnd} macro represents the end of a definition
+list that contains an item with several paragraphs of text (the list is not
+tight). The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererDlEnd{%
\markdownRendererDlEndPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererDlEndTight} macro represents the end of a
-% definition list that contains no item with several paragraphs of text (the
-% list is tight). This macro will only be produced, when the \Opt{tightLists}
-% option is `false`. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererDlEndTight} macro represents the end of a
+definition list that contains no item with several paragraphs of text (the
+list is tight). This macro will only be produced, when the \Opt{tightLists}
+option is `false`. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownOptionDefinitionLists{true}
+\def\markdownOptionTightLists{true}
+
+\def\markdownRendererInterblockSeparator{%
+ :%
+ \def\markdownRendererInterblockSeparator{\par}%
+}
+\def\markdownRendererDlBeginTight{%
+ \begingroup
+ \parindent=0pt
+}
+\def\markdownRendererDlItem#1{%
+ \par{\bf#1}%
+ \def\markdownRendererDlDefinitionEnd{%
+ ,
+ \def\markdownRendererDlDefinitionEnd{%
+ , and
+ \def\markdownRendererDlDefinitionEnd{.}%
+ }%
+ }%
+}
+\def\markdownRendererDlItemEnd{}
+\def\markdownRendererDlDefinitionBegin{\par--\kern 0.5em}
+\def\markdownRendererDlEndTight{\endgroup}
+
+\markdownBegin
+This is a tight definition list
+
+Coffee
+: black hot drink
+: prepared from roasted coffee beans
+: one of the most traded agricultural commodities in the world
+
+Milk
+: white cold drink
+: nutrient-rich
+: produced on an industrial scale
+\markdownEnd
+
+\def\markdownRendererInterblockSeparator{%
+ \def\markdownRendererInterblockSeparator{\par}%
+}
+\def\markdownRendererDlBegin{}
+\def\markdownRendererDlItem#1{%
+ . #1 is a
+ \def\markdownRendererDlDefinitionBegin{%
+ \def\markdownRendererDlDefinitionBegin{%
+ ,
+ \def\markdownRendererDlDefinitionBegin{, and }%
+ }%
+ }%
+}
+\def\markdownRendererDlItemEnd{}
+\def\markdownRendererDlDefinitionEnd{}
+\def\markdownRendererDlEnd{.}
+
+\markdownBegin
+This is a loose definition list
+
+Coffee
+
+: black hot drink
+
+: prepared from roasted coffee beans
+
+: one of the most traded agricultural commodities in the world
+
+Milk
+
+: white cold drink
+
+: nutrient-rich
+
+: produced on an industrial scale
+\markdownEnd
+
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is a tight definition list:
+>
+> **Coffee**
+>
+> - black hot drink,
+> - prepared from roasted coffee beans, and
+> - one of the most traded agricultural commodities in the world.
+>
+> **Milk**
+>
+> - white cold drink,
+> - nutrient-rich, and
+> - produced on an industrial scale.
+>
+> This is a loose definition list. Coffee is a black hot drink, prepared from
+> roasted coffee beans, and one of the most traded agricultural commodities in
+> the world. Milk is a white cold drink, nutrient-rich, and produced on an
+> industrial scale.
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage[definitionLists, tightLists]{markdown}
+\begin{document}
+
+\begin{markdown*}{
+ renderers = {
+ interblockSeparator = {%
+ :%
+ \def\markdownRendererInterblockSeparator{\par}%
+ },
+ dlBeginTight = {\begin{description}},
+ dlItem = {%
+ \item[#1]
+ \begin{itemize}
+ \def\markdownRendererDlDefinitionEnd{%
+ ,
+ \def\markdownRendererDlDefinitionEnd{%
+ , and
+ \def\markdownRendererDlDefinitionEnd{.}%
+ }%
+ }%
+ },
+ dlItemEnd = {\end{itemize}},
+ dlDefinitionBegin = \item,
+ dlEndTight = {\end{description}},
+ },
+}
+This is a tight definition list
+
+Coffee
+: black hot drink
+: prepared from roasted coffee beans
+: one of the most traded agricultural commodities in the world
+
+Milk
+: white cold drink
+: nutrient-rich
+: produced on an industrial scale
+\end{markdown*}
+
+\begin{markdown*}{
+ renderers = {
+ interblockSeparator = {%
+ \def\markdownRendererInterblockSeparator{\par}%
+ },
+ dlBegin = {},
+ dlItem = {%
+ . #1 is a
+ \def\markdownRendererDlDefinitionBegin{%
+ \def\markdownRendererDlDefinitionBegin{%
+ ,
+ \def\markdownRendererDlDefinitionBegin{, and }%
+ }%
+ }%
+ },
+ dlItemEnd = {},
+ dlDefinitionEnd = {},
+ dlEnd = {.},
+ },
+}
+This is a loose definition list
+
+Coffee
+
+: black hot drink
+
+: prepared from roasted coffee beans
+
+: one of the most traded agricultural commodities in the world
+
+Milk
+
+: white cold drink
+
+: nutrient-rich
+
+: produced on an industrial scale
+\end{markdown*}
+
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is a tight definition list:
+>
+> **Coffee**
+>
+> - black hot drink,
+> - prepared from roasted coffee beans, and
+> - one of the most traded agricultural commodities in the world.
+>
+> **Milk**
+>
+> - white cold drink,
+> - nutrient-rich, and
+> - produced on an industrial scale.
+>
+> This is a loose definition list. Coffee is a black hot drink, prepared from
+> roasted coffee beans, and one of the most traded agricultural commodities in
+> the world. Milk is a white cold drink, nutrient-rich, and produced on an
+> industrial scale.
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownOptionDefinitionLists{true}
+\def\markdownOptionTightLists{true}
+\starttext
+
+\def\markdownRendererInterblockSeparator{%
+ :%
+ \def\markdownRendererInterblockSeparator{\par}%
+}
+\def\markdownRendererDlBeginTight{}
+\def\markdownRendererDlItem#1{%
+ \par{\bf#1}%
+ \startitemize
+ \def\markdownRendererDlDefinitionEnd{%
+ ,
+ \def\markdownRendererDlDefinitionEnd{%
+ , and
+ \def\markdownRendererDlDefinitionEnd{.}%
+ }%
+ }%
+}
+\def\markdownRendererDlItemEnd{\stopitemize}
+\def\markdownRendererDlDefinitionBegin{\item}
+\def\markdownRendererDlEndTight{}
+
+\startmarkdown
+This is a tight definition list
+
+Coffee
+: black hot drink
+: prepared from roasted coffee beans
+: one of the most traded agricultural commodities in the world
+
+Milk
+: white cold drink
+: nutrient-rich
+: produced on an industrial scale
+\stopmarkdown
+
+\def\markdownRendererInterblockSeparator{%
+ \def\markdownRendererInterblockSeparator{\par}%
+}
+\def\markdownRendererDlBegin{}
+\def\markdownRendererDlItem#1{%
+ . #1 is a
+ \def\markdownRendererDlDefinitionBegin{%
+ \def\markdownRendererDlDefinitionBegin{%
+ ,
+ \def\markdownRendererDlDefinitionBegin{, and }%
+ }%
+ }%
+}
+\def\markdownRendererDlItemEnd{}
+\def\markdownRendererDlDefinitionEnd{}
+\def\markdownRendererDlEnd{.}
+
+\startmarkdown
+This is a loose definition list
+
+Coffee
+
+: black hot drink
+
+: prepared from roasted coffee beans
+
+: one of the most traded agricultural commodities in the world
+
+Milk
+
+: white cold drink
+
+: nutrient-rich
+
+: produced on an industrial scale
+\stopmarkdown
+
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is a tight definition list:
+>
+> **Coffee**
+>
+> - black hot drink,
+> - prepared from roasted coffee beans, and
+> - one of the most traded agricultural commodities in the world.
+>
+> **Milk**
+>
+> - white cold drink,
+> - nutrient-rich, and
+> - produced on an industrial scale.
+>
+> This is a loose definition list. Coffee is a black hot drink, prepared from
+> roasted coffee beans, and one of the most traded agricultural commodities in
+> the world. Milk is a white cold drink, nutrient-rich, and produced on an
+> industrial scale.
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererDlEndTight{%
\markdownRendererDlEndTightPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Emphasis Renderers
-% The \mdef{markdownRendererEmphasis} macro represents an emphasized span of
-% text. The macro receives a single argument that corresponds to the emphasized
-% span of text.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Emphasis Renderers
+The \mdef{markdownRendererEmphasis} macro represents an emphasized span of
+text. The macro receives a single argument that corresponds to the emphasized
+span of text.
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownRendererEmphasis#1{{\it#1}}
+\def\markdownRendererStrongEmphasis#1{{\bf#1}}
+\markdownBegin
+This is *emphasis*.
+
+This is **strong emphasis**.
+\markdownEnd
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is *emphasis*.
+>
+> This is **strong emphasis**.
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage{markdown}
+\markdownSetup{
+ renderers = {
+ emphasis = {\emph{#1}},
+ strongEmphasis = {\textbf{#1}},
+ },
+}
+\begin{document}
+\begin{markdown}
+This is *emphasis*.
+
+This is **strong emphasis**.
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is *emphasis*.
+>
+> This is **strong emphasis**.
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownRendererEmphasis#1{\emph{#1}}
+\def\markdownRendererStrongEmphasis#1{\bold{#1}}
+\starttext
+\startmarkdown
+This is *emphasis*.
+
+This is **strong emphasis**.
+\stopmarkdown
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is *emphasis*.
+>
+> This is **strong emphasis**.
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererEmphasis{%
\markdownRendererEmphasisPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererStrongEmphasis} macro represents a strongly
-% emphasized span of text. The macro receives a single argument that
-% corresponds to the emphasized span of text.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererStrongEmphasis} macro represents a strongly
+emphasized span of text. The macro receives a single argument that
+corresponds to the emphasized span of text.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererStrongEmphasis{%
\markdownRendererStrongEmphasisPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Block Quote Renderers
-% The \mdef{markdownRendererBlockQuoteBegin} macro represents the beginning of
-% a block quote. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Block Quote Renderers
+The \mdef{markdownRendererBlockQuoteBegin} macro represents the beginning of
+a block quote. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownRendererBlockQuoteBegin{%
+ \begingroup
+ \vskip\parindent
+ \leftskip=2\parindent
+ \parindent=0pt
+}
+\def\markdownRendererBlockQuoteEnd{%
+ \par
+ \vskip\parindent
+ \endgroup
+}
+\markdownBegin
+A quote from William Shakespeare's King Lear:
+
+> This is the excellent foppery of the world that when we are
+> sick in fortune---often the surfeit of our own behavior---we
+> make guilty of our disasters the sun, the moon, and the
+> stars [...]
+\markdownEnd
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> A quote from William Shakespeare's King Lear:
+>
+> > This is the excellent foppery of the world that when we are
+> > sick in fortune—often the surfeit of our own behavior—we
+> > make guilty of our disasters the sun, the moon, and the
+> > stars [...]
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage{markdown}
+\markdownSetup{
+ renderers = {
+ blockQuoteBegin = {\begin{quote}},
+ blockQuoteEnd = {\end{quote}},
+ },
+}
+\begin{document}
+\begin{markdown}
+A quote from William Shakespeare's King Lear:
+
+> This is the excellent foppery of the world that when we are
+> sick in fortune---often the surfeit of our own behavior---we
+> make guilty of our disasters the sun, the moon, and the
+> stars [...]
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> A quote from William Shakespeare's King Lear:
+>
+> > This is the excellent foppery of the world that when we are
+> > sick in fortune—often the surfeit of our own behavior—we
+> > make guilty of our disasters the sun, the moon, and the
+> > stars [...]
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownRendererBlockQuoteBegin{\startquotation}
+\def\markdownRendererBlockQuoteEnd{\stopquotation}
+\starttext
+\startmarkdown
+A quote from William Shakespeare's King Lear:
+
+> This is the excellent foppery of the world that when we are
+> sick in fortune---often the surfeit of our own behavior---we
+> make guilty of our disasters the sun, the moon, and the
+> stars [...]
+\stopmarkdown
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> A quote from William Shakespeare's King Lear:
+>
+> > This is the excellent foppery of the world that when we are
+> > sick in fortune—often the surfeit of our own behavior—we
+> > make guilty of our disasters the sun, the moon, and the
+> > stars [...]
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererBlockQuoteBegin{%
\markdownRendererBlockQuoteBeginPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererBlockQuoteEnd} macro represents the end of a block
-% quote. The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererBlockQuoteEnd} macro represents the end of a block
+quote. The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererBlockQuoteEnd{%
\markdownRendererBlockQuoteEndPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### 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.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### 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.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererInputVerbatim{%
\markdownRendererInputVerbatimPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererInputFencedCode} macro represents a fenced code
-% block. This macro will only be produced, when the \Opt{fencedCode} option is
-% `true`. The macro receives two arguments that correspond to the filename of
-% a file contaning the code block contents and to the code fence infostring.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererInputFencedCode} macro represents a fenced code
+block. This macro will only be produced, when the \Opt{fencedCode} option is
+`true`. The macro receives two arguments that correspond to the filename of
+a file contaning the code block contents and to the code fence infostring.
+
% \end{markdown}
+%
+% \iffalse
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage{verbatim}
+\usepackage[hyphens]{url}
+\usepackage[fencedCode]{markdown}
+\markdownSetup{
+ renderers = {
+ interblockSeparator = {
+ \def\markdownRendererInterblockSeparator{%
+ \par
+ \def\markdownRendererInterblockSeparator{%
+ \def\markdownRendererInterblockSeparator{%
+ \par
+ }%
+ }%
+ }%
+ },
+ inputVerbatim = {
+ is contained in file \url{#1}:%
+ \verbatiminput{#1}%
+ },
+ inputFencedCode = {
+ in #2 \markdownRendererInputVerbatim{#1}%
+ },
+ },
+}
+\begin{document}
+\begin{markdown}
+The following code
+
+ def foo(bar):
+ if len(bar) <= 1:
+ return bar[0]
+ elif len(bar) == 2:
+ return sorted(bar)
+ else:
+ baz = len(bar) // 2
+ return foo(bar[baz:], bar[:baz])
+
+The following code
+
+~~~ Python
+>>> foo([4, 2, 1, 3])
+[1, 2, 3, 4]
+~~~~~~~~~~
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text except for the filename, which may differ:
+
+> The following code is contained in file
+> `./_markdown_document/882453149edcf288976647f6fe147ada.verbatim`:
+> ``` py
+> def foo(bar):
+> if len(bar) <= 1:
+> return bar[:1]
+> elif len(bar) == 2:
+> return sorted(bar)
+> else:
+> baz = bar[len(bar) // 2]
+> return (
+> foo([qux for qux in bar if qux < baz]) + [baz] +
+> foo([qux for qux in bar if qux > baz])
+> )
+> ``````
+> The following code in Python contained in file
+> `./_markdown_document/cf2a96e2120cef5b1fae5fea36fcc27b.verbatim`:
+> ``` py
+> >>> foo([4, 2, 1, 3])
+> [1, 2, 3, 4]
+> ``````
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererInputFencedCode{%
\markdownRendererInputFencedCodePrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Heading Renderers
-% The \mdef{markdownRendererHeadingOne} macro represents a first level heading.
-% The macro receives a single argument that corresponds to the heading text.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Heading Renderers
+The \mdef{markdownRendererHeadingOne} macro represents a first level heading.
+The macro receives a single argument that corresponds to the heading text.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererHeadingOne{%
\markdownRendererHeadingOnePrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererHeadingTwo} macro represents a second level
-% heading. The macro receives a single argument that corresponds to the heading
-% text.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererHeadingTwo} macro represents a second level
+heading. The macro receives a single argument that corresponds to the heading
+text.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererHeadingTwo{%
\markdownRendererHeadingTwoPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererHeadingThree} macro represents a third level
-% heading. The macro receives a single argument that corresponds to the heading
-% text.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererHeadingThree} macro represents a third level
+heading. The macro receives a single argument that corresponds to the heading
+text.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererHeadingThree{%
\markdownRendererHeadingThreePrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererHeadingFour} macro represents a fourth level
-% heading. The macro receives a single argument that corresponds to the heading
-% text.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererHeadingFour} macro represents a fourth level
+heading. The macro receives a single argument that corresponds to the heading
+text.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererHeadingFour{%
\markdownRendererHeadingFourPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererHeadingFive} macro represents a fifth level
-% heading. The macro receives a single argument that corresponds to the heading
-% text.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererHeadingFive} macro represents a fifth level
+heading. The macro receives a single argument that corresponds to the heading
+text.
+
% \end{markdown}
+%
+% \iffalse
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererHeadingFive{%
\markdownRendererHeadingFivePrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-% The \mdef{markdownRendererHeadingSix} macro represents a sixth level
-% heading. The macro receives a single argument that corresponds to the heading
-% text.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+The \mdef{markdownRendererHeadingSix} macro represents a sixth level
+heading. The macro receives a single argument that corresponds to the heading
+text.
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownRendererInterblockSeparator{}
+\def\markdownRendererHeadingOne{1}
+\def\markdownRendererHeadingTwo{2}
+\def\markdownRendererHeadingThree{3}
+\def\markdownRendererHeadingFour{4}
+\def\markdownRendererHeadingFive{5}
+\def\markdownRendererHeadingSix{6}
+\markdownBegin
+######
+#####
+#####
+###
+######
+\markdownEnd
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> 65536
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage{markdown}
+\markdownSetup{
+ renderers = {
+ interblockSeparator = {},
+ headingOne = 1,
+ headingTwo = 2,
+ headingThree = 3,
+ headingFour = 4,
+ headingFive = 5,
+ headingSix = 6,
+ },
+}
+\begin{document}
+\begin{markdown}
+######
+#####
+#####
+###
+######
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> 65536
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownRendererInterblockSeparator{}
+\def\markdownRendererHeadingOne{1}
+\def\markdownRendererHeadingTwo{2}
+\def\markdownRendererHeadingThree{3}
+\def\markdownRendererHeadingFour{4}
+\def\markdownRendererHeadingFive{5}
+\def\markdownRendererHeadingSix{6}
+\starttext
+\startmarkdown
+######
+#####
+#####
+###
+######
+\stopmarkdown
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> 65536
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererHeadingSix{%
\markdownRendererHeadingSixPrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Horizontal Rule Renderer
-% The \mdef{markdownRendererHorizontalRule} macro represents a horizontal rule.
-% The macro receives no arguments.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Horizontal Rule Renderer
+The \mdef{markdownRendererHorizontalRule} macro represents a horizontal rule.
+The macro receives no arguments.
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownRendererHorizontalRule{\vfil\break}
+\markdownBegin
+This is the first page.
+
+***
+
+This is the second page.
+\markdownEnd
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is the first page.
+>
+> ***
+>
+> This is the second page.
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage{markdown}
+\markdownSetup{
+ renderers = {
+ horizontalRule = \newpage,
+ },
+}
+\begin{document}
+\begin{markdown}
+This is the first page.
+
+***
+
+This is the second page.
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is the first page.
+>
+> ***
+>
+> This is the second page.
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownRendererHorizontalRule{\page[yes]}
+\starttext
+\startmarkdown
+This is the first page.
+
+***
+
+This is the second page.
+\stopmarkdown
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is the first page.
+>
+> ***
+>
+> This is the second page.
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererHorizontalRule{%
\markdownRendererHorizontalRulePrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Footnote Renderer
-% The \mdef{markdownRendererFootnote} macro represents a footnote. This macro
-% will only be produced, when the \Opt{footnotes} option is `true`. The
-% macro receives a single argument that corresponds to the footnote text.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Footnote Renderer
+The \mdef{markdownRendererFootnote} macro represents a footnote. This macro
+will only be produced, when the \Opt{footnotes} option is `true`. The
+macro receives a single argument that corresponds to the footnote text.
+
% \end{markdown}
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownOptionFootnotes{true}
+\def\markdownRendererFootnote#1{ (and \lowercase{#1})}
+\markdownBegin
+This is some text[^1] and this is some other text[^2].
+
+ [^1]: this is a footnote
+
+ [^2]: this is some other footnote
+\markdownEnd
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is some text (and this is a footnote) and this is some other
+> text (and this is some other footnote).
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage[footnotes]{markdown}
+\markdownSetup{
+ renderers = {
+ footnote = { (and \MakeLowercase{#1})},
+ },
+}
+\begin{document}
+\begin{markdown}
+This is some text[^1] and this is some other text[^2].
+
+ [^1]: this is a footnote
+
+ [^2]: this is some other footnote
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is some text (and this is a footnote) and this is some other
+> text (and this is some other footnote).
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownOptionFootnotes{true}
+\def\markdownRendererFootnote#1{ (and \lowercase{#1})}
+\starttext
+\startmarkdown
+This is some text[^1] and this is some other text[^2].
+
+ [^1]: this is a footnote
+
+ [^2]: this is some other footnote
+\stopmarkdown
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is some text (and this is a footnote) and this is some other
+> text (and this is some other footnote).
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererFootnote{%
\markdownRendererFootnotePrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Parenthesized Citations Renderer
-% The \mdef{markdownRendererCite} macro represents a string of one or more
-% parenthetical citations. This macro will only be produced, when the
-% \Opt{citations} option is `true`. The macro receives the parameter
-% `{`\meta{number of citations}`}` followed by \meta{suppress
-% author}`{`\meta{prenote}`}{`\meta{postnote}`}{`\meta{name}`}` repeated
-% \meta{number of citations} times. The \meta{suppress author} parameter is
-% either the token `-`, when the author's name is to be suppressed, or `+`
-% otherwise.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Parenthesized Citations Renderer
+The \mdef{markdownRendererCite} macro represents a string of one or more
+parenthetical citations. This macro will only be produced, when the
+\Opt{citations} option is `true`. The macro receives the parameter
+`{`\meta{number of citations}`}` followed by \meta{suppress
+author}`{`\meta{prenote}`}{`\meta{postnote}`}{`\meta{name}`}` repeated
+\meta{number of citations} times. The \meta{suppress author} parameter is
+either the token `-`, when the author's name is to be suppressed, or `+`
+otherwise.
+
% \end{markdown}
+%
+% \iffalse
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage[citations]{markdown}
+\newcount\citationsCounter
+\newcount\citationsTotal
+\makeatletter
+\def\citations#1#2#3#4{%
+ a parenthesized citation \emph{#4}
+ \advance\citationsCounter by 1\relax
+ \ifx\relax#2\relax
+ \ifx\relax#3\relax\else
+ with a postfix \emph{#3}%
+ \fi
+ \else
+ with a prefix \emph{#2}%
+ \ifx\relax#3\relax\else
+ \ and a postfix \emph{#3}%
+ \fi
+ \fi
+ \ifnum\citationsCounter>\citationsTotal\relax
+ .%
+ \expandafter\@gobble
+ \else
+ , and
+ \fi\citations}
+\makeatother
+\markdownSetup{
+ renderers = {
+ cite = {%
+ \citationsCounter=1%
+ \citationsTotal=#1%
+ This is
+ \expandafter\citations
+ },
+ },
+}
+\begin{document}
+\begin{markdown}
+[see @abrahams90, pp. 12; @eijkhout91, pp. 34]
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is a parenthesized citation *abrahams90* with a prefix see
+> and a postfix *pp. > 12*, and a citation *eijkhout91* with a
+> postfix *pp. 34*.
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererCite{%
\markdownRendererCitePrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%#### Text Citations Renderer
-% The \mdef{markdownRendererTextCite} macro represents a string of one or more
-% text citations. This macro will only be produced, when the
-% \Opt{citations} option is `true`. The macro receives parameters in the same
-% format as the \m{markdownRendererCite} macro.
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
%
+% \begin{markdown}
+
+#### Text Citations Renderer
+The \mdef{markdownRendererTextCite} macro represents a string of one or more
+text citations. This macro will only be produced, when the
+\Opt{citations} option is `true`. The macro receives parameters in the same
+format as the \m{markdownRendererCite} macro.
+
% \end{markdown}
+%
+% \iffalse
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage[citations]{markdown}
+\newcount\citationsCounter
+\newcount\citationsTotal
+\makeatletter
+\def\citations#1#2#3#4{%
+ a text citation \emph{#4}
+ \advance\citationsCounter by 1\relax
+ \ifx\relax#2\relax
+ \ifx\relax#3\relax\else
+ with a postfix \emph{#3}%
+ \fi
+ \else
+ with a prefix \emph{#2}%
+ \ifx\relax#3\relax\else
+ \ and a postfix \emph{#3}%
+ \fi
+ \fi
+ \ifnum\citationsCounter>\citationsTotal\relax
+ .%
+ \expandafter\@gobble
+ \else
+ , and
+ \fi\citations}
+\makeatother
+\markdownSetup{
+ renderers = {
+ textCite = {%
+ \citationsCounter=1%
+ \citationsTotal=#1%
+ This is
+ \expandafter\citations
+ },
+ },
+}
+\begin{document}
+\begin{markdown}
+@abrahams90 [pp. 12; also @eijkhout91]
+\end{markdown}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> This is a text citation *abrahams90* with a postfix *pp. 12*,
+> and a citation *eijkhout91* with a prefix *also*.
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
% \begin{macrocode}
\def\markdownRendererTextCite{%
\markdownRendererTextCitePrototype}%
% \end{macrocode}
% \par
-% \begin{markdown}
%
-%### Token Renderer Prototypes
+% \iffalse
+%</tex>
+%<*manual-tokens>
+% \fi
+%
+% \begin{markdown}
+
+### Token Renderer Prototypes
+
% \label{sec:texrendererprototypes}
+%
+% \end{markdown}
+% \iffalse
+
+By default, token renderers point to package-defined \TeX{} macros, further
+referred to as *prototypes*, which provide useful default definitions.
+
+% \fi
+%
+% \iffalse
+
+##### Plain \TeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\input markdown
+\def\markdownRendererTildePrototype{%
+ Packages can specify token renderer prototypes.%
+}
+\markdownBegin
+~
+\markdownEnd
+
+\def\markdownRendererTilde{%
+ User-defined token renderers take precedence.%
+}
+\markdownBegin
+~
+\markdownEnd
+\bye
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+luatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Packages can specify token renderer prototypes.
+>
+> User-defined token renderers take precedence.
+
+##### \LaTeX{} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage{markdown}
+\markdownSetup{
+ rendererPrototypes = {
+ tilde = {Packages can specify token renderer prototypes.},
+ },
+}
+\begin{document}
+\begin{markdown}
+~
+\end{markdown}
+
+\begin{markdown*}{
+ renderers = {
+ tilde = {User-defined token renderers take precedence.},
+ },
+}
+~
+\end{markdown*}
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Packages can specify token renderer prototypes.
+>
+> User-defined token renderers take precedence.
+
+##### \Hologo{ConTeXt} Example {.unnumbered}
+
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\def\markdownRendererTildePrototype{%
+ Packages can specify token renderer prototypes.%
+}
+\starttext
+\startmarkdown
+~
+\stopmarkdown
+
+\def\markdownRendererTilde{%
+ User-defined token renderers take precedence.%
+}
+\startmarkdown
+~
+\stopmarkdown
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> Packages can specify token renderer prototypes.
+>
+> User-defined token renderers take precedence.
+
+%</manual-tokens>
+%<*tex>
+% \fi
+%
+% \begin{markdown}
+%
% The following \TeX{} macros provide definitions for the token renderers (see
% Section \ref{sec:texrenderersuser}) that have not been redefined by the
% user. These macros are intended to be redefined by macro package authors
@@ -5934,12 +9457,11 @@ typeset.
% \end{macrocode}
% \par
% \begin{markdown}
-%
+%
%### Logging Facilities
-% The \mdef{markdownInfo}, \mdef{markdownWarning}, and
-% \mdef{markdownError} macros provide access to logging to the rest of
-% the macros. Their first argument specifies the text of the info, warning, or
-% error message.
+% The \mdef{markdownInfo}, \mdef{markdownWarning}, and \mdef{markdownError}
+% macros perform logging for the Markdown package. Their first argument
+% specifies the text of the info, warning, or error message.
%
% \end{markdown}
% \begin{macrocode}
@@ -5950,7 +9472,7 @@ typeset.
% \begin{markdown}
%
% The \m{markdownError} macro receives a second argument that provides a help
-% text suggesting a remedy to the error.
+% text.
%
% \end{markdown}
% \begin{macrocode}
@@ -6013,11 +9535,11 @@ typeset.
% The \mdef{markdownMode} macro specifies how the plain \TeX{} implementation
% interfaces with the Lua interface. The valid values and their meaning are
% as follows:
-% \begin{itemize}
-% \item`0` -- Shell escape via the 18 output file stream
-% \item`1` -- Shell escape via the Lua \luam{os.execute} method
-% \item`2` -- Direct Lua access
-% \end{itemize}
+%
+% - `0` – Shell escape via the 18 output file stream
+% - `1` – Shell escape via the Lua \luam{os.execute} method
+% - `2` – Direct Lua access
+%
% By defining the macro, the user can coerce the package to use a specific mode.
% If the user does not define the macro prior to loading the plain \TeX{}
% implementation, the correct value will be automatically detected. The outcome
@@ -6047,7 +9569,6 @@ typeset.
% \end{macrocode}
% \iffalse
%</tex>
-%<*latex>
% \fi
% \par
% \begin{markdown}
@@ -6056,25 +9577,59 @@ typeset.
%-------------------
% \label{sec:latexinterface}
%
+% \end{markdown}
% \iffalse
-%</latex>
-%<*manual>
+%<*manual-interfaces>
+
+### \LaTeX{}
-LaTeX
------
+The \LaTeX{} interface provides the same level of functionality as the plain
+\TeX{} interface by using the plain \TeX{} interface behind the scenes. Unlike
+the plain \TeX{} interface, the \LaTeX{} interface uses familiar \LaTeX{}
+idioms, such as package options and environments.
-The LaTeX macro package provides additional syntactic sugar on top of the plain
-TeX macro package and provides sane default definitions of the token renderers.
+The \LaTeX{} interface accepts the same options as the plain \TeX{} interface,
+but now the options are specified as \meta{key}${}={}$\meta{value} pairs and
+they are passed either as package options, in the \m{markdownSetup} command, or
+as parameters for the \envm{markdown*} \LaTeX{} environment.
-<!-- TODO -->
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\documentclass{article}
+\usepackage{markdown}
+\begin{document}
-### Interfaces
+\begin{markdown}
+$\sqrt{-1}$ *equals* $i$
+\end{markdown}
-<!-- TODO -->
+\begin{markdown*}{hybrid}
+$\sqrt{-1}$ *equals* $i$
+\end{markdown*}
-%</manual>
+\end{document}
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+lualatex document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
+
+> \$\\sqrt{-1}\$ *equals* \$i\$.
+>
+> √-̅1̅ *equals* $i$.
+
+Invoking pdfTeX should have the same effect:
+``` sh
+pdflatex --shell-escape document.tex
+``````
+
+%</manual-interfaces>
%<*latex>
% \fi
+% \begin{markdown}
%
% The \LaTeX{} interface provides \LaTeX{} environments for the typesetting of
% markdown input from within \LaTeX{}, facilities for setting Lua interface
@@ -6086,7 +9641,7 @@ TeX macro package and provides sane default definitions of the token renderers.
% The \LaTeX{} interface is implemented by the `markdown.sty` file, which
% can be loaded from the \LaTeX{} document preamble as follows:
% \end{markdown}
-% \begin{Verbatim}[commandchars=\\\{\}]
+% \begin{Verbatim}[commandchars=\\\{\},gobble=2]
% \textbackslash{}usepackage[\textrm{\meta{options}}]\{markdown\}
% \end{Verbatim}
% \begin{markdown}
@@ -6164,18 +9719,6 @@ TeX macro package and provides sane default definitions of the token renderers.
%### Options
% \label{sec:latexoptions}
%
-% \iffalse
-%</latex>
-%<*manual>
-
-### Options
-
-<!-- TODO -->
-
-%</manual>
-%<*latex>
-% \fi
-%
% The \LaTeX{} options are represented by a comma-delimited list of
% \meta{key}`=`\meta{value} pairs. For boolean options, the `=`\meta{value}
% part is optional, and \meta{key} will be interpreted as \meta{key}`=true`.
@@ -6242,6 +9785,8 @@ TeX macro package and provides sane default definitions of the token renderers.
\def\markdownOptionFencedCode{#1}}%
\define@key{markdownOptions}{hashEnumerators}[true]{%
\def\markdownOptionHashEnumerators{#1}}%
+\define@key{markdownOptions}{headerAttributes}[true]{%
+ \def\markdownOptionHeaderAttributes{#1}}%
\define@key{markdownOptions}{html}[true]{%
\def\markdownOptionHtml{#1}}%
\define@key{markdownOptions}{hybrid}[true]{%
@@ -6252,6 +9797,8 @@ TeX macro package and provides sane default definitions of the token renderers.
\def\markdownOptionPreserveTabs{#1}}%
\define@key{markdownOptions}{smartEllipses}[true]{%
\def\markdownOptionSmartEllipses{#1}}%
+\define@key{markdownOptions}{slice}[true]{%
+ \def\markdownOptionSlice{#1}}%
\define@key{markdownOptions}{startNumber}[true]{%
\def\markdownOptionStartNumber{#1}}%
\define@key{markdownOptions}{tightLists}[true]{%
@@ -6278,18 +9825,6 @@ TeX macro package and provides sane default definitions of the token renderers.
%#### Plain \TeX{} Markdown Token Renderers
% \label{sec:latexrenderers}
%
-% \iffalse
-%</latex>
-%<*manual>
-
-### Token renderers
-
-<!-- TODO -->
-
-%</manual>
-%<*latex>
-% \fi
-%
% The \LaTeX{} interface recognizes an option with the `renderers` key,
% whose value must be a list of options that map directly to the markdown token
% renderer macros exposed by the plain \TeX{} interface (see Section
@@ -6580,28 +10115,52 @@ TeX macro package and provides sane default definitions of the token renderers.
%
% \iffalse
%</context>
-%<*manual>
+%<*manual-interfaces>
-ConTeXt
--------
+### \Hologo{ConTeXt}
-The ConTeXt macro package provides additional syntactic sugar on top of the
-plain TeX macro package and provides sane default definitions of the token
-renderers.
+The \Hologo{ConTeXt} interface provides the same level of functionality as the
+plain \TeX{} interface by using the plain \TeX{} interface behind the scenes.
+Unlike the plain \TeX{} interface, the \Hologo{ConTeXt} interface uses familiar
+\Hologo{ConTeXt} idioms, such as environments.
-### Interfaces
+The \Hologo{ConTeXt} interface accepts the same options as the plain \TeX{}
+interface.
-<!-- TODO -->
+Using a text editor, create a text document named `document.tex` with the
+following content:
+``` tex
+\usemodule[t][markdown]
+\starttext
-### Options
+\startmarkdown
+$\sqrt{-1}$ *equals* $i$.
+\stopmarkdown
-<!-- TODO -->
+\def\markdownOptionHybrid{true}
+\startmarkdown
+$\sqrt{-1}$ *equals* $i$.
+\stopmarkdown
-### Token renderers
+\stoptext
+```````
+Next, invoke LuaTeX from the terminal:
+``` sh
+context document.tex
+``````
+A PDF document named `document.pdf` should be produced and contain the
+following text:
-<!-- TODO -->
+> \$\\sqrt{-1}\$ *equals* \$i\$.
+>
+> √-̅1̅ *equals* $i$.
+
+Invoking pdfTeX should have the same effect:
+``` sh
+texexec --passon=--shell-escape document.tex
+``````
-%</manual>
+%</manual-interfaces>
%<*context>
% \fi
%
@@ -7345,6 +10904,40 @@ function M.writer.new(options)
% \par
% \begin{markdown}
%
+% Parse the \Opt{slice} option and define \luamdef{writer->slice\_begin}
+% \luamdef{writer->slice\_end}, and \luamdef{writer->is\_writing}.
+%
+% \end{markdown}
+% \begin{macrocode}
+ local slice_specifiers = {}
+ for specifier in options.slice:gmatch("[^%s]+") do
+ table.insert(slice_specifiers, specifier)
+ end
+
+ if #slice_specifiers == 2 then
+ self.slice_begin, self.slice_end = table.unpack(slice_specifiers)
+ local slice_begin_type = self.slice_begin:sub(1, 1)
+ if slice_begin_type ~= "^" and slice_begin_type ~= "$" then
+ self.slice_begin = "^" .. self.slice_begin
+ end
+ local slice_end_type = self.slice_end:sub(1, 1)
+ if slice_end_type ~= "^" and slice_end_type ~= "$" then
+ self.slice_end = "$" .. self.slice_end
+ end
+ elseif #slice_specifiers == 1 then
+ self.slice_begin = "^" .. slice_specifiers[1]
+ self.slice_end = "$" .. slice_specifiers[1]
+ end
+
+ if self.slice_begin == "^" and self.slice_end ~= "^" then
+ self.is_writing = true
+ else
+ self.is_writing = false
+ end
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
% Define \luamdef{writer->suffix} as the suffix of the produced cache files.
%
% \end{markdown}
@@ -7391,6 +10984,7 @@ function M.writer.new(options)
% \end{markdown}
% \begin{macrocode}
function self.paragraph(s)
+ if not self.is_writing then return "" end
return s
end
% \end{macrocode}
@@ -7404,7 +10998,7 @@ function M.writer.new(options)
% \end{markdown}
% \begin{macrocode}
function self.pack(name)
- return [[\input"]] .. name .. [["\relax{}]]
+ return [[\input ]] .. name .. [[\relax{}]]
end
% \end{macrocode}
% \par
@@ -7415,7 +11009,10 @@ function M.writer.new(options)
%
% \end{markdown}
% \begin{macrocode}
- self.interblocksep = "\\markdownRendererInterblockSeparator\n{}"
+ function self.interblocksep()
+ if not self.is_writing then return "" end
+ return "\\markdownRendererInterblockSeparator\n{}"
+ end
% \end{macrocode}
% \par
% \begin{markdown}
@@ -7451,7 +11048,10 @@ function M.writer.new(options)
%
% \end{markdown}
% \begin{macrocode}
- self.hrule = "\\markdownRendererHorizontalRule{}"
+ function self.hrule()
+ if not self.is_writing then return "" end
+ return "\\markdownRendererHorizontalRule{}"
+ end
% \end{macrocode}
% \par
% \begin{markdown}
@@ -7586,29 +11186,29 @@ function M.writer.new(options)
%
% \end{markdown}
% \begin{macrocode}
-local languages_json = (function()
- local kpse = require("kpse")
- kpse.set_program_name("luatex")
- local base, prev, curr
- for _, file in ipairs{kpse.lookup(options.contentBlocksLanguageMap,
- { all=true })} do
- json = io.open(file, "r"):read("*all")
- :gsub('("[^\n]-"):','[%1]=')
- curr = (function()
- local _ENV={ json=json, load=load } -- run in sandbox
- return load("return "..json)()
- end)()
- if type(curr) == "table" then
- if base == nil then
- base = curr
- else
- setmetatable(prev, { __index = curr })
+ local languages_json = (function()
+ local kpse = require("kpse")
+ kpse.set_program_name("luatex")
+ local base, prev, curr
+ for _, file in ipairs{kpse.lookup(options.contentBlocksLanguageMap,
+ { all=true })} do
+ json = io.open(file, "r"):read("*all")
+ :gsub('("[^\n]-"):','[%1]=')
+ curr = (function()
+ local _ENV={ json=json, load=load } -- run in sandbox
+ return load("return "..json)()
+ end)()
+ if type(curr) == "table" then
+ if base == nil then
+ base = curr
+ else
+ setmetatable(prev, { __index = curr })
+ end
+ prev = curr
end
- prev = curr
end
- end
- return base or {}
-end)()
+ return base or {}
+ end)()
% \end{macrocode}
% \par
% \begin{markdown}
@@ -7622,6 +11222,7 @@ end)()
% \end{markdown}
% \begin{macrocode}
function self.contentblock(src,suf,type,tit)
+ if not self.is_writing then return "" end
src = src.."."..suf
suf = suf:lower()
if type == "onlineimage" then
@@ -7658,6 +11259,7 @@ end)()
end
function self.bulletlist(items,tight)
+ if not self.is_writing then return "" end
local buffer = {}
for _,item in ipairs(items) do
buffer[#buffer + 1] = ulitem(item)
@@ -7694,6 +11296,7 @@ end)()
end
function self.orderedlist(items,tight,startnum)
+ if not self.is_writing then return "" end
local buffer = {}
local num = startnum
for _,item in ipairs(items) do
@@ -7747,6 +11350,7 @@ end)()
end
function self.definitionlist(items,tight)
+ if not self.is_writing then return "" end
local buffer = {}
for _,item in ipairs(items) do
buffer[#buffer + 1] = dlitem(item.term, item.definitions)
@@ -7793,6 +11397,7 @@ end)()
% \end{markdown}
% \begin{macrocode}
function self.blockquote(s)
+ if #util.rope_to_string(s) == 0 then return "" end
return {"\\markdownRendererBlockQuoteBegin\n",s,
"\n\\markdownRendererBlockQuoteEnd "}
end
@@ -7806,6 +11411,7 @@ end)()
% \end{markdown}
% \begin{macrocode}
function self.verbatim(s)
+ if not self.is_writing then return "" end
local name = util.cache(options.cacheDir, s, nil, nil, ".verbatim")
return {"\\markdownRendererInputVerbatim{",name,"}"}
end
@@ -7820,6 +11426,7 @@ end)()
% \end{markdown}
% \begin{macrocode}
function self.fencedCode(i, s)
+ if not self.is_writing then return "" end
local name = util.cache(options.cacheDir, s, nil, nil, ".verbatim")
return {"\\markdownRendererInputFencedCode{",name,"}{",i,"}"}
end
@@ -7827,12 +11434,67 @@ end)()
% \par
% \begin{markdown}
%
+% Define \luamdef{writer->active_headings} as a stack of identifiers
+% of the headings that are currently active.
+%
+% \end{markdown}
+% \begin{macrocode}
+ self.active_headings = {}
+% \end{macrocode}
+% \par
+% \begin{markdown}
+%
% Define \luamdef{writer->heading} as a function that will transform an
-% input heading `s` at level `level` to the output format.
+% input heading `s` at level `level` with identifiers `identifiers` to the
+% output format.
%
% \end{markdown}
% \begin{macrocode}
- function self.heading(s,level)
+ function self.heading(s,level,attributes)
+ local active_headings = self.active_headings
+ local slice_begin_type = self.slice_begin:sub(1, 1)
+ local slice_begin_identifier = self.slice_begin:sub(2) or ""
+ local slice_end_type = self.slice_end:sub(1, 1)
+ local slice_end_identifier = self.slice_end:sub(2) or ""
+
+ while #active_headings < level do
+ -- push empty identifiers for implied sections
+ table.insert(active_headings, {})
+ end
+
+ while #active_headings >= level do
+ -- pop identifiers for sections that have ended
+ local active_identifiers = active_headings[#active_headings]
+ if active_identifiers[slice_begin_identifier] ~= nil
+ and slice_begin_type == "$" then
+ self.is_writing = true
+ end
+ if active_identifiers[slice_end_identifier] ~= nil
+ and slice_end_type == "$" then
+ self.is_writing = false
+ end
+ table.remove(active_headings, #active_headings)
+ end
+
+ -- push identifiers for the new section
+ attributes = attributes or {}
+ local identifiers = {}
+ for index = 1, #attributes do
+ attribute = attributes[index]
+ identifiers[attribute:sub(2)] = true
+ end
+ if identifiers[slice_begin_identifier] ~= nil
+ and slice_begin_type == "^" then
+ self.is_writing = true
+ end
+ if identifiers[slice_end_identifier] ~= nil
+ and slice_end_type == "^" then
+ self.is_writing = false
+ end
+ table.insert(active_headings, identifiers)
+
+ if not self.is_writing then return "" end
+
local cmd
if level == 1 then
cmd = "\\markdownRendererHeadingOne"
@@ -7934,6 +11596,8 @@ parsers.lparent = P("(")
parsers.rparent = P(")")
parsers.lbracket = P("[")
parsers.rbracket = P("]")
+parsers.lbrace = P("{")
+parsers.rbrace = P("}")
parsers.circumflex = P("^")
parsers.slash = P("/")
parsers.equal = P("=")
@@ -8000,6 +11664,22 @@ parsers.nonemptyline = parsers.line - parsers.blankline
parsers.chunk = parsers.line * (parsers.optionallyindentedline
- parsers.blankline)^0
+parsers.css_identifier_char = R("AZ", "az", "09") + S("-_")
+parsers.css_identifier = (parsers.hash + parsers.period)
+ * (((parsers.css_identifier_char
+ - parsers.dash - parsers.digit)
+ * parsers.css_identifier_char^1)
+ + (parsers.dash
+ * (parsers.css_identifier_char
+ - parsers.digit)
+ * parsers.css_identifier_char^0))
+parsers.attribute_name_char = parsers.any - parsers.space
+ - parsers.squote - parsers.dquote
+ - parsers.more - parsers.slash
+ - parsers.equal
+parsers.attribute_value_char = parsers.any - parsers.dquote
+ - parsers.more
+
-- block followed by 0 or more optionally
-- indented blocks with first line indented.
parsers.indented_blocks = function(bl)
@@ -8284,9 +11964,8 @@ parsers.citation_body_postnote
parsers.citation_body_chunk
= parsers.citation_body_prenote
* parsers.spnl * parsers.citation_name
- * ((parsers.internal_punctuation - parsers.semicolon)
- * parsers.spnl)^-1
- * parsers.citation_body_postnote
+ * (parsers.internal_punctuation - parsers.semicolon)^-1
+ * parsers.spnl * parsers.citation_body_postnote
parsers.citation_body
= parsers.citation_body_chunk
@@ -8437,7 +12116,7 @@ parsers.inlinehtml = parsers.emptyelt_any
% \par
% \begin{markdown}
%
-%#### Parsers Used for \textsc{html} entities
+%#### Parsers Used for \textsc{html} Entities
%
% \end{markdown}
% \begin{macrocode}
@@ -8540,6 +12219,18 @@ parsers.dlchunk = Cs(parsers.line * (parsers.indentedline - parsers.blankline)^0
%
% \end{markdown}
% \begin{macrocode}
+parsers.heading_attribute = C(parsers.css_identifier)
+ + C((parsers.attribute_name_char
+ - parsers.rbrace)^1
+ * parsers.equal
+ * (parsers.attribute_value_char
+ - parsers.rbrace)^1)
+parsers.HeadingAttributes = parsers.lbrace
+ * parsers.heading_attribute
+ * (parsers.spacechar^1
+ * parsers.heading_attribute)^0
+ * parsers.rbrace
+
-- parse Atx heading start and return level
parsers.HeadingStart = #parsers.hash * C(parsers.hash^-6)
* -parsers.hash / length
@@ -9147,6 +12838,9 @@ function M.reader.new(writer, options)
local function ordered_list(items,tight,startNumber)
if options.startNumber then
startNumber = tonumber(startNumber) or 1 -- fallback for '#'
+ if startNumber ~= nil then
+ startNumber = math.floor(startNumber)
+ end
else
startNumber = nil
end
@@ -9203,18 +12897,63 @@ function M.reader.new(writer, options)
% \end{markdown}
% \begin{macrocode}
-- parse atx header
- larsers.AtxHeading = Cg(parsers.HeadingStart,"level")
- * parsers.optionalspace
- * (C(parsers.line) / strip_atx_end / parse_inlines)
- * Cb("level")
- / writer.heading
-
- -- parse setext header
- larsers.SetextHeading = #(parsers.line * S("=-"))
- * Ct(parsers.line / parse_inlines)
- * parsers.HeadingLevel
- * parsers.optionalspace * parsers.newline
- / writer.heading
+ if options.headerAttributes then
+ larsers.AtxHeading = Cg(parsers.HeadingStart,"level")
+ * parsers.optionalspace
+ * (C(((parsers.linechar
+ - ((parsers.hash^1
+ * parsers.optionalspace
+ * parsers.HeadingAttributes^-1
+ + parsers.HeadingAttributes)
+ * parsers.optionalspace
+ * parsers.newline))
+ * (parsers.linechar
+ - parsers.hash
+ - parsers.lbrace)^0)^1)
+ / parse_inlines)
+ * Cg(Ct(parsers.newline
+ + (parsers.hash^1
+ * parsers.optionalspace
+ * parsers.HeadingAttributes^-1
+ + parsers.HeadingAttributes)
+ * parsers.optionalspace
+ * parsers.newline), "attributes")
+ * Cb("level")
+ * Cb("attributes")
+ / writer.heading
+
+ larsers.SetextHeading = #(parsers.line * S("=-"))
+ * (C(((parsers.linechar
+ - (parsers.HeadingAttributes
+ * parsers.optionalspace
+ * parsers.newline))
+ * (parsers.linechar
+ - parsers.lbrace)^0)^1)
+ / parse_inlines)
+ * Cg(Ct(parsers.newline
+ + (parsers.HeadingAttributes
+ * parsers.optionalspace
+ * parsers.newline)), "attributes")
+ * parsers.HeadingLevel
+ * Cb("attributes")
+ * parsers.optionalspace
+ * parsers.newline
+ / writer.heading
+ else
+ larsers.AtxHeading = Cg(parsers.HeadingStart,"level")
+ * parsers.optionalspace
+ * (C(parsers.line) / strip_atx_end / parse_inlines)
+ * Cb("level")
+ / writer.heading
+
+ larsers.SetextHeading = #(parsers.line * S("=-"))
+ * Ct(parsers.linechar^1 / parse_inlines)
+ * parsers.newline
+ * parsers.HeadingLevel
+ * parsers.optionalspace
+ * parsers.newline
+ / writer.heading
+ end
larsers.Heading = larsers.AtxHeading + larsers.SetextHeading
% \end{macrocode}
@@ -9229,9 +12968,7 @@ function M.reader.new(writer, options)
{ "Blocks",
Blocks = larsers.Blank^0 * parsers.Block^-1
- * (larsers.Blank^0 / function()
- return writer.interblocksep
- end
+ * (larsers.Blank^0 / writer.interblocksep
* parsers.Block)^0
* larsers.Blank^0 * parsers.eof,
@@ -9573,7 +13310,7 @@ end
\def\markdownRendererBlockQuoteBeginPrototype{\par\begingroup\it}%
\def\markdownRendererBlockQuoteEndPrototype{\endgroup\par}%
\def\markdownRendererInputVerbatimPrototype#1{%
- \par{\tt\input"#1"\relax{}}\par}%
+ \par{\tt\input#1\relax{}}\par}%
\def\markdownRendererInputFencedCodePrototype#1#2{%
\markdownRendererInputVerbatimPrototype{#1}}%
\def\markdownRendererHeadingOnePrototype#1{#1}%
@@ -9639,6 +13376,9 @@ end
\ifx\markdownOptionHashEnumerators\undefined\else
hashEnumerators = \markdownOptionHashEnumerators,
\fi
+\ifx\markdownOptionHeaderAttributes\undefined\else
+ headerAttributes = \markdownOptionHeaderAttributes,
+\fi
\ifx\markdownOptionHtml\undefined\else
html = \markdownOptionHtml,
\fi
@@ -9651,6 +13391,9 @@ end
\ifx\markdownOptionPreserveTabs\undefined\else
preserveTabs = \markdownOptionPreserveTabs,
\fi
+\ifx\markdownOptionSlice\undefined\else
+ slice = "\markdownOptionSlice",
+\fi
\ifx\markdownOptionSmartEllipses\undefined\else
smartEllipses = \markdownOptionSmartEllipses,
\fi
@@ -9755,7 +13498,7 @@ local convert = md.new(\markdownLuaOptions)
% \end{markdown}
% \begin{macrocode}
|immediate|openout|markdownOutputFileStream@
- |markdownOptionInputTempFileName@
+ |markdownOptionInputTempFileName|relax@
|markdownInfo{Buffering markdown input into the temporary @
input file "|markdownOptionInputTempFileName" and scanning @
for the closing token sequence "#1"}@
@@ -9878,7 +13621,7 @@ local convert = md.new(\markdownLuaOptions)
% \ref{sec:directlua} are meant to be indistinguishable to the remaining code.
%
% The package assumes that although the user is not using the Lua\TeX{} engine,
-% their TeX distribution contains it, and uses shell access to produce and
+% their \TeX{} distribution contains it, and uses shell access to produce and
% execute Lua scripts using the \TeX{}Lua interpreter~[@luatex17, Section
% 3.1.1].
%
@@ -10097,7 +13840,9 @@ local convert = md.new(\markdownLuaOptions)
|closein|markdownInputFileStream
|markdownLuaExecute{%
|markdownPrepare
- local input = assert(io.open("#1", "r"):read("*a"))
+ local input = assert(io.open("%
+ |markdownOptionOutputDir
+ /#1", "r"):read("*a"))
% \end{macrocode}
% \begin{markdown}
% Since the Lua converter expects \acro{unix} line endings, normalize the
@@ -10396,23 +14141,172 @@ local convert = md.new(\markdownLuaOptions)
% \begin{markdown}
%
% There is a basic implementation for citations that uses the \LaTeX{} \m{cite}
-% macro. There is also a more advanced implementation that uses the Bib\LaTeX{}
-% \m{autocites} and \m{textcites} macros. This implementation will be used, when
-% Bib\LaTeX{} is loaded.
+% macro. There are also implementations that use the \pkg{natbib} \m{citep},
+% and \m{citet} macros, and the Bib\LaTeX{} \m{autocites} and \m{textcites}
+% macros. These implementations will be used, when the respective packages are
+% loaded.
%
% \end{markdown}
% \begin{macrocode}
\newcount\markdownLaTeXCitationsCounter
% Basic implementation
-\def\markdownLaTeXBasicCitations#1#2#3#4{%
+\def\markdownLaTeXBasicCitations#1#2#3#4#5#6{%
\advance\markdownLaTeXCitationsCounter by 1\relax
- \ifx\relax#2\relax\else#2~\fi\cite[#3]{#4}%
- \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
- \expandafter\@gobble
- \fi\markdownLaTeXBasicCitations}
+ \ifx\relax#4\relax
+ \ifx\relax#5\relax
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \cite{#1#2#6}% Without prenotes and postnotes, just accumulate cites
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \@gobblethree
+ \fi
+ \else% Before a postnote (#5), dump the accumulator
+ \ifx\relax#1\relax\else
+ \cite{#1}%
+ \fi
+ \cite[#5]{#6}%
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \else
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \markdownLaTeXBasicCitations
+ \fi
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter
+ \@gobblethree
+ \fi
+ \else% Before a prenote (#4), dump the accumulator
+ \ifx\relax#1\relax\else
+ \cite{#1}%
+ \fi
+ \ifnum\markdownLaTeXCitationsCounter>1\relax
+ \space % Insert a space before the prenote in later citations
+ \fi
+ #4~\expandafter\cite\ifx\relax#5\relax{#6}\else[#5]{#6}\fi
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \else
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \markdownLaTeXBasicCitations
+ \fi
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \expandafter
+ \@gobblethree
+ \fi\markdownLaTeXBasicCitations{#1#2#6},}
\let\markdownLaTeXBasicTextCitations\markdownLaTeXBasicCitations
+% Natbib implementation
+\def\markdownLaTeXNatbibCitations#1#2#3#4#5{%
+ \advance\markdownLaTeXCitationsCounter by 1\relax
+ \ifx\relax#3\relax
+ \ifx\relax#4\relax
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \citep{#1,#5}% Without prenotes and postnotes, just accumulate cites
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \@gobbletwo
+ \fi
+ \else% Before a postnote (#4), dump the accumulator
+ \ifx\relax#1\relax\else
+ \citep{#1}%
+ \fi
+ \citep[][#4]{#5}%
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \else
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \markdownLaTeXNatbibCitations
+ \fi
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter
+ \@gobbletwo
+ \fi
+ \else% Before a prenote (#3), dump the accumulator
+ \ifx\relax#1\relax\relax\else
+ \citep{#1}%
+ \fi
+ \citep[#3][#4]{#5}%
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \else
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \markdownLaTeXNatbibCitations
+ \fi
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \expandafter
+ \@gobbletwo
+ \fi\markdownLaTeXNatbibCitations{#1,#5}}
+\def\markdownLaTeXNatbibTextCitations#1#2#3#4#5{%
+ \advance\markdownLaTeXCitationsCounter by 1\relax
+ \ifx\relax#3\relax
+ \ifx\relax#4\relax
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \citet{#1,#5}% Without prenotes and postnotes, just accumulate cites
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \@gobbletwo
+ \fi
+ \else% After a prenote or a postnote, dump the accumulator
+ \ifx\relax#1\relax\else
+ \citet{#1}%
+ \fi
+ , \citet[#3][#4]{#5}%
+ \ifnum\markdownLaTeXCitationsCounter<\markdownLaTeXCitationsTotal\relax
+ ,
+ \else
+ \ifnum\markdownLaTeXCitationsCounter=\markdownLaTeXCitationsTotal\relax
+ ,
+ \fi
+ \fi
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \markdownLaTeXNatbibTextCitations
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter
+ \@gobbletwo
+ \fi
+ \else% After a prenote or a postnote, dump the accumulator
+ \ifx\relax#1\relax\relax\else
+ \citet{#1}%
+ \fi
+ , \citet[#3][#4]{#5}%
+ \ifnum\markdownLaTeXCitationsCounter<\markdownLaTeXCitationsTotal\relax
+ ,
+ \else
+ \ifnum\markdownLaTeXCitationsCounter=\markdownLaTeXCitationsTotal\relax
+ ,
+ \fi
+ \fi
+ \expandafter\expandafter\expandafter
+ \markdownLaTeXNatbibTextCitations
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \expandafter
+ \@gobbletwo
+ \fi\markdownLaTeXNatbibTextCitations{#1,#5}}
+
% BibLaTeX implementation
\def\markdownLaTeXBibLaTeXCitations#1#2#3#4#5{%
\advance\markdownLaTeXCitationsCounter by 1\relax
@@ -10432,8 +14326,19 @@ local convert = md.new(\markdownLuaOptions)
\markdownLaTeXCitationsCounter=1%
\def\markdownLaTeXCitationsTotal{#1}%
\ifx\autocites\undefined
- \expandafter
- \markdownLaTeXBasicCitations
+ \ifx\citep\undefined
+ \expandafter\expandafter\expandafter
+ \markdownLaTeXBasicCitations
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \else
+ \expandafter\expandafter\expandafter
+ \markdownLaTeXNatbibCitations
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \fi
\else
\expandafter\expandafter\expandafter
\markdownLaTeXBibLaTeXCitations
@@ -10442,9 +14347,20 @@ local convert = md.new(\markdownLuaOptions)
textCite = {%
\markdownLaTeXCitationsCounter=1%
\def\markdownLaTeXCitationsTotal{#1}%
- \ifx\textcites\undefined
- \expandafter
- \markdownLaTeXBasicTextCitations
+ \ifx\autocites\undefined
+ \ifx\citep\undefined
+ \expandafter\expandafter\expandafter
+ \markdownLaTeXBasicTextCitations
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \else
+ \expandafter\expandafter\expandafter
+ \markdownLaTeXNatbibTextCitations
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \fi
\else
\expandafter\expandafter\expandafter
\markdownLaTeXBibLaTeXTextCitations
@@ -10517,7 +14433,8 @@ local convert = md.new(\markdownLuaOptions)
% When buffering user input, we should disable the bytes with the high bit set,
% since these are made active by the \m{enableregime} macro. We will do this
% by redefining the \m{markdownMakeOther} macro accordingly. The code is
-% courtesy of Scott Pakin, the creator of the \pkg{filecontents} LaTeX package.
+% courtesy of Scott Pakin, the creator of the \pkg{filecontents} \LaTeX{}
+% package.
%
% \end{markdown}
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/generic/markdown/markdown.ins b/Master/texmf-dist/source/generic/markdown/markdown.ins
index 0965a974b78..b7436c37fcf 100644
--- a/Master/texmf-dist/source/generic/markdown/markdown.ins
+++ b/Master/texmf-dist/source/generic/markdown/markdown.ins
@@ -8,5 +8,8 @@
\file{t-markdown.tex}{\from{markdown.dtx}{context}}
\usepreamble\empty\usepostamble\empty
\file{markdown.md}{\from{markdown.dtx}{manual}}
+ \file{markdown-interfaces.md}{\from{markdown.dtx}{manual-interfaces}}
+ \file{markdown-options.md}{\from{markdown.dtx}{manual-options}}
+ \file{markdown-tokens.md}{\from{markdown.dtx}{manual-tokens}}
\file{markdown.css}{\from{markdown.dtx}{manual-css}}}
\endbatchfile
diff --git a/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex b/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex
index 40f891b19bd..f114a6d267a 100644
--- a/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex
+++ b/Master/texmf-dist/tex/context/third/markdown/t-markdown.tex
@@ -6,7 +6,7 @@
%%
%% markdown.dtx (with options: `context')
%%
-%% Copyright (C) 2018 Vít Novotný
+%% Copyright (C) 2016-2019 Vít Novotný
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
diff --git a/Master/texmf-dist/tex/generic/markdown/markdown.tex b/Master/texmf-dist/tex/generic/markdown/markdown.tex
index 8b33ee045de..6091f6ea530 100644
--- a/Master/texmf-dist/tex/generic/markdown/markdown.tex
+++ b/Master/texmf-dist/tex/generic/markdown/markdown.tex
@@ -6,7 +6,7 @@
%%
%% markdown.dtx (with options: `tex')
%%
-%% Copyright (C) 2018 Vít Novotný
+%% Copyright (C) 2016-2019 Vít Novotný
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -45,8 +45,8 @@
%%
%% The names of the source files used are shown above.
%%
-\def\markdownLastModified{2018/04/08}%
-\def\markdownVersion{2.5.6}%
+\def\markdownLastModified{2019/04/04}%
+\def\markdownVersion{2.7.0}%
\let\markdownBegin\relax
\let\markdownEnd\relax
\let\markdownInput\relax
@@ -54,8 +54,8 @@
\def\markdownOptionInputTempFileName{\jobname.markdown.in}%
\def\markdownOptionOutputTempFileName{\jobname.markdown.out}%
\def\markdownOptionErrorTempFileName{\jobname.markdown.err}%
-\def\markdownOptionCacheDir{\markdownOptionOutputDir/_markdown_\jobname}%
\def\markdownOptionOutputDir{.}%
+\def\markdownOptionCacheDir{\markdownOptionOutputDir/_markdown_\jobname}%
\let\markdownOptionBlankBeforeBlockquote\undefined
\let\markdownOptionBlankBeforeCodeFence\undefined
\let\markdownOptionBlankBeforeHeading\undefined
@@ -68,10 +68,12 @@
\let\markdownOptionFootnotes\undefined
\let\markdownOptionFencedCode\undefined
\let\markdownOptionHashEnumerators\undefined
+\let\markdownOptionHeaderAttributes\undefined
\let\markdownOptionHtml\undefined
\let\markdownOptionHybrid\undefined
\let\markdownOptionInlineFootnotes\undefined
\let\markdownOptionPreserveTabs\undefined
+\let\markdownOptionSlice\undefined
\let\markdownOptionSmartEllipses\undefined
\let\markdownOptionStartNumber\undefined
\let\markdownOptionTightLists\undefined
@@ -338,7 +340,7 @@
\def\markdownRendererBlockQuoteBeginPrototype{\par\begingroup\it}%
\def\markdownRendererBlockQuoteEndPrototype{\endgroup\par}%
\def\markdownRendererInputVerbatimPrototype#1{%
- \par{\tt\input"#1"\relax{}}\par}%
+ \par{\tt\input#1\relax{}}\par}%
\def\markdownRendererInputFencedCodePrototype#1#2{%
\markdownRendererInputVerbatimPrototype{#1}}%
\def\markdownRendererHeadingOnePrototype#1{#1}%
@@ -393,6 +395,9 @@
\ifx\markdownOptionHashEnumerators\undefined\else
hashEnumerators = \markdownOptionHashEnumerators,
\fi
+\ifx\markdownOptionHeaderAttributes\undefined\else
+ headerAttributes = \markdownOptionHeaderAttributes,
+\fi
\ifx\markdownOptionHtml\undefined\else
html = \markdownOptionHtml,
\fi
@@ -405,6 +410,9 @@
\ifx\markdownOptionPreserveTabs\undefined\else
preserveTabs = \markdownOptionPreserveTabs,
\fi
+\ifx\markdownOptionSlice\undefined\else
+ slice = "\markdownOptionSlice",
+\fi
\ifx\markdownOptionSmartEllipses\undefined\else
smartEllipses = \markdownOptionSmartEllipses,
\fi
@@ -443,7 +451,7 @@ local convert = md.new(\markdownLuaOptions)
|gdef|markdownReadAndConvert#1#2{@
|begingroup@
|immediate|openout|markdownOutputFileStream@
- |markdownOptionInputTempFileName@
+ |markdownOptionInputTempFileName|relax@
|markdownInfo{Buffering markdown input into the temporary @
input file "|markdownOptionInputTempFileName" and scanning @
for the closing token sequence "#1"}@
@@ -570,7 +578,9 @@ local convert = md.new(\markdownLuaOptions)
|closein|markdownInputFileStream
|markdownLuaExecute{%
|markdownPrepare
- local input = assert(io.open("#1", "r"):read("*a"))
+ local input = assert(io.open("%
+ |markdownOptionOutputDir
+ /#1", "r"):read("*a"))
print(convert(input:gsub("\r\n?", "\n")))}}%
|endgroup
\endinput
diff --git a/Master/texmf-dist/tex/latex/markdown/markdown.sty b/Master/texmf-dist/tex/latex/markdown/markdown.sty
index 251a2f62d74..f21cb15b81d 100644
--- a/Master/texmf-dist/tex/latex/markdown/markdown.sty
+++ b/Master/texmf-dist/tex/latex/markdown/markdown.sty
@@ -6,7 +6,7 @@
%%
%% markdown.dtx (with options: `latex')
%%
-%% Copyright (C) 2018 Vít Novotný
+%% Copyright (C) 2016-2019 Vít Novotný
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -52,6 +52,7 @@
\RequirePackage{ifthen}
\RequirePackage{fancyvrb}
\RequirePackage{csvsimple}
+\RequirePackage{gobble}
\newenvironment{markdown}\relax\relax
\newenvironment{markdown*}[1]\relax\relax
\newcommand\markdownSetup[1]{%
@@ -94,6 +95,8 @@
\def\markdownOptionFencedCode{#1}}%
\define@key{markdownOptions}{hashEnumerators}[true]{%
\def\markdownOptionHashEnumerators{#1}}%
+\define@key{markdownOptions}{headerAttributes}[true]{%
+ \def\markdownOptionHeaderAttributes{#1}}%
\define@key{markdownOptions}{html}[true]{%
\def\markdownOptionHtml{#1}}%
\define@key{markdownOptions}{hybrid}[true]{%
@@ -104,6 +107,8 @@
\def\markdownOptionPreserveTabs{#1}}%
\define@key{markdownOptions}{smartEllipses}[true]{%
\def\markdownOptionSmartEllipses{#1}}%
+\define@key{markdownOptions}{slice}[true]{%
+ \def\markdownOptionSlice{#1}}%
\define@key{markdownOptions}{startNumber}[true]{%
\def\markdownOptionStartNumber{#1}}%
\define@key{markdownOptions}{tightLists}[true]{%
@@ -495,14 +500,161 @@
\fi
\newcount\markdownLaTeXCitationsCounter
-\def\markdownLaTeXBasicCitations#1#2#3#4{%
+\def\markdownLaTeXBasicCitations#1#2#3#4#5#6{%
\advance\markdownLaTeXCitationsCounter by 1\relax
- \ifx\relax#2\relax\else#2~\fi\cite[#3]{#4}%
- \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
- \expandafter\@gobble
- \fi\markdownLaTeXBasicCitations}
+ \ifx\relax#4\relax
+ \ifx\relax#5\relax
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \cite{#1#2#6}% Without prenotes and postnotes, just accumulate cites
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \@gobblethree
+ \fi
+ \else% Before a postnote (#5), dump the accumulator
+ \ifx\relax#1\relax\else
+ \cite{#1}%
+ \fi
+ \cite[#5]{#6}%
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \else
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \markdownLaTeXBasicCitations
+ \fi
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter
+ \@gobblethree
+ \fi
+ \else% Before a prenote (#4), dump the accumulator
+ \ifx\relax#1\relax\else
+ \cite{#1}%
+ \fi
+ \ifnum\markdownLaTeXCitationsCounter>1\relax
+ \space % Insert a space before the prenote in later citations
+ \fi
+ #4~\expandafter\cite\ifx\relax#5\relax{#6}\else[#5]{#6}\fi
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \else
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \markdownLaTeXBasicCitations
+ \fi
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \expandafter
+ \@gobblethree
+ \fi\markdownLaTeXBasicCitations{#1#2#6},}
\let\markdownLaTeXBasicTextCitations\markdownLaTeXBasicCitations
+\def\markdownLaTeXNatbibCitations#1#2#3#4#5{%
+ \advance\markdownLaTeXCitationsCounter by 1\relax
+ \ifx\relax#3\relax
+ \ifx\relax#4\relax
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \citep{#1,#5}% Without prenotes and postnotes, just accumulate cites
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \@gobbletwo
+ \fi
+ \else% Before a postnote (#4), dump the accumulator
+ \ifx\relax#1\relax\else
+ \citep{#1}%
+ \fi
+ \citep[][#4]{#5}%
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \else
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \markdownLaTeXNatbibCitations
+ \fi
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter
+ \@gobbletwo
+ \fi
+ \else% Before a prenote (#3), dump the accumulator
+ \ifx\relax#1\relax\relax\else
+ \citep{#1}%
+ \fi
+ \citep[#3][#4]{#5}%
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \else
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \markdownLaTeXNatbibCitations
+ \fi
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \expandafter
+ \@gobbletwo
+ \fi\markdownLaTeXNatbibCitations{#1,#5}}
+\def\markdownLaTeXNatbibTextCitations#1#2#3#4#5{%
+ \advance\markdownLaTeXCitationsCounter by 1\relax
+ \ifx\relax#3\relax
+ \ifx\relax#4\relax
+ \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
+ \citet{#1,#5}% Without prenotes and postnotes, just accumulate cites
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \@gobbletwo
+ \fi
+ \else% After a prenote or a postnote, dump the accumulator
+ \ifx\relax#1\relax\else
+ \citet{#1}%
+ \fi
+ , \citet[#3][#4]{#5}%
+ \ifnum\markdownLaTeXCitationsCounter<\markdownLaTeXCitationsTotal\relax
+ ,
+ \else
+ \ifnum\markdownLaTeXCitationsCounter=\markdownLaTeXCitationsTotal\relax
+ ,
+ \fi
+ \fi
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter
+ \markdownLaTeXNatbibTextCitations
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter
+ \@gobbletwo
+ \fi
+ \else% After a prenote or a postnote, dump the accumulator
+ \ifx\relax#1\relax\relax\else
+ \citet{#1}%
+ \fi
+ , \citet[#3][#4]{#5}%
+ \ifnum\markdownLaTeXCitationsCounter<\markdownLaTeXCitationsTotal\relax
+ ,
+ \else
+ \ifnum\markdownLaTeXCitationsCounter=\markdownLaTeXCitationsTotal\relax
+ ,
+ \fi
+ \fi
+ \expandafter\expandafter\expandafter
+ \markdownLaTeXNatbibTextCitations
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \expandafter
+ \@gobbletwo
+ \fi\markdownLaTeXNatbibTextCitations{#1,#5}}
+
\def\markdownLaTeXBibLaTeXCitations#1#2#3#4#5{%
\advance\markdownLaTeXCitationsCounter by 1\relax
\ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax
@@ -521,8 +673,19 @@
\markdownLaTeXCitationsCounter=1%
\def\markdownLaTeXCitationsTotal{#1}%
\ifx\autocites\undefined
- \expandafter
- \markdownLaTeXBasicCitations
+ \ifx\citep\undefined
+ \expandafter\expandafter\expandafter
+ \markdownLaTeXBasicCitations
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \else
+ \expandafter\expandafter\expandafter
+ \markdownLaTeXNatbibCitations
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \fi
\else
\expandafter\expandafter\expandafter
\markdownLaTeXBibLaTeXCitations
@@ -531,9 +694,20 @@
textCite = {%
\markdownLaTeXCitationsCounter=1%
\def\markdownLaTeXCitationsTotal{#1}%
- \ifx\textcites\undefined
- \expandafter
- \markdownLaTeXBasicTextCitations
+ \ifx\autocites\undefined
+ \ifx\citep\undefined
+ \expandafter\expandafter\expandafter
+ \markdownLaTeXBasicTextCitations
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \else
+ \expandafter\expandafter\expandafter
+ \markdownLaTeXNatbibTextCitations
+ \expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter}%
+ \fi
\else
\expandafter\expandafter\expandafter
\markdownLaTeXBibLaTeXTextCitations
diff --git a/Master/texmf-dist/tex/luatex/markdown/markdown.lua b/Master/texmf-dist/tex/luatex/markdown/markdown.lua
index 25d45c32da2..9614434b81f 100644
--- a/Master/texmf-dist/tex/luatex/markdown/markdown.lua
+++ b/Master/texmf-dist/tex/luatex/markdown/markdown.lua
@@ -20,7 +20,7 @@
-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--
--- Copyright (C) 2018 Vít Novotný
+-- Copyright (C) 2016-2019 Vít Novotný
--
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -58,11 +58,11 @@
-- those in the standard .ins files.
--
local metadata = {
- version = "2.5.6",
+ version = "2.7.0",
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-2018 Vít Novotný"},
+ "2016-2019 Vít Novotný"},
license = "LPPL 1.3"
}
@@ -87,10 +87,12 @@ defaultOptions.definitionLists = false
defaultOptions.fencedCode = false
defaultOptions.footnotes = false
defaultOptions.hashEnumerators = false
+defaultOptions.headerAttributes = false
defaultOptions.html = false
defaultOptions.hybrid = false
defaultOptions.inlineFootnotes = false
defaultOptions.preserveTabs = false
+defaultOptions.slice = "^ $"
defaultOptions.smartEllipses = false
defaultOptions.startNumber = true
defaultOptions.tightLists = true
@@ -498,6 +500,31 @@ function M.writer.new(options)
options = options or {}
setmetatable(options, { __index = function (_, key)
return defaultOptions[key] end })
+ local slice_specifiers = {}
+ for specifier in options.slice:gmatch("[^%s]+") do
+ table.insert(slice_specifiers, specifier)
+ end
+
+ if #slice_specifiers == 2 then
+ self.slice_begin, self.slice_end = table.unpack(slice_specifiers)
+ local slice_begin_type = self.slice_begin:sub(1, 1)
+ if slice_begin_type ~= "^" and slice_begin_type ~= "$" then
+ self.slice_begin = "^" .. self.slice_begin
+ end
+ local slice_end_type = self.slice_end:sub(1, 1)
+ if slice_end_type ~= "^" and slice_end_type ~= "$" then
+ self.slice_end = "$" .. self.slice_end
+ end
+ elseif #slice_specifiers == 1 then
+ self.slice_begin = "^" .. slice_specifiers[1]
+ self.slice_end = "$" .. slice_specifiers[1]
+ end
+
+ if self.slice_begin == "^" and self.slice_end ~= "^" then
+ self.is_writing = true
+ else
+ self.is_writing = false
+ end
self.suffix = ".tex"
self.space = " "
self.nbsp = "\\markdownRendererNbsp{}"
@@ -505,16 +532,23 @@ function M.writer.new(options)
return s
end
function self.paragraph(s)
+ if not self.is_writing then return "" end
return s
end
function self.pack(name)
- return [[\input"]] .. name .. [["\relax{}]]
+ return [[\input ]] .. name .. [[\relax{}]]
+ end
+ function self.interblocksep()
+ if not self.is_writing then return "" end
+ return "\\markdownRendererInterblockSeparator\n{}"
end
- self.interblocksep = "\\markdownRendererInterblockSeparator\n{}"
self.eof = [[\relax]]
self.linebreak = "\\markdownRendererLineBreak\n{}"
self.ellipsis = "\\markdownRendererEllipsis{}"
- self.hrule = "\\markdownRendererHorizontalRule{}"
+ function self.hrule()
+ if not self.is_writing then return "" end
+ return "\\markdownRendererHorizontalRule{}"
+ end
local escaped_chars = {
["{"] = "\\markdownRendererLeftBrace{}",
["}"] = "\\markdownRendererRightBrace{}",
@@ -572,30 +606,31 @@ function M.writer.new(options)
"{",self.uri(src),"}",
"{",self.string(tit or ""),"}"}
end
-local languages_json = (function()
- local kpse = require("kpse")
- kpse.set_program_name("luatex")
- local base, prev, curr
- for _, file in ipairs{kpse.lookup(options.contentBlocksLanguageMap,
- { all=true })} do
- json = io.open(file, "r"):read("*all")
- :gsub('("[^\n]-"):','[%1]=')
- curr = (function()
- local _ENV={ json=json, load=load } -- run in sandbox
- return load("return "..json)()
- end)()
- if type(curr) == "table" then
- if base == nil then
- base = curr
- else
- setmetatable(prev, { __index = curr })
+ local languages_json = (function()
+ local kpse = require("kpse")
+ kpse.set_program_name("luatex")
+ local base, prev, curr
+ for _, file in ipairs{kpse.lookup(options.contentBlocksLanguageMap,
+ { all=true })} do
+ json = io.open(file, "r"):read("*all")
+ :gsub('("[^\n]-"):','[%1]=')
+ curr = (function()
+ local _ENV={ json=json, load=load } -- run in sandbox
+ return load("return "..json)()
+ end)()
+ if type(curr) == "table" then
+ if base == nil then
+ base = curr
+ else
+ setmetatable(prev, { __index = curr })
+ end
+ prev = curr
end
- prev = curr
end
- end
- return base or {}
-end)()
+ return base or {}
+ end)()
function self.contentblock(src,suf,type,tit)
+ if not self.is_writing then return "" end
src = src.."."..suf
suf = suf:lower()
if type == "onlineimage" then
@@ -622,6 +657,7 @@ end)()
end
function self.bulletlist(items,tight)
+ if not self.is_writing then return "" end
local buffer = {}
for _,item in ipairs(items) do
buffer[#buffer + 1] = ulitem(item)
@@ -646,6 +682,7 @@ end)()
end
function self.orderedlist(items,tight,startnum)
+ if not self.is_writing then return "" end
local buffer = {}
local num = startnum
for _,item in ipairs(items) do
@@ -676,6 +713,7 @@ end)()
end
function self.definitionlist(items,tight)
+ if not self.is_writing then return "" end
local buffer = {}
for _,item in ipairs(items) do
buffer[#buffer + 1] = dlitem(item.term, item.definitions)
@@ -695,18 +733,66 @@ end)()
return {"\\markdownRendererStrongEmphasis{",s,"}"}
end
function self.blockquote(s)
+ if #util.rope_to_string(s) == 0 then return "" end
return {"\\markdownRendererBlockQuoteBegin\n",s,
"\n\\markdownRendererBlockQuoteEnd "}
end
function self.verbatim(s)
+ if not self.is_writing then return "" end
local name = util.cache(options.cacheDir, s, nil, nil, ".verbatim")
return {"\\markdownRendererInputVerbatim{",name,"}"}
end
function self.fencedCode(i, s)
+ if not self.is_writing then return "" end
local name = util.cache(options.cacheDir, s, nil, nil, ".verbatim")
return {"\\markdownRendererInputFencedCode{",name,"}{",i,"}"}
end
- function self.heading(s,level)
+ self.active_headings = {}
+ function self.heading(s,level,attributes)
+ local active_headings = self.active_headings
+ local slice_begin_type = self.slice_begin:sub(1, 1)
+ local slice_begin_identifier = self.slice_begin:sub(2) or ""
+ local slice_end_type = self.slice_end:sub(1, 1)
+ local slice_end_identifier = self.slice_end:sub(2) or ""
+
+ while #active_headings < level do
+ -- push empty identifiers for implied sections
+ table.insert(active_headings, {})
+ end
+
+ while #active_headings >= level do
+ -- pop identifiers for sections that have ended
+ local active_identifiers = active_headings[#active_headings]
+ if active_identifiers[slice_begin_identifier] ~= nil
+ and slice_begin_type == "$" then
+ self.is_writing = true
+ end
+ if active_identifiers[slice_end_identifier] ~= nil
+ and slice_end_type == "$" then
+ self.is_writing = false
+ end
+ table.remove(active_headings, #active_headings)
+ end
+
+ -- push identifiers for the new section
+ attributes = attributes or {}
+ local identifiers = {}
+ for index = 1, #attributes do
+ attribute = attributes[index]
+ identifiers[attribute:sub(2)] = true
+ end
+ if identifiers[slice_begin_identifier] ~= nil
+ and slice_begin_type == "^" then
+ self.is_writing = true
+ end
+ if identifiers[slice_end_identifier] ~= nil
+ and slice_end_type == "^" then
+ self.is_writing = false
+ end
+ table.insert(active_headings, identifiers)
+
+ if not self.is_writing then return "" end
+
local cmd
if level == 1 then
cmd = "\\markdownRendererHeadingOne"
@@ -761,6 +847,8 @@ parsers.lparent = P("(")
parsers.rparent = P(")")
parsers.lbracket = P("[")
parsers.rbracket = P("]")
+parsers.lbrace = P("{")
+parsers.rbrace = P("}")
parsers.circumflex = P("^")
parsers.slash = P("/")
parsers.equal = P("=")
@@ -827,6 +915,22 @@ parsers.nonemptyline = parsers.line - parsers.blankline
parsers.chunk = parsers.line * (parsers.optionallyindentedline
- parsers.blankline)^0
+parsers.css_identifier_char = R("AZ", "az", "09") + S("-_")
+parsers.css_identifier = (parsers.hash + parsers.period)
+ * (((parsers.css_identifier_char
+ - parsers.dash - parsers.digit)
+ * parsers.css_identifier_char^1)
+ + (parsers.dash
+ * (parsers.css_identifier_char
+ - parsers.digit)
+ * parsers.css_identifier_char^0))
+parsers.attribute_name_char = parsers.any - parsers.space
+ - parsers.squote - parsers.dquote
+ - parsers.more - parsers.slash
+ - parsers.equal
+parsers.attribute_value_char = parsers.any - parsers.dquote
+ - parsers.more
+
-- block followed by 0 or more optionally
-- indented blocks with first line indented.
parsers.indented_blocks = function(bl)
@@ -1063,9 +1167,8 @@ parsers.citation_body_postnote
parsers.citation_body_chunk
= parsers.citation_body_prenote
* parsers.spnl * parsers.citation_name
- * ((parsers.internal_punctuation - parsers.semicolon)
- * parsers.spnl)^-1
- * parsers.citation_body_postnote
+ * (parsers.internal_punctuation - parsers.semicolon)^-1
+ * parsers.spnl * parsers.citation_body_postnote
parsers.citation_body
= parsers.citation_body_chunk
@@ -1255,6 +1358,18 @@ parsers.defstart = ( parsers.defstartchar * #parsers.spacing
)
parsers.dlchunk = Cs(parsers.line * (parsers.indentedline - parsers.blankline)^0)
+parsers.heading_attribute = C(parsers.css_identifier)
+ + C((parsers.attribute_name_char
+ - parsers.rbrace)^1
+ * parsers.equal
+ * (parsers.attribute_value_char
+ - parsers.rbrace)^1)
+parsers.HeadingAttributes = parsers.lbrace
+ * parsers.heading_attribute
+ * (parsers.spacechar^1
+ * parsers.heading_attribute)^0
+ * parsers.rbrace
+
-- parse Atx heading start and return level
parsers.HeadingStart = #parsers.hash * C(parsers.hash^-6)
* -parsers.hash / length
@@ -1721,6 +1836,9 @@ function M.reader.new(writer, options)
local function ordered_list(items,tight,startNumber)
if options.startNumber then
startNumber = tonumber(startNumber) or 1 -- fallback for '#'
+ if startNumber ~= nil then
+ startNumber = math.floor(startNumber)
+ end
else
startNumber = nil
end
@@ -1761,27 +1879,70 @@ function M.reader.new(writer, options)
+ larsers.Reference
+ (parsers.tightblocksep / "\n")
-- parse atx header
- larsers.AtxHeading = Cg(parsers.HeadingStart,"level")
- * parsers.optionalspace
- * (C(parsers.line) / strip_atx_end / parse_inlines)
- * Cb("level")
- / writer.heading
-
- -- parse setext header
- larsers.SetextHeading = #(parsers.line * S("=-"))
- * Ct(parsers.line / parse_inlines)
- * parsers.HeadingLevel
- * parsers.optionalspace * parsers.newline
- / writer.heading
+ if options.headerAttributes then
+ larsers.AtxHeading = Cg(parsers.HeadingStart,"level")
+ * parsers.optionalspace
+ * (C(((parsers.linechar
+ - ((parsers.hash^1
+ * parsers.optionalspace
+ * parsers.HeadingAttributes^-1
+ + parsers.HeadingAttributes)
+ * parsers.optionalspace
+ * parsers.newline))
+ * (parsers.linechar
+ - parsers.hash
+ - parsers.lbrace)^0)^1)
+ / parse_inlines)
+ * Cg(Ct(parsers.newline
+ + (parsers.hash^1
+ * parsers.optionalspace
+ * parsers.HeadingAttributes^-1
+ + parsers.HeadingAttributes)
+ * parsers.optionalspace
+ * parsers.newline), "attributes")
+ * Cb("level")
+ * Cb("attributes")
+ / writer.heading
+
+ larsers.SetextHeading = #(parsers.line * S("=-"))
+ * (C(((parsers.linechar
+ - (parsers.HeadingAttributes
+ * parsers.optionalspace
+ * parsers.newline))
+ * (parsers.linechar
+ - parsers.lbrace)^0)^1)
+ / parse_inlines)
+ * Cg(Ct(parsers.newline
+ + (parsers.HeadingAttributes
+ * parsers.optionalspace
+ * parsers.newline)), "attributes")
+ * parsers.HeadingLevel
+ * Cb("attributes")
+ * parsers.optionalspace
+ * parsers.newline
+ / writer.heading
+ else
+ larsers.AtxHeading = Cg(parsers.HeadingStart,"level")
+ * parsers.optionalspace
+ * (C(parsers.line) / strip_atx_end / parse_inlines)
+ * Cb("level")
+ / writer.heading
+
+ larsers.SetextHeading = #(parsers.line * S("=-"))
+ * Ct(parsers.linechar^1 / parse_inlines)
+ * parsers.newline
+ * parsers.HeadingLevel
+ * parsers.optionalspace
+ * parsers.newline
+ / writer.heading
+ end
larsers.Heading = larsers.AtxHeading + larsers.SetextHeading
local syntax =
{ "Blocks",
Blocks = larsers.Blank^0 * parsers.Block^-1
- * (larsers.Blank^0 / function()
- return writer.interblocksep
- end
+ * (larsers.Blank^0 / writer.interblocksep
* parsers.Block)^0
* larsers.Blank^0 * parsers.eof,