~xigoi/xidoc

3a53438b9c9572e8bfb2dca51d256416aa79193e — Adam Blažek 2 months ago a184101
Command list improvements
2 files changed, 237 insertions(+), 208 deletions(-)

M docs/commands.html
M docs/commands.xd
M docs/commands.html => docs/commands.html +93 -88
@@ 29,17 29,31 @@ margin:.5rem;
padding:.5rem;
text-decoration:none;}
textarea{background-color:inherit;
color:inherit;}.xd-logo{color:#d0c;font-weight:bold}.command>h3,.command>h4{font-size:inherit;}
color:inherit;}.xd-logo{color:#d0c;font-weight:bold}.command{background-color:#111;
border:1px solid #333;
margin:0 0 .5rem 0;
padding:.3rem;}
.command>.command{background-color:#222;
border:1px solid #444;
margin:.5rem 0 0 0;}
.command>h3,.command>h4,.command>h5{font-size:inherit;
margin:.1rem 0 .1rem 0;
margin-bottom:.1rem;}
.command code{background-color:inherit !important;
padding:0 !important;}
h2,h3{margin:1rem 0 0 0;}
pre{white-space:pre-wrap;}
pre.language-xidoc>code.language-xidoc{white-space:pre-wrap !important;}
table{border-collapse:collapse;
width:100%;
table-layout:fixed;}
td,th{border:1px solid #888;}
td{border:1px solid #888;}
td>div,th>div{overflow-x:auto;
padding:0rem 1rem;}
td>div>table{table-layout:initial;}code[class*=language-],pre[class*=language-]{font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:.4em .8em;margin:.5em 0;overflow:auto;background-color:#000}code[class*=language-]{background:#000;color:#fff;box-shadow:-.3em 0 0 .3em #000,.3em 0 0 .3em #000}:not(pre)>code[class*=language-]{padding:.2em;border-radius:.3em;box-shadow:none;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#aaa}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.number,.token.property,.token.symbol,.token.tag{color:#0cf}.token.attr-name,.token.builtin,.token.char,.token.selector,.token.string{color:#ff0}.language-css .token.string,.token.entity,.token.inserted,.token.operator,.token.url,.token.variable{color:#9acd32}.token.atrule,.token.attr-value,.token.keyword{color:#ff1493}.token.important,.token.regex{color:orange}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.deleted{color:red}pre.diff-highlight.diff-highlight>code .token.deleted:not(.prefix),pre>code.diff-highlight.diff-highlight .token.deleted:not(.prefix){background-color:rgba(255,0,0,.3);display:inline}pre.diff-highlight.diff-highlight>code .token.inserted:not(.prefix),pre>code.diff-highlight.diff-highlight .token.inserted:not(.prefix){background-color:rgba(0,255,128,.3);display:inline}
.xd-checkbox-unchecked{list-style-type:"☐ "}.xd-checkbox-checked{list-style-type:"☑ "}.xd-checkbox-crossed{list-style-type:"☒ "}.xd-latex{text-transform:uppercase;font-size:1em;}.xd-latex>sub{vertical-align:-0.5ex;margin-left:-0.1667em;margin-right:-0.125em;}.xd-latex>sup{font-size:0.85em;vertical-align:0.15em;margin-left:-0.36em;margin-right:-0.15em;}xd-block-math{display:block}.xd-theorem-like{margin:1em 0}.xd-theorem-like>p{margin:0.5em 0}.golden-frame{border:3px solid gold;}</style></head><body>
td>div>table{table-layout:initial;}
th{background-color:var(--xidoc-color-darker);
font-family:var(--sans-serif);}code[class*=language-],pre[class*=language-]{font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:.4em .8em;margin:.5em 0;overflow:auto;background-color:#000}code[class*=language-]{background:#000;color:#fff;box-shadow:-.3em 0 0 .3em #000,.3em 0 0 .3em #000}:not(pre)>code[class*=language-]{padding:.2em;border-radius:.3em;box-shadow:none;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#aaa}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.number,.token.property,.token.symbol,.token.tag{color:#0cf}.token.attr-name,.token.builtin,.token.char,.token.selector,.token.string{color:#ff0}.language-css .token.string,.token.entity,.token.inserted,.token.operator,.token.url,.token.variable{color:#9acd32}.token.atrule,.token.attr-value,.token.keyword{color:#ff1493}.token.important,.token.regex{color:orange}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.deleted{color:red}pre.diff-highlight.diff-highlight>code .token.deleted:not(.prefix),pre>code.diff-highlight.diff-highlight .token.deleted:not(.prefix){background-color:rgba(255,0,0,.3);display:inline}pre.diff-highlight.diff-highlight>code .token.inserted:not(.prefix),pre>code.diff-highlight.diff-highlight .token.inserted:not(.prefix){background-color:rgba(0,255,128,.3);display:inline}
.xd-latex{text-transform:uppercase;font-size:1em;}.xd-latex>sub{vertical-align:-0.5ex;margin-left:-0.1667em;margin-right:-0.125em;}.xd-latex>sup{font-size:0.85em;vertical-align:0.15em;margin-left:-0.36em;margin-right:-0.15em;}.xd-checkbox-unchecked{list-style-type:"☐ "}.xd-checkbox-checked{list-style-type:"☑ "}.xd-checkbox-crossed{list-style-type:"☒ "}xd-block-math{display:block}.xd-theorem-like{margin:1em 0}.xd-theorem-like>p{margin:0.5em 0}.golden-frame{border:3px solid gold;}</style></head><body>

<header>
<h1><span class="xd-logo">ξ</span> xidoc</h1>


@@ 55,48 69,69 @@ td>div>table{table-layout:initial;}code[class*=language-],pre[class*=language-]{
<section id="(" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">(</span><span class="token punctuation">]</span></code></h4>Returns a left square bracket.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">I'm a sad robot :<span class="token punctuation">[</span><span class="token tag">(</span><span class="token punctuation">]</span></code></pre></td><td><div>I'm a sad robot :[</div></td></tr></table></section>
<section id="()" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">()</span> text<span class="token punctuation">]</span></code></h4>Wraps <code>text</code> in square brackets.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">()</span> this-is-not-a-command<span class="token punctuation">]</span></code></pre></td><td><div>[this-is-not-a-command]</div></td></tr></table></section>
<section id=")" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">)</span><span class="token punctuation">]</span></code></h4>Returns a right square bracket.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">I'm a happy robot :<span class="token punctuation">[</span><span class="token tag">)</span><span class="token punctuation">]</span></code></pre></td><td><div>I'm a happy robot :]</div></td></tr></table></section>
<section id="()" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">()</span> text<span class="token punctuation">]</span></code></h4>Wraps <code>text</code> in square brackets.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">()</span> this-is-not-a-command<span class="token punctuation">]</span></code></pre></td><td><div>[this-is-not-a-command]</div></td></tr></table></section>
<section id=";" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">;</span><span class="token punctuation">]</span></code></h4>Returns a semicolon. Useful for “escaping” semicolons in commands that take multiple arguments.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">list</span> This<span class="token punctuation">[</span><span class="token tag">;</span><span class="token punctuation">]</span> is<span class="token punctuation">[</span><span class="token tag">;</span><span class="token punctuation">]</span> only<span class="token punctuation">[</span><span class="token tag">;</span><span class="token punctuation">]</span> one<span class="token punctuation">[</span><span class="token tag">;</span><span class="token punctuation">]</span> item<span class="token punctuation">]</span></code></pre></td><td><div><ul><li>This; is; only; one; item</li></ul></div></td></tr></table></section>
<section id="\" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">\</span> text<span class="token punctuation">]</span></code></h4>Removes the least common indentation from all lines of , then returns it without expanding. A “smarter” version of <a href="#raw"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">raw</span><span class="token punctuation">]</span></code></a>.
<section id="space" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">space</span><span class="token punctuation">]</span></code></h4>Returns a space character. Useful in commands that strip whitespace.</section>
<section id="raw" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">raw</span> <span class="token string">text</span><span class="token punctuation">]</span></code></h4>Returns the given <code>text</code> without expanding it.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">raw</span> <span class="token string">[I can use [as many brackets [as I want]], but [they] still have to [[be balanced]]].</span><span class="token punctuation">]</span></code></pre></td><td><div>[I can use [as many brackets [as I want]], but [they] still have to [[be balanced]]].</div></td></tr></table>
<section id="\" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">\</span> text<span class="token punctuation">]</span></code></h5>Removes the least common indentation from all lines of <code>text</code>, then returns it without expanding. A “smarter” version of <a href="#raw"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">raw</span><span class="token punctuation">]</span></code></a>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code-block</span> nim<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">\</span>
  for word in <span class="token punctuation">[</span><span class="token tag">"This",</span> "correctly", "removes", "indentation"<span class="token punctuation">]</span>:
    echo word
<span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div><pre class="language-nim"><code class="language-nim"><span class="token keyword">for</span> word <span class="token operator">in</span> <span class="token punctuation">[</span><span class="token string">"This"</span><span class="token punctuation">,</span> <span class="token string">"correctly"</span><span class="token punctuation">,</span> <span class="token string">"removes"</span><span class="token punctuation">,</span> <span class="token string">"indentation"</span><span class="token punctuation">]</span><span class="token operator">:</span>
  echo word</code></pre></div></td></tr></table></section>
<section id="expand" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">expand</span> text<span class="token punctuation">]</span></code></h4>After expanding <code>text</code>, expands it again. Useful for complex command definitions.</section>
<section id="hide" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">hide</span> text<span class="token punctuation">]</span></code></h4>Expands <code>text</code> for its side effects, but doesn't return anything.</section>
  echo word</code></pre></div></td></tr></table></section></section>
<section id="pass" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">pass</span> code<span class="token punctuation">]</span></code></h4>Directly produces the given <code>code</code> without escaping it. Useful if you want to go outside the capabilities of xidoc. The <code>code</code> is still expanded so you can parametrize it, see the <a href="#pass-raw"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">pass-raw</span><span class="token punctuation">]</span></code></a> command if you don't want this.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">pass</span> &lt;em>Haha!&lt;/em> I'm in! &lt;code>'<span class="token punctuation">;</span> DROP TABLE xidoc<span class="token punctuation">;</span>&lt;/code> Oh no, this is a static site…<span class="token punctuation">]</span></code></pre></td><td><div><em>Haha!</em> I'm in! <code>'; DROP TABLE xidoc;</code> Oh no, this is a static site…</div></td></tr></table></section>
<section id="pass-raw" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">pass-raw</span> <span class="token string">code</span><span class="token punctuation">]</span></code></h4>Directly produces the given <code>code</code> without escaping it. Useful if you want to go outside the capabilities of xidoc. Works as a combination of <a href="#pass"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">pass</span><span class="token punctuation">]</span></code></a> and <a href="#raw"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">raw</span><span class="token punctuation">]</span></code></a>.</section>
<section id="add-to-head" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">add-to-head</span> directive<span class="token punctuation">]</span></code></h4>Adds the <code>directive</code> to the head of the document. Returns nothing.</section>
<section id="raw" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">raw</span> <span class="token string">text</span><span class="token punctuation">]</span></code></h4>Returns the given <code>text</code> without expanding it.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">raw</span> <span class="token string">[I can use [as many brackets [as I want]], but [they] still have to [[be balanced]]].</span><span class="token punctuation">]</span></code></pre></td><td><div>[I can use [as many brackets [as I want]], but [they] still have to [[be balanced]]].</div></td></tr></table></section>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">pass</span> &lt;em>Haha!&lt;/em> I'm in! &lt;code>'<span class="token punctuation">;</span> DROP TABLE xidoc<span class="token punctuation">;</span>&lt;/code> Oh no, this is a static site…<span class="token punctuation">]</span></code></pre></td><td><div><em>Haha!</em> I'm in! <code>'; DROP TABLE xidoc;</code> Oh no, this is a static site…</div></td></tr></table>
<section id="pass-raw" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">pass-raw</span> <span class="token string">code</span><span class="token punctuation">]</span></code></h5>Directly produces the given <code>code</code> without escaping it. Useful if you want to go outside the capabilities of xidoc. Works as a combination of <a href="#pass"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">pass</span><span class="token punctuation">]</span></code></a> and <a href="#raw"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">raw</span><span class="token punctuation">]</span></code></a>.</section></section>
<section id="hide" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">hide</span> text<span class="token punctuation">]</span></code></h4>Expands <code>text</code> for its side effects, but doesn't return anything.</section>
<section id="expand" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">expand</span> text<span class="token punctuation">]</span></code></h4>After expanding <code>text</code>, expands it again. Useful for complex command definitions.</section>
<section id="render" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">render</span> text<span class="token punctuation">]</span></code></h4>After expanding <code>text</code>, renders it. Useful for complex command definitions.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">render</span> <span class="token punctuation">[</span><span class="token tag">raw</span> <span class="token string">[it This will be italic despite being inside [ms raw].]</span><span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div><i>This will be italic despite being inside <code>raw</code>.</i></div></td></tr></table></section>
<section id="space" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">space</span><span class="token punctuation">]</span></code></h4>Returns a space character. Useful in commands that strip whitespace.</section></section>
<section><h3 class="xd-section-heading">Formatting</h3><section id="bf" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">bf</span> text<span class="token punctuation">]</span></code></h4>Renders <code>text</code> in bold face.
<section id="add-to-head" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">add-to-head</span> directive<span class="token punctuation">]</span></code></h4>Adds the <code>directive</code> to the head of the document. Returns nothing.</section></section>
<section><h3 class="xd-section-heading">Inline formatting</h3><section id="bf" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">bf</span> text<span class="token punctuation">]</span></code></h4>Renders <code>text</code> in bold face.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">xidoc is <span class="token punctuation">[</span><span class="token tag">bf</span> awesome<span class="token punctuation">]</span>!</code></pre></td><td><div>xidoc is <b>awesome</b>!</div></td></tr></table></section>
<section id="block-quote" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">block-quote</span> text<span class="token punctuation">]</span></code></h4>Creates a block quote.
<section id="code" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code</span> ?language<span class="token punctuation">;</span> code<span class="token punctuation">]</span></code></h4>Renders the <code>code</code> in monospace font. If the <code>language</code> is specified and the target is HTML, the code is syntax-highlighted during compilation using <a href="https://prismjs.com/">Prism</a>. See the <a href="https://prismjs.com/#supported-languages">list of supported languages</a> to know how to specify the <code>language</code>. xidoc is also supported under the name <code>xidoc</code>. For generic monospace text, use the <a href="#ms"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">ms</span><span class="token punctuation">]</span></code></a> command.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code</span> python<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">raw</span> <span class="token string">print(f"The answer to the universe and stuff is {6 * 7}.")</span><span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div><code class="language-python"><span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string-interpolation"><span class="token string">f"The answer to the universe and stuff is </span><span class="token interpolation"><span class="token punctuation">{</span><span class="token number">6</span> <span class="token operator">*</span> <span class="token number">7</span><span class="token punctuation">}</span></span><span class="token string">."</span></span><span class="token punctuation">)</span></code></div></td></tr></table></section>
<section id="color" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">color</span> color text<span class="token punctuation">]</span></code></h4>Colors the <code>text</code> in the given CSS-style <code>color</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">You can use <span class="token punctuation">[</span><span class="token tag">color</span> red<span class="token punctuation">;</span> names<span class="token punctuation">]</span> or <span class="token punctuation">[</span><span class="token tag">color</span> #00f<span class="token punctuation">;</span> codes<span class="token punctuation">]</span>!</code></pre></td><td><div>You can use <span style="color:red">names</span> or <span style="color:#00f">codes</span>!</div></td></tr></table></section>
<section id="it" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">it</span> text<span class="token punctuation">]</span></code></h4>Renders <code>text</code> in italics.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">xidoc is <span class="token punctuation">[</span><span class="token tag">it</span> fantastic!<span class="token punctuation">]</span></code></pre></td><td><div>xidoc is <i>fantastic!</i></div></td></tr></table></section>
<section id="lang" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">lang</span> language<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders <code>text</code> with the conventions of the specified <code>language</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">"</span> Hello!<span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token tag">lang</span> czech<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">"</span> Ahoj!<span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div>“Hello!” „Ahoj!“</div></td></tr></table></section>
<section id="link" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">link</span> ?text<span class="token punctuation">;</span> address<span class="token punctuation">]</span></code></h4>Adds a link to the given <code>address</code> with an optional <code>text</code> visually replacing the address.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">link</span> xidoc<span class="token punctuation">;</span> http://xidoc.nim.town/<span class="token punctuation">]</span> is made in <span class="token punctuation">[</span><span class="token tag">link</span> Nim<span class="token punctuation">;</span> https://nim-lang.org/<span class="token punctuation">]</span>.</code></pre></td><td><div><a href="http://xidoc.nim.town/">xidoc</a> is made in <a href="https://nim-lang.org/">Nim</a>.</div></td></tr></table></section>
<section id="ms" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">ms</span> text<span class="token punctuation">]</span></code></h4>Renders <code>text</code> in monospace. If you want to show code, it's recommended to use the <a href="#code"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code</span><span class="token punctuation">]</span></code></a> or <a href="#code-block"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code-block</span><span class="token punctuation">]</span></code></a> command instead.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">In HTML, this will produce <span class="token punctuation">[</span><span class="token tag">ms</span> &lt;code><span class="token punctuation">]</span>. In <span class="token punctuation">[</span><span class="token tag">LaTeX</span><span class="token punctuation">]</span>, this will produce <span class="token punctuation">[</span><span class="token tag">ms</span> \texttt<span class="token punctuation">]</span>.</code></pre></td><td><div>In HTML, this will produce <code>&lt;code></code>. In <span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span>, this will produce <code>\texttt</code>.</div></td></tr></table></section>
<section id="term" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">term</span> phrase<span class="token punctuation">]</span></code></h4>Introduces <code>phrase</code> as a new term. Useful in definitions.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">A <span class="token punctuation">[</span><span class="token tag">term</span> group<span class="token punctuation">]</span> is a monoid where every element has an inverse.</code></pre></td><td><div>A <dfn>group</dfn> is a monoid where every element has an inverse.</div></td></tr></table></section>
<section id="unit" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">unit</span> ?number<span class="token punctuation">;</span> unit<span class="token punctuation">]</span></code></h4>Renders a <code>unit</code> or a quantity expressed with a <code>number</code> and <code>unit</code>. Also works inside math commands.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">unit</span> 6378<span class="token punctuation">;</span> km<span class="token punctuation">]</span>, <span class="token punctuation">[</span><span class="token tag">$</span> <span class="token punctuation">[</span><span class="token tag">unit</span> 60<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">/</span> km<span class="token punctuation">;</span> h<span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div>6378 km, <xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>60</mn><mtext> </mtext><mfrac><mrow><mi mathvariant="normal">k</mi><mi mathvariant="normal">m</mi></mrow><mi mathvariant="normal">h</mi></mfrac></mrow><annotation encoding="application/x-tex">60\,\frac{\mathrm{km}}{\mathrm{h}}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.2251079999999999em;vertical-align:-0.345em;"></span><span class="mord">60</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8801079999999999em;"><span style="top:-2.6550000000000002em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathrm mtight">h</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">km</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></xd-inline-math></div></td></tr></table></section></section>
<section><h3 class="xd-section-heading">Block formatting</h3><section id="block-quote" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">block-quote</span> text<span class="token punctuation">]</span></code></h4>Creates a block quote.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">p</span> The first rule in the Zen of Nim is:<span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token tag">block-quote</span> Copying bad design is not good design.<span class="token punctuation">]</span></code></pre></td><td><div><p>The first rule in the Zen of Nim is:</p> <blockquote>Copying bad design is not good design.</blockquote></div></td></tr></table></section>
<section id="checkboxes" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">checkboxes</span> items<span class="token punctuation">]</span></code></h4>Renders a list of <code>items</code> with checkboxes. Use <code>[-]</code> for an unchecked item, <code>[v]</code> for a checked item and <code>[x]</code> for a crossed item.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">checkboxes</span> <span class="token punctuation">[</span><span class="token tag">v</span> Kill the friend<span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token tag">-</span> Bury the body<span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token tag">x</span> Get caught by the police<span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div><ul class="xd-checkboxes"><li class="xd-checkbox-checked">Kill the friend</li> <li class="xd-checkbox-unchecked">Bury the body</li> <li class="xd-checkbox-crossed">Get caught by the police</li></ul></div></td></tr></table></section>
<section id="code" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code</span> ?language<span class="token punctuation">;</span> code<span class="token punctuation">]</span></code></h4>Renders the <code>code</code> in monospace font. If the <code>language</code> is specified and the target is HTML, the code is syntax-highlighted during compilation using <a href="https://prismjs.com/">Prism</a>. See the <a href="https://prismjs.com/#supported-languages">list of supported languages</a> to know how to specify the <code>language</code>. xidoc is also supported under the name <code>xidoc</code>. For generic monospace text, use the <a href="#ms"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">ms</span><span class="token punctuation">]</span></code></a> command.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code</span> python<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">raw</span> <span class="token string">print(f"The answer to the universe and stuff is {6 * 7}.")</span><span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div><code class="language-python"><span class="token keyword">print</span><span class="token punctuation">(</span><span class="token string-interpolation"><span class="token string">f"The answer to the universe and stuff is </span><span class="token interpolation"><span class="token punctuation">{</span><span class="token number">6</span> <span class="token operator">*</span> <span class="token number">7</span><span class="token punctuation">}</span></span><span class="token string">."</span></span><span class="token punctuation">)</span></code></div></td></tr></table></section>
<section id="code-block" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code-block</span> ?language<span class="token punctuation">;</span> code<span class="token punctuation">]</span></code></h4>Renders the <code>code</code> as a block in monospace font. If the <code>language</code> is specified and the target is HTML, the code is syntax-highlighted during compilation using <a href="https://prismjs.com/">Prism</a>. See the <a href="https://prismjs.com/#supported-languages">list of supported languages</a> to know how to specify the <code>language</code>. xidoc is also supported under the name <code>xidoc</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code-block</span> javascript<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">raw</span>


@@ 114,46 149,16 @@ td>div>table{table-layout:initial;}code[class*=language-],pre[class*=language-]{
  <span class="token punctuation">}</span>
  <span class="token keyword control-flow">return</span> result<span class="token punctuation">;</span>
<span class="token punctuation">}</span></code></pre></div></td></tr></table></section>
<section id="color" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">color</span> color text<span class="token punctuation">]</span></code></h4>Colors the <code>text</code> in the given CSS-style <code>color</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">You can use <span class="token punctuation">[</span><span class="token tag">color</span> red<span class="token punctuation">;</span> names<span class="token punctuation">]</span> or <span class="token punctuation">[</span><span class="token tag">color</span> #00f<span class="token punctuation">;</span> codes<span class="token punctuation">]</span>!</code></pre></td><td><div>You can use <span style="color:red">names</span> or <span style="color:#00f">codes</span>!</div></td></tr></table></section>
<section id="header-row" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">header-row</span> *fields<span class="token punctuation">]</span></code></h4>Creates a header row for a table with the given fields. Has to be used inside a <a href="#table"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">table</span><span class="token punctuation">]</span></code></a> command.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">table</span>
  <span class="token punctuation">[</span><span class="token tag">header-row</span> xidoc<span class="token punctuation">;</span> HTML<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">LaTeX</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
  <span class="token punctuation">[</span><span class="token tag">row</span> <span class="token punctuation">[</span><span class="token tag">code</span> xidoc<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">()</span> table<span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">code</span> html<span class="token punctuation">;</span> &lt;table>&lt;/table><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">code</span> latex<span class="token punctuation">;</span> \begin{table}{<span class="token punctuation">[</span><span class="token tag">...</span><span class="token punctuation">]</span>}\end{table}<span class="token punctuation">]</span><span class="token punctuation">]</span>
<span class="token punctuation">]</span></code></pre></td><td><div><table><tr><th>xidoc</th><th>HTML</th><th><span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span></th></tr>
<tr><td><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">table</span><span class="token punctuation">]</span></code></td><td><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>table</span><span class="token punctuation">></span></span></code></td><td><code class="language-latex"><span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">table</span><span class="token punctuation">}</span><span class="token punctuation">{</span>…<span class="token punctuation">}</span><span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">table</span><span class="token punctuation">}</span></code></td></tr></table></div></td></tr></table></section>
<section id="it" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">it</span> text<span class="token punctuation">]</span></code></h4>Renders <code>text</code> in italics.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">xidoc is <span class="token punctuation">[</span><span class="token tag">it</span> fantastic!<span class="token punctuation">]</span></code></pre></td><td><div>xidoc is <i>fantastic!</i></div></td></tr></table></section>
<section id="lang" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">lang</span> language<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders <code>text</code> in the specified <code>language</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">"</span> Hello!<span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token tag">lang</span> czech<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">"</span> Ahoj!<span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div>“Hello!” „Ahoj!“</div></td></tr></table></section>
<section id="link" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">link</span> ?text<span class="token punctuation">;</span> address<span class="token punctuation">]</span></code></h4>Adds a link to the given <code>address</code> with an optional <code>text</code> visually replacing the address.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">link</span> xidoc<span class="token punctuation">;</span> http://xidoc.nim.town/<span class="token punctuation">]</span> is made in <span class="token punctuation">[</span><span class="token tag">link</span> Nim<span class="token punctuation">;</span> https://nim-lang.org/<span class="token punctuation">]</span>.</code></pre></td><td><div><a href="http://xidoc.nim.town/">xidoc</a> is made in <a href="https://nim-lang.org/">Nim</a>.</div></td></tr></table></section>
<section id="list" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">list</span> *items<span class="token punctuation">]</span></code></h4>Creates an unordered list of <code>items</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">Supported targets: <span class="token punctuation">[</span><span class="token tag">list</span> HTML<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">LaTeX</span><span class="token punctuation">]</span><span class="token punctuation">;</span> Gemtext<span class="token punctuation">]</span></code></pre></td><td><div>Supported targets: <ul><li>HTML</li><li><span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span></li><li>Gemtext</li></ul></div></td></tr></table></section>
<section id="ms" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">ms</span> text<span class="token punctuation">]</span></code></h4>Renders <code>text</code> in monospace. If you want to show code, it's recommended to use the <a href="#code"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code</span><span class="token punctuation">]</span></code></a> or <a href="#code-block"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code-block</span><span class="token punctuation">]</span></code></a> command instead.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">In HTML, this will produce <span class="token punctuation">[</span><span class="token tag">ms</span> &lt;code><span class="token punctuation">]</span>. In <span class="token punctuation">[</span><span class="token tag">LaTeX</span><span class="token punctuation">]</span>, this will produce <span class="token punctuation">[</span><span class="token tag">ms</span> \texttt<span class="token punctuation">]</span>.</code></pre></td><td><div>In HTML, this will produce <code>&lt;code></code>. In <span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span>, this will produce <code>\texttt</code>.</div></td></tr></table></section>
<section id="ordered-list" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">ordered-list</span> *items<span class="token punctuation">]</span></code></h4>Creates an ordered list of <code>items</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">TOP 5 LIST OF SMALLEST POSITIVE INTEGERS: <span class="token punctuation">[</span><span class="token tag">ordered-list</span> 1<span class="token punctuation">;</span> 2<span class="token punctuation">;</span> 3<span class="token punctuation">;</span> 4<span class="token punctuation">;</span> 5<span class="token punctuation">]</span></code></pre></td><td><div>TOP 5 LIST OF SMALLEST POSITIVE INTEGERS: <ol><li>1</li><li>2</li><li>3</li><li>4</li><li>5</li></ol></div></td></tr></table></section>
<section id="p" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">p</span> text<span class="token punctuation">]</span></code></h4>Creates a paragraph with the given <code>text</code>.</section>
<section id="row" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">row</span> *fields<span class="token punctuation">]</span></code></h4>Creates a row for a table with the given fields. Has to be used inside a <a href="#table"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">table</span><span class="token punctuation">]</span></code></a> command.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">table</span>
  <span class="token punctuation">[</span><span class="token tag">header-row</span> xidoc<span class="token punctuation">;</span> HTML<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">LaTeX</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
  <span class="token punctuation">[</span><span class="token tag">row</span> <span class="token punctuation">[</span><span class="token tag">code</span> xidoc<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">()</span> table<span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">code</span> html<span class="token punctuation">;</span> &lt;table>&lt;/table><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">code</span> latex<span class="token punctuation">;</span> \begin{table}{<span class="token punctuation">[</span><span class="token tag">...</span><span class="token punctuation">]</span>}\end{table}<span class="token punctuation">]</span><span class="token punctuation">]</span>
<span class="token punctuation">]</span></code></pre></td><td><div><table><tr><th>xidoc</th><th>HTML</th><th><span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span></th></tr>
<tr><td><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">table</span><span class="token punctuation">]</span></code></td><td><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>table</span><span class="token punctuation">></span></span></code></td><td><code class="language-latex"><span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">table</span><span class="token punctuation">}</span><span class="token punctuation">{</span>…<span class="token punctuation">}</span><span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">table</span><span class="token punctuation">}</span></code></td></tr></table></div></td></tr></table></section>
<section id="section" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">section</span> ?title<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Creates a section with the given <code>title</code> and <code>text</code> (or without a title if not given). If it's inside another section, it will be a subsection. If it's inside a subsection, it will be a subsubsection. In HTML, this nesting can continue further.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">section</span> Inception<span class="token punctuation">;</span> Are we going too deep?<span class="token punctuation">]</span></code></pre></td><td><div><section><h5 class="xd-section-heading">Inception</h5>Are we going too deep?</section></div></td></tr></table></section>
<section id="show-title" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">show-title</span> title<span class="token punctuation">]</span></code></h4>Renders the given <code>title</code> without setting it as the title of the document.</section>
<section id="spoiler" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">spoiler</span> visible<span class="token punctuation">;</span> secret<span class="token punctuation">]</span></code></h4>Hides the <code>secret</code> text until the <code>visible</code> text is clicked. Works only in environments that support interactivity.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">spoiler</span> In the series <span class="token punctuation">[</span><span class="token tag">it</span> The Simpsons<span class="token punctuation">]</span>, the surname of the main characters is<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">it</span> Simpson<span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div><details class="xd-spoiler"><summary>In the series <i>The Simpsons</i>, the surname of the main characters is</summary><i>Simpson</i></details></div></td></tr></table></section>


@@ 163,14 168,11 @@ td>div>table{table-layout:initial;}code[class*=language-],pre[class*=language-]{
  <span class="token punctuation">[</span><span class="token tag">header-row</span> xidoc<span class="token punctuation">;</span> HTML<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">LaTeX</span><span class="token punctuation">]</span><span class="token punctuation">]</span>
  <span class="token punctuation">[</span><span class="token tag">row</span> <span class="token punctuation">[</span><span class="token tag">code</span> xidoc<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">()</span> table<span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">code</span> html<span class="token punctuation">;</span> &lt;table>&lt;/table><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">code</span> latex<span class="token punctuation">;</span> \begin{table}{<span class="token punctuation">[</span><span class="token tag">...</span><span class="token punctuation">]</span>}\end{table}<span class="token punctuation">]</span><span class="token punctuation">]</span>
<span class="token punctuation">]</span></code></pre></td><td><div><table><tr><th>xidoc</th><th>HTML</th><th><span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span></th></tr>
<tr><td><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">table</span><span class="token punctuation">]</span></code></td><td><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>table</span><span class="token punctuation">></span></span></code></td><td><code class="language-latex"><span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">table</span><span class="token punctuation">}</span><span class="token punctuation">{</span>…<span class="token punctuation">}</span><span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">table</span><span class="token punctuation">}</span></code></td></tr></table></div></td></tr></table></section>
<section id="term" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">term</span> phrase<span class="token punctuation">]</span></code></h4>Introduces <code>phrase</code> as a new term. Useful in definitions.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">A <span class="token punctuation">[</span><span class="token tag">term</span> group<span class="token punctuation">]</span> is a monoid where every element has an inverse.</code></pre></td><td><div>A <dfn>group</dfn> is a monoid where every element has an inverse.</div></td></tr></table></section>
<section id="title" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">title</span> title<span class="token punctuation">;</span> ?author<span class="token punctuation">]</span></code></h4>Renders the given <code>title</code> and sets it as the title of the document. If an <code>author</code> is specified, their name is mentioned under the title.</section>
<section id="unit" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">unit</span> ?number<span class="token punctuation">;</span> unit<span class="token punctuation">]</span></code></h4>Renders a <code>unit</code> or a quantity expressed with a <code>number</code> and <code>unit</code>. Also works inside math commands.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">unit</span> 6378<span class="token punctuation">;</span> km<span class="token punctuation">]</span>, <span class="token punctuation">[</span><span class="token tag">$</span> <span class="token punctuation">[</span><span class="token tag">unit</span> 60<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">/</span> km<span class="token punctuation">;</span> h<span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div>6378 km, <xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>60</mn><mtext> </mtext><mfrac><mrow><mi mathvariant="normal">k</mi><mi mathvariant="normal">m</mi></mrow><mi mathvariant="normal">h</mi></mfrac></mrow><annotation encoding="application/x-tex">60\,\frac{\mathrm{km}}{\mathrm{h}}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.2251079999999999em;vertical-align:-0.345em;"></span><span class="mord">60</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.8801079999999999em;"><span style="top:-2.6550000000000002em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathrm mtight">h</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight"><span class="mord mathrm mtight">km</span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.345em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></xd-inline-math></div></td></tr></table></section></section>
<tr><td><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">table</span><span class="token punctuation">]</span></code></td><td><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>table</span><span class="token punctuation">></span></span></code></td><td><code class="language-latex"><span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">table</span><span class="token punctuation">}</span><span class="token punctuation">{</span>…<span class="token punctuation">}</span><span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">table</span><span class="token punctuation">}</span></code></td></tr></table></div></td></tr></table>
<section id="row" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">row</span> *fields<span class="token punctuation">]</span></code></h5>Creates a row for a table with the given fields. Has to be used inside a <a href="#table"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">table</span><span class="token punctuation">]</span></code></a> command.</section>
<section id="header-row" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">header-row</span> *fields<span class="token punctuation">]</span></code></h5>Creates a header row for a table with the given fields. Has to be used inside a <a href="#table"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">table</span><span class="token punctuation">]</span></code></a> command.</section></section>
<section id="title" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">title</span> title<span class="token punctuation">;</span> ?author<span class="token punctuation">]</span></code></h4>Renders the given <code>title</code> and sets it as the title of the document. If an <code>author</code> is specified, their name is mentioned under the title.
<section id="show-title" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">show-title</span> title<span class="token punctuation">]</span></code></h5>Renders the given <code>title</code> without setting it as the title of the document.</section></section></section>
<section><h3 class="xd-section-heading">Unicode characters</h3><section id="&quot;" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">"</span> text<span class="token punctuation">]</span></code></h4>Puts the given text in quotation marks appropriate for the current language.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">"</span> Hello!<span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token tag">lang</span> czech<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">"</span> Ahoj!<span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div>“Hello!” „Ahoj!“</div></td></tr></table></section>


@@ 183,15 185,16 @@ td>div>table{table-layout:initial;}code[class*=language-],pre[class*=language-]{
<section id="..." class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">...</span><span class="token punctuation">]</span></code></h4>Returns an ellipsis: <code>…</code>
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">You can't just substitute three dots for an ellipsis<span class="token punctuation">[</span><span class="token tag">...</span><span class="token punctuation">]</span></code></pre></td><td><div>You can't just substitute three dots for an ellipsis…</div></td></tr></table></section></section>
<section><h3 class="xd-section-heading">Math</h3><section id="$" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">$</span> latex<span class="token punctuation">]</span></code></h4>Renders <span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span> inline math.
<section><h3 class="xd-section-heading">Math</h3><p>In HTML, <span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span> math is rendered using <a href="https://katex.org/">KaTeX</a>. This requires a stylesheet and fonts, which are downloaded from the <a href="https://www.jsdelivr.com/">jsDelivr</a> CDN by default. If you'd like to use a different CDN or self-hoost the files, use <code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">set</span> katex-stylesheet-path<span class="token punctuation">;</span> path/to/katex.min.css<span class="token punctuation">]</span></code> to point xidoc to the stylesheet.</p>
<section id="$" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">$</span> latex<span class="token punctuation">]</span></code></h4>Renders <span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span> inline math.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc">Einstein's famous equation is <span class="token punctuation">[</span><span class="token tag">$</span> E = m c^2<span class="token punctuation">]</span>.</code></pre></td><td><div>Einstein's famous equation is <xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi><mo>=</mo><mi>m</mi><msup><mi>c</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">E = m c^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathnormal" style="margin-right:0.05764em;">E</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord mathnormal">m</span><span class="mord"><span class="mord mathnormal">c</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></xd-inline-math>.</div></td></tr></table></section>
<section id="$$" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">$$</span> latex<span class="token punctuation">]</span></code></h4>Renders <span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span> block math.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">$$</span> (A+B)^n = \sum_{k=0}^n {n \choose k} A^{n-k} B^k<span class="token punctuation">]</span></code></pre></td><td><div><xd-block-math><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mi>A</mi><mo>+</mo><mi>B</mi><msup><mo stretchy="false">)</mo><mi>n</mi></msup><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi>n</mi></munderover><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mi>n</mi><mi>k</mi></mfrac><mo fence="true">)</mo></mrow><msup><mi>A</mi><mrow><mi>n</mi><mo>−</mo><mi>k</mi></mrow></msup><msup><mi>B</mi><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">(A+B)^n = \sum_{k=0}^n {n \choose k} A^{n-k} B^k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">A</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7143919999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:2.9535100000000005em;vertical-align:-1.302113em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.6513970000000002em;"><span style="top:-1.8478869999999998em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span><span class="mrel mtight">=</span><span class="mord mtight">0</span></span></span></span><span style="top:-3.0500049999999996em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.300005em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.302113em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.1075599999999999em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03148em;">k</span></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span></span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991079999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">n</span><span class="mbin mtight">−</span><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991079999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span></span></xd-block-math></div></td></tr></table></section>
<section id="$$&amp;" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">$$&amp;</span> latex<span class="token punctuation">]</span></code></h4>Renders <span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span> aligned block math (with the <code>align</code> environment).
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">$$</span> (A+B)^n = \sum_{k=0}^n {n \choose k} A^{n-k} B^k<span class="token punctuation">]</span></code></pre></td><td><div><xd-block-math><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mi>A</mi><mo>+</mo><mi>B</mi><msup><mo stretchy="false">)</mo><mi>n</mi></msup><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi>n</mi></munderover><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mi>n</mi><mi>k</mi></mfrac><mo fence="true">)</mo></mrow><msup><mi>A</mi><mrow><mi>n</mi><mo>−</mo><mi>k</mi></mrow></msup><msup><mi>B</mi><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">(A+B)^n = \sum_{k=0}^n {n \choose k} A^{n-k} B^k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">A</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="mclose"><span class="mclose">)</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7143919999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:2.9535100000000005em;vertical-align:-1.302113em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.6513970000000002em;"><span style="top:-1.8478869999999998em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span><span class="mrel mtight">=</span><span class="mord mtight">0</span></span></span></span><span style="top:-3.0500049999999996em;"><span class="pstrut" style="height:3.05em;"></span><span><span class="mop op-symbol large-op">∑</span></span></span><span style="top:-4.300005em;margin-left:0em;"><span class="pstrut" style="height:3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.302113em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.1075599999999999em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03148em;">k</span></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">n</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span></span><span class="mord"><span class="mord mathnormal">A</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991079999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">n</span><span class="mbin mtight">−</span><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.05017em;">B</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8991079999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span></span></span></span></span></span></span></span></span></xd-block-math></div></td></tr></table>
<section id="$$&amp;" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">$$&amp;</span> latex<span class="token punctuation">]</span></code></h5>Renders <span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span> aligned block math (with the <code>align</code> environment).
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">$$&amp;</span> ((f \circ g) \circ h)(x) &amp;= f(g(h(x))) \\ &amp;= (f \circ (g \circ h))(x)<span class="token punctuation">]</span></code></pre></td><td><div><xd-block-math><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.2500em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo stretchy="false">(</mo><mo stretchy="false">(</mo><mi>f</mi><mo>∘</mo><mi>g</mi><mo stretchy="false">)</mo><mo>∘</mo><mi>h</mi><mo stretchy="false">)</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>f</mi><mo stretchy="false">(</mo><mi>g</mi><mo stretchy="false">(</mo><mi>h</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo stretchy="false">)</mo><mo stretchy="false">)</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo stretchy="false">(</mo><mi>f</mi><mo>∘</mo><mo stretchy="false">(</mo><mi>g</mi><mo>∘</mo><mi>h</mi><mo stretchy="false">)</mo><mo stretchy="false">)</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}((f \circ g) \circ h)(x) &amp;= f(g(h(x))) \\ &amp;= (f \circ (g \circ h))(x)\end{align*}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3.0000000000000004em;vertical-align:-1.2500000000000002em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.7500000000000002em;"><span style="top:-3.91em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mopen">((</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">∘</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">∘</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathnormal">h</span><span class="mclose">)</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2500000000000002em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.7500000000000002em;"><span style="top:-3.91em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mopen">(</span><span class="mord mathnormal">h</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)))</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">∘</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">∘</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathnormal">h</span><span class="mclose">))</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2500000000000002em;"><span></span></span></span></span></span></span></span></span></span></span></span></xd-block-math></div></td></tr></table></section>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">$$&amp;</span> ((f \circ g) \circ h)(x) &amp;= f(g(h(x))) \\ &amp;= (f \circ (g \circ h))(x)<span class="token punctuation">]</span></code></pre></td><td><div><xd-block-math><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.2500em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo stretchy="false">(</mo><mo stretchy="false">(</mo><mi>f</mi><mo>∘</mo><mi>g</mi><mo stretchy="false">)</mo><mo>∘</mo><mi>h</mi><mo stretchy="false">)</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mi>f</mi><mo stretchy="false">(</mo><mi>g</mi><mo stretchy="false">(</mo><mi>h</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo><mo stretchy="false">)</mo><mo stretchy="false">)</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mo stretchy="false">(</mo><mi>f</mi><mo>∘</mo><mo stretchy="false">(</mo><mi>g</mi><mo>∘</mo><mi>h</mi><mo stretchy="false">)</mo><mo stretchy="false">)</mo><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}((f \circ g) \circ h)(x) &amp;= f(g(h(x))) \\ &amp;= (f \circ (g \circ h))(x)\end{align*}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:3.0000000000000004em;vertical-align:-1.2500000000000002em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.7500000000000002em;"><span style="top:-3.91em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mopen">((</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">∘</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">∘</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathnormal">h</span><span class="mclose">)</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2500000000000002em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.7500000000000002em;"><span style="top:-3.91em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mopen">(</span><span class="mord mathnormal">h</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)))</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">∘</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">∘</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathnormal">h</span><span class="mclose">))</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:1.2500000000000002em;"><span></span></span></span></span></span></span></span></span></span></span></span></xd-block-math></div></td></tr></table></section></section>
<section id="matext" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">matext</span> latex<span class="token punctuation">]</span></code></h4>Renders the given <span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span> <code>math</code> using <a href="https://xigoi.srht.site/matext/">maTeXt</a> and presents it as preformatted text.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">matext</span> \vec x \cdot \vec y = \sum_{i=0}^n x_i \cdot y_i<span class="token punctuation">]</span></code></pre></td><td><div><pre class="xd-matext">          𝑛          


@@ 200,22 203,22 @@ td>div>table{table-layout:initial;}code[class*=language-],pre[class*=language-]{
<section id="dfn" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">dfn</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders a mathematical definition paragraph with an optional <code>name</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">dfn</span> An <span class="token punctuation">[</span><span class="token tag">term</span> inertial system<span class="token punctuation">]</span> is a system where the law of inertia holds.<span class="token punctuation">]</span></code></pre></td><td><div><div class="xd-theorem-like xd-dfn"><strong>Definition.</strong> An <dfn>inertial system</dfn> is a system where the law of inertia holds.</div></div></td></tr></table></section>
<section id="theorem" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">theorem</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders a mathematical theorem paragraph with an optional <code>name</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">theorem</span> Pythagorean<span class="token punctuation">;</span> In a right triangle with legs <span class="token punctuation">[</span><span class="token tag">$</span> a,b<span class="token punctuation">]</span> and hypotenuse <span class="token punctuation">[</span><span class="token tag">$</span> c<span class="token punctuation">]</span>, <span class="token punctuation">[</span><span class="token tag">$</span> a^2 + b^2 = c^2<span class="token punctuation">]</span>.<span class="token punctuation">]</span></code></pre></td><td><div><div class="xd-theorem-like xd-theorem"><strong>Theorem (Pythagorean).</strong> In a right triangle with legs <xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo separator="true">,</mo><mi>b</mi></mrow><annotation encoding="application/x-tex">a,b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8888799999999999em;vertical-align:-0.19444em;"></span><span class="mord mathnormal">a</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord mathnormal">b</span></span></span></span></xd-inline-math> and hypotenuse <xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">c</span></span></span></span></xd-inline-math>, <xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup><mo>=</mo><msup><mi>c</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">a^2 + b^2 = c^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.897438em;vertical-align:-0.08333em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathnormal">b</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathnormal">c</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></xd-inline-math>.</div></div></td></tr></table></section>
<section id="proof" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">proof</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders a mathematical proof paragraph with an optional <code>name</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">proof</span> Left as an exercise to the reader.<span class="token punctuation">]</span></code></pre></td><td><div><div class="xd-theorem-like xd-proof"><strong>Proof.</strong> Left as an exercise to the reader.</div></div></td></tr></table></section>
<section id="example" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">example</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders a mathematical example paragraph with an optional <code>name</code>.</section>
<section id="exercise" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">exercise</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders a mathematical exercise paragraph with an optional <code>name</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">exercise</span> Determine if the Collatz sequence reaches <span class="token punctuation">[</span><span class="token tag">$</span> 1<span class="token punctuation">]</span> for every initial value.<span class="token punctuation">]</span></code></pre></td><td><div><div class="xd-theorem-like xd-exercise"><strong>Exercise.</strong> Determine if the Collatz sequence reaches <xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.64444em;vertical-align:0em;"></span><span class="mord">1</span></span></span></span></xd-inline-math> for every initial value.</div></div></td></tr></table></section>
<section id="lemma" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">lemma</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders a mathematical lemma paragraph with an optional <code>name</code>.</section>
<section id="proof" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">proof</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders a mathematical proof paragraph with an optional <code>name</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">proof</span> Left as an exercise to the reader.<span class="token punctuation">]</span></code></pre></td><td><div><div class="xd-theorem-like xd-proof"><strong>Proof.</strong> Left as an exercise to the reader.</div></div></td></tr></table></section>
<section id="solution" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">solution</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders a paragraph with the solution to a mathematical problem with an optional <code>name</code>.
<section id="spoiler-solution" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">spoiler-solution</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h5>Renders a paragraph with the solution to a mathematical problem with an optional <code>name</code>. In environments that support interactivity, the <code>text</code> is hidden inside a spoiler (see the <a href="#spoiler"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">spoiler</span><span class="token punctuation">]</span></code></a> command).</section></section>
<section id="props" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">props</span> *properties<span class="token punctuation">]</span></code></h4>Creates a list of mathematical <code>properties</code>. Currently the same as <a href="#list"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">list</span><span class="token punctuation">]</span></code></a>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">props</span> <span class="token punctuation">[</span><span class="token tag">$</span> \forall x,y,z \in G: (xy)z = x(yz)<span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">$</span> \exists e \in G, \forall x \in G: ex = x = xe<span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">$</span> \forall x \in G, \exists x^{-1} \in G: xx^{-1} = e = x^{-1}x<span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div><ul><li><xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∀</mi><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo separator="true">,</mo><mi>z</mi><mo>∈</mo><mi>G</mi><mo>:</mo><mo stretchy="false">(</mo><mi>x</mi><mi>y</mi><mo stretchy="false">)</mo><mi>z</mi><mo>=</mo><mi>x</mi><mo stretchy="false">(</mo><mi>y</mi><mi>z</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\forall x,y,z \in G: (xy)z = x(yz)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8888799999999999em;vertical-align:-0.19444em;"></span><span class="mord">∀</span><span class="mord mathnormal">x</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">y</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord mathnormal" style="margin-right:0.04398em;">z</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathnormal">G</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mord mathnormal" style="margin-right:0.03588em;">y</span><span class="mclose">)</span><span class="mord mathnormal" style="margin-right:0.04398em;">z</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">x</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.04398em;">yz</span><span class="mclose">)</span></span></span></span></xd-inline-math></li><li><xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∃</mi><mi>e</mi><mo>∈</mo><mi>G</mi><mo separator="true">,</mo><mi mathvariant="normal">∀</mi><mi>x</mi><mo>∈</mo><mi>G</mi><mo>:</mo><mi>e</mi><mi>x</mi><mo>=</mo><mi>x</mi><mo>=</mo><mi>x</mi><mi>e</mi></mrow><annotation encoding="application/x-tex">\exists e \in G, \forall x \in G: ex = x = xe</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.73354em;vertical-align:-0.0391em;"></span><span class="mord">∃</span><span class="mord mathnormal">e</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.8888799999999999em;vertical-align:-0.19444em;"></span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">∀</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathnormal">G</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">e</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">x</span><span class="mord mathnormal">e</span></span></span></span></xd-inline-math></li><li><xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∀</mi><mi>x</mi><mo>∈</mo><mi>G</mi><mo separator="true">,</mo><mi mathvariant="normal">∃</mi><msup><mi>x</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mo>∈</mo><mi>G</mi><mo>:</mo><mi>x</mi><msup><mi>x</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mo>=</mo><mi>e</mi><mo>=</mo><msup><mi>x</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mi>x</mi></mrow><annotation encoding="application/x-tex">\forall x \in G, \exists x^{-1} \in G: xx^{-1} = e = x^{-1}x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.73354em;vertical-align:-0.0391em;"></span><span class="mord">∀</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1.008548em;vertical-align:-0.19444em;"></span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">∃</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">−</span><span class="mord mtight">1</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathnormal">G</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord mathnormal">x</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">−</span><span class="mord mtight">1</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">e</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">−</span><span class="mord mtight">1</span></span></span></span></span></span></span></span></span><span class="mord mathnormal">x</span></span></span></span></xd-inline-math></li></ul></div></td></tr></table></section>
<section id="solution" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">solution</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders a paragraph with the solution to a mathematical problem with an optional <code>name</code>.</section>
<section id="spoiler-solution" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">spoiler-solution</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders a paragraph with the solution to a mathematical problem with an optional <code>name</code>. In environments that support interactivity, the <code>text</code> is hidden inside a spoiler (see the <a href="#spoiler"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">spoiler</span><span class="token punctuation">]</span></code></a> command).</section>
<section id="theorem" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">theorem</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders a mathematical theorem paragraph with an optional <code>name</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">theorem</span> Pythagorean<span class="token punctuation">;</span> In a right triangle with legs <span class="token punctuation">[</span><span class="token tag">$</span> a,b<span class="token punctuation">]</span> and hypotenuse <span class="token punctuation">[</span><span class="token tag">$</span> c<span class="token punctuation">]</span>, <span class="token punctuation">[</span><span class="token tag">$</span> a^2 + b^2 = c^2<span class="token punctuation">]</span>.<span class="token punctuation">]</span></code></pre></td><td><div><div class="xd-theorem-like xd-theorem"><strong>Theorem (Pythagorean).</strong> In a right triangle with legs <xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo separator="true">,</mo><mi>b</mi></mrow><annotation encoding="application/x-tex">a,b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8888799999999999em;vertical-align:-0.19444em;"></span><span class="mord mathnormal">a</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord mathnormal">b</span></span></span></span></xd-inline-math> and hypotenuse <xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">c</span></span></span></span></xd-inline-math>, <xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup><mo>=</mo><msup><mi>c</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">a^2 + b^2 = c^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.897438em;vertical-align:-0.08333em;"></span><span class="mord"><span class="mord mathnormal">a</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathnormal">b</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathnormal">c</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></xd-inline-math>.</div></div></td></tr></table></section></section>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">props</span> <span class="token punctuation">[</span><span class="token tag">$</span> \forall x,y,z \in G: (xy)z = x(yz)<span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">$</span> \exists e \in G, \forall x \in G: ex = x = xe<span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">$</span> \forall x \in G, \exists x^{-1} \in G: xx^{-1} = e = x^{-1}x<span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div><ul><li><xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∀</mi><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo separator="true">,</mo><mi>z</mi><mo>∈</mo><mi>G</mi><mo>:</mo><mo stretchy="false">(</mo><mi>x</mi><mi>y</mi><mo stretchy="false">)</mo><mi>z</mi><mo>=</mo><mi>x</mi><mo stretchy="false">(</mo><mi>y</mi><mi>z</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\forall x,y,z \in G: (xy)z = x(yz)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8888799999999999em;vertical-align:-0.19444em;"></span><span class="mord">∀</span><span class="mord mathnormal">x</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">y</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord mathnormal" style="margin-right:0.04398em;">z</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathnormal">G</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mord mathnormal" style="margin-right:0.03588em;">y</span><span class="mclose">)</span><span class="mord mathnormal" style="margin-right:0.04398em;">z</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">x</span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.04398em;">yz</span><span class="mclose">)</span></span></span></span></xd-inline-math></li><li><xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∃</mi><mi>e</mi><mo>∈</mo><mi>G</mi><mo separator="true">,</mo><mi mathvariant="normal">∀</mi><mi>x</mi><mo>∈</mo><mi>G</mi><mo>:</mo><mi>e</mi><mi>x</mi><mo>=</mo><mi>x</mi><mo>=</mo><mi>x</mi><mi>e</mi></mrow><annotation encoding="application/x-tex">\exists e \in G, \forall x \in G: ex = x = xe</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.73354em;vertical-align:-0.0391em;"></span><span class="mord">∃</span><span class="mord mathnormal">e</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.8888799999999999em;vertical-align:-0.19444em;"></span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">∀</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathnormal">G</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">e</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">x</span><span class="mord mathnormal">e</span></span></span></span></xd-inline-math></li><li><xd-inline-math><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∀</mi><mi>x</mi><mo>∈</mo><mi>G</mi><mo separator="true">,</mo><mi mathvariant="normal">∃</mi><msup><mi>x</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mo>∈</mo><mi>G</mi><mo>:</mo><mi>x</mi><msup><mi>x</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mo>=</mo><mi>e</mi><mo>=</mo><msup><mi>x</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mi>x</mi></mrow><annotation encoding="application/x-tex">\forall x \in G, \exists x^{-1} \in G: xx^{-1} = e = x^{-1}x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.73354em;vertical-align:-0.0391em;"></span><span class="mord">∀</span><span class="mord mathnormal">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1.008548em;vertical-align:-0.19444em;"></span><span class="mord mathnormal">G</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">∃</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">−</span><span class="mord mtight">1</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathnormal">G</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord mathnormal">x</span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">−</span><span class="mord mtight">1</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">e</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathnormal">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">−</span><span class="mord mtight">1</span></span></span></span></span></span></span></span></span><span class="mord mathnormal">x</span></span></span></span></xd-inline-math></li></ul></div></td></tr></table></section></section>
<section><h3 class="xd-section-heading">Logos</h3><section id="LaTeX" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">LaTeX</span><span class="token punctuation">]</span></code></h4>Renders the <span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span> logo.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">LaTeX</span><span class="token punctuation">]</span></code></pre></td><td><div><span class="xd-latex">L<sup>a</sup>T<sub>e</sub>X</span></div></td></tr></table></section>


@@ 223,24 226,26 @@ td>div>table{table-layout:initial;}code[class*=language-],pre[class*=language-]{
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">xidoc</span><span class="token punctuation">]</span></code></pre></td><td><div><span class="xd-logo">ξ</span></div></td></tr></table></section></section>
<section><h3 class="xd-section-heading">Modularity</h3><section id="inject" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">inject</span> file<span class="token punctuation">]</span></code></h4>Pastes the content of <code>file</code> and renders it.</section>
<section id="include" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">include</span> file<span class="token punctuation">;</span> *(name<span class="token punctuation">;</span> value)<span class="token punctuation">]</span></code></h4>Renders the content of <code>file</code> as a separate document and pastes it. You can give arguments to the subdocument, which can be retrieved with the <a href="#template-arg"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">template-arg</span><span class="token punctuation">]</span></code></a> command.</section>
<section id="template-arg" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">template-arg</span> name<span class="token punctuation">]</span></code></h4>In a document included with <a href="#include"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">include</span><span class="token punctuation">]</span></code></a>, returns the given argument passed to <a href="#include"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">include</span><span class="token punctuation">]</span></code></a>.</section></section>
<section><h3 class="xd-section-heading">Settings</h3><section id="set-doc-lang" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">set-doc-lang</span> language<span class="token punctuation">]</span></code></h4>Sets the global <code>language</code> of the document. Returns nothing.</section>
<section id="include" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">include</span> file<span class="token punctuation">;</span> *(name<span class="token punctuation">;</span> value)<span class="token punctuation">]</span></code></h4>Renders the content of <code>file</code> as a separate document and pastes it. You can give arguments to the subdocument, which can be retrieved with the <a href="#template-arg"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">template-arg</span><span class="token punctuation">]</span></code></a> command.
<section id="template-arg" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">template-arg</span> name<span class="token punctuation">]</span></code></h5>In a document included with <a href="#include"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">include</span><span class="token punctuation">]</span></code></a>, returns the given argument passed to <a href="#include"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">include</span><span class="token punctuation">]</span></code></a>.</section></section></section>
<section><h3 class="xd-section-heading">Settings</h3><section id="set" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">set</span> key<span class="token punctuation">;</span> value<span class="token punctuation">]</span></code></h4>Changes the value of a setting. All settings are global. Currently the only setting is <code>katex-stylesheet-path</code>, which is explained in the Math section.
<section id="reset" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">reset</span> key<span class="token punctuation">]</span></code></h5>Resets the value of a setting to the default.</section></section>
<section id="set-doc-lang" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">set-doc-lang</span> language<span class="token punctuation">]</span></code></h4>Sets the global <code>language</code> of the document. Returns nothing.</section>
<section id="set-syntax-highlighting-theme" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">set-syntax-highlighting-theme</span> theme<span class="token punctuation">]</span></code></h4>Sets the <code>theme</code> for syntax highlighting with the <a href="#code"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code</span><span class="token punctuation">]</span></code></a> and <a href="#code-block"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">code-block</span><span class="token punctuation">]</span></code></a> commands. The available themes are <code>default</code>, <code>dark</code>, <code>funky</code>, <code>okaidia</code>, <code>twilight</code>, <code>coy</code>, <code>solarized-light</code>, and <code>tomorrow-night</code>. You can try out these themes on <a href="https://prismjs.com/">the Prism website</a>. There is also <code>funky-x</code>, a modification of <code>funky</code> with a black background instead of weird stripes.</section>
<section id="set-title" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">set-title</span> title<span class="token punctuation">]</span></code></h4>Sets the given <code>title</code> as the title of the document.</section></section>
<section><h3 class="xd-section-heading">Custom commands</h3><section id="def" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span> name<span class="token punctuation">;</span> ?params<span class="token punctuation">;</span> body<span class="token punctuation">]</span></code></h4>Defines a command with the given <code>name</code> that expands to <code>body</code>. If <code>params</code>, which should be space-separated words, are given, the command can take arguments, which can be accessed using the <a href="#arg"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg</span><span class="token punctuation">]</span></code></a> command and its variants (<a href="#arg-expand"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-expand</span><span class="token punctuation">]</span></code></a>, <a href="#arg-raw"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-raw</span><span class="token punctuation">]</span></code></a>, <a href="#arg-raw-escape"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-raw-escape</span><span class="token punctuation">]</span></code></a>). The command will only be visible in the scope where it was defined; if you want it to be visible everywhere, use <a href="#def-global"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def-global</span><span class="token punctuation">]</span></code></a>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span> greet<span class="token punctuation">;</span> name<span class="token punctuation">;</span> Hello, <span class="token punctuation">[</span><span class="token tag">arg</span> name<span class="token punctuation">]</span>!<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token tag">greet</span> reader<span class="token punctuation">]</span></code></pre></td><td><div>Hello, reader!</div></td></tr></table></section>
<section id="def-global" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def-global</span> name<span class="token punctuation">;</span> ?params<span class="token punctuation">;</span> body<span class="token punctuation">]</span></code></h4>Defines a command with the given <code>name</code> that expands to <code>body</code>. If <code>params</code>, which should be space-separated words, are given, the command can take arguments, which can be accessed using the <a href="#arg"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg</span><span class="token punctuation">]</span></code></a> command and its variants (<a href="#arg-expand"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-expand</span><span class="token punctuation">]</span></code></a>, <a href="#arg-raw"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-raw</span><span class="token punctuation">]</span></code></a>, <a href="#arg-raw-escape"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-raw-escape</span><span class="token punctuation">]</span></code></a>). The command will be visible everywhere; if you want it to be visible only in the scope where it was defined, use <a href="#def"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span><span class="token punctuation">]</span></code></a>.
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span> greet<span class="token punctuation">;</span> name<span class="token punctuation">;</span> Hello, <span class="token punctuation">[</span><span class="token tag">arg</span> name<span class="token punctuation">]</span>!<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token tag">greet</span> reader<span class="token punctuation">]</span></code></pre></td><td><div>Hello, reader!</div></td></tr></table>
<section id="def-global" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def-global</span> name<span class="token punctuation">;</span> ?params<span class="token punctuation">;</span> body<span class="token punctuation">]</span></code></h5>Defines a command with the given <code>name</code> that expands to <code>body</code>. If <code>params</code>, which should be space-separated words, are given, the command can take arguments, which can be accessed using the <a href="#arg"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg</span><span class="token punctuation">]</span></code></a> command and its variants (<a href="#arg-expand"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-expand</span><span class="token punctuation">]</span></code></a>, <a href="#arg-raw"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-raw</span><span class="token punctuation">]</span></code></a>, <a href="#arg-raw-escape"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-raw-escape</span><span class="token punctuation">]</span></code></a>). The command will be visible everywhere; if you want it to be visible only in the scope where it was defined, use <a href="#def"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span><span class="token punctuation">]</span></code></a>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">hide</span> <span class="token punctuation">[</span><span class="token tag">def-global</span> greet<span class="token punctuation">;</span> name<span class="token punctuation">;</span> Hello, <span class="token punctuation">[</span><span class="token tag">arg</span> name<span class="token punctuation">]</span>!<span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token tag">greet</span> reader<span class="token punctuation">]</span></code></pre></td><td><div>Hello, reader!</div></td></tr></table></section>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">hide</span> <span class="token punctuation">[</span><span class="token tag">def-global</span> greet<span class="token punctuation">;</span> name<span class="token punctuation">;</span> Hello, <span class="token punctuation">[</span><span class="token tag">arg</span> name<span class="token punctuation">]</span>!<span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token tag">greet</span> reader<span class="token punctuation">]</span></code></pre></td><td><div>Hello, reader!</div></td></tr></table></section></section>
<section id="arg" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg</span> parameter<span class="token punctuation">]</span></code></h4>Inside a command definition (<a href="#def"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span><span class="token punctuation">]</span></code></a>), renders the argument given to the <code>parameter</code>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span> greet<span class="token punctuation">;</span> name<span class="token punctuation">;</span> Hello, <span class="token punctuation">[</span><span class="token tag">arg</span> name<span class="token punctuation">]</span>!<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token tag">greet</span> reader<span class="token punctuation">]</span></code></pre></td><td><div>Hello, reader!</div></td></tr></table></section>
<section id="arg-expand" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-expand</span> parameter<span class="token punctuation">]</span></code></h4>Inside a command definition (<a href="#def"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span><span class="token punctuation">]</span></code></a>), expands the argument given to the <code>parameter</code>, but doesn't render it.</section>
<section id="arg-raw" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-raw</span> <span class="token string">parameter</span><span class="token punctuation">]</span></code></h4>Inside a command definition (<a href="#def"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span><span class="token punctuation">]</span></code></a>), returns the argument given to the <code>parameter</code>, but doesn't expand it.</section>
<section id="arg-raw-escape" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-raw-escape</span> parameter<span class="token punctuation">]</span></code></h4>Inside a command definition (<a href="#def"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span><span class="token punctuation">]</span></code></a>), returns the argument given to the <code>parameter</code>, but doesn't expand it; however, the raw string is rendered.</section>
</section>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span> greet<span class="token punctuation">;</span> name<span class="token punctuation">;</span> Hello, <span class="token punctuation">[</span><span class="token tag">arg</span> name<span class="token punctuation">]</span>!<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token tag">greet</span> reader<span class="token punctuation">]</span></code></pre></td><td><div>Hello, reader!</div></td></tr></table>
<section id="arg-expand" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-expand</span> parameter<span class="token punctuation">]</span></code></h5>Inside a command definition (<a href="#def"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span><span class="token punctuation">]</span></code></a>), expands the argument given to the <code>parameter</code>, but doesn't render it.</section>
<section id="arg-raw" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-raw</span> <span class="token string">parameter</span><span class="token punctuation">]</span></code></h5>Inside a command definition (<a href="#def"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span><span class="token punctuation">]</span></code></a>), returns the argument given to the <code>parameter</code>, but doesn't expand it.</section>
<section id="arg-raw-escape" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">arg-raw-escape</span> parameter<span class="token punctuation">]</span></code></h5>Inside a command definition (<a href="#def"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">def</span><span class="token punctuation">]</span></code></a>), returns the argument given to the <code>parameter</code>, but doesn't expand it; however, the raw string is rendered.</section>
</section></section>
<section><h3 class="xd-section-heading">Target detection</h3><section id="if-html" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">if-html</span> text<span class="token punctuation">]</span></code></h4>Evaluates <code>text</code> only if the target is HTML, otherwise returns nothing.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">if-html</span> You can see this only if you're in HTML!<span class="token punctuation">]</span></code></pre></td><td><div>You can see this only if you're in HTML!</div></td></tr></table></section>


@@ 294,10 299,10 @@ td>div>table{table-layout:initial;}code[class*=language-],pre[class*=language-]{
<section><h3 class="xd-section-heading">HTML-specific</h3><section id="html-add-attrs" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">html-add-attrs</span> attrs<span class="token punctuation">;</span> cmd<span class="token punctuation">]</span></code></h4>If the target is HTML, adds the given <code>attributes</code> to the tag produced by <code>cmd</code>. Supports the <code>.foo</code> and <code>#foo</code> syntax for specifying classes and IDs.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">html-add-attrs</span> style="color:pink"<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">bf</span> Real men don't fear colors.<span class="token punctuation">]</span><span class="token punctuation">]</span></code></pre></td><td><div><b style="color:pink">Real men don't fear colors.</b></div></td></tr></table></section>
<section id="js-module" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">js-module</span> code<span class="token punctuation">]</span></code></h4>If the target is HTML, adds the given JavaScript code to the page as a JavaScript module. If you don't need to use any xidoc commands inside the code, it's recommended to use <a href="#js-module-raw"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">js-module-raw</span><span class="token punctuation">]</span></code></a>.</section>
<section id="js-module-raw" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">js-module-raw</span> <span class="token string">code</span><span class="token punctuation">]</span></code></h4>Works as a combination of <a href="#js-module"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">js-module</span><span class="token punctuation">]</span></code></a> and <a href="#raw"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">raw</span><span class="token punctuation">]</span></code></a>.
<section id="js-module" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">js-module</span> code<span class="token punctuation">]</span></code></h4>If the target is HTML, adds the given JavaScript code to the page as a JavaScript module. If you don't need to use any xidoc commands inside the code, it's recommended to use <a href="#js-module-raw"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">js-module-raw</span><span class="token punctuation">]</span></code></a>.
<section id="js-module-raw" class="command"><h5 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">js-module-raw</span> <span class="token string">code</span><span class="token punctuation">]</span></code></h5>Works as a combination of <a href="#js-module"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">js-module</span><span class="token punctuation">]</span></code></a> and <a href="#raw"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">raw</span><span class="token punctuation">]</span></code></a>.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">&lt;span></span> #change-me<span class="token punctuation">;</span> I will be changed<span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token tag">js-module-raw</span> <span class="token string">document.getElementById("change-me").innerText = "I was changed"</span><span class="token punctuation">]</span></code></pre></td><td><div><span id="change-me">I will be changed</span> </div></td></tr></table></section>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">&lt;span></span> #change-me<span class="token punctuation">;</span> I will be changed<span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token tag">js-module-raw</span> <span class="token string">document.getElementById("change-me").innerText = "I was changed"</span><span class="token punctuation">]</span></code></pre></td><td><div><span id="change-me">I will be changed</span> </div></td></tr></table></section></section>
<section id="style" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">style</span> stylesheet<span class="token punctuation">]</span></code></h4>Styles an HTML document using xidoc's custom syntax for CSS.
<table><tr><th>Example</th><th>Output</th></tr>
<tr><td><pre class="language-xidoc"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">style</span> <span class="token punctuation">[</span><span class="token tag">rule</span> .golden-frame<span class="token punctuation">;</span> <span class="token punctuation">[</span><span class="token tag">:</span> border<span class="token punctuation">;</span> 3px solid gold<span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token tag">&lt;div></span> .golden-frame<span class="token punctuation">;</span> This text is a work of art!<span class="token punctuation">]</span></code></pre></td><td><div><div class="golden-frame">This text is a work of art!</div></div></td></tr></table></section></section>

M docs/commands.xd => docs/commands.xd +144 -120
@@ 1,7 1,27 @@
[inject head.xd]
[style
  [rule .command>h3,.command>h4;
  [rule .command;
    [: background-color; #111]
    [: border; 1px solid #333]
    [: margin; 0 0 .5rem 0]
    [: padding; .3rem]
  ]
  [rule .command>.command;
    [: background-color; #222]
    [: border; 1px solid #444]
    [: margin; .5rem 0 0 0]
  ]
  [rule .command>h3,.command>h4,.command>h5;
    [: font-size; inherit]
    [: margin; .1rem 0 .1rem 0]
    [: margin-bottom; .1rem]
  ]
  [rule .command code;
    [:! background-color; inherit]
    [:! padding; 0]
  ]
  [rule h2,h3;
    [: margin; 1rem 0 0 0]
  ]
  [rule pre;
    [: white-space; pre-wrap]


@@ 14,7 34,7 @@
    [: width; 100%]
    [: table-layout; fixed]
  ]
  [rule td,th;
  [rule td;
    [: border; 1px solid #888]
  ]
  [rule td>div,th>div;


@@ 24,6 44,10 @@
  [rule td>div>table;
    [: table-layout; initial]
  ]
  [rule th;
    [: background-color; [var xidoc-color-darker]]
    [: font-family; [var sans-serif]]
  ]
]
[def cmd; name signature explanation;
  [html-add-attrs .command #[arg name];


@@ 80,61 104,96 @@
      Returns a left square bracket.
      [ex I'm a sad robot :[(]]
    ]
    [cmd (); text;
      Wraps [param text] in square brackets.
      [ex [() this-is-not-a-command]]
    ]
    [cmd-nilad );
      Returns a right square bracket.
      [ex I'm a happy robot :[)]]
    ]
    [cmd (); text;
      Wraps [param text] in square brackets.
      [ex [() this-is-not-a-command]]
    ]
    [cmd-nilad [;];
      Returns a semicolon. Useful for “escaping” semicolons in commands that take multiple arguments.
      [ex [list This[;] is[;] only[;] one[;] item]]
    ]
    [cmd \; text;
      Removes the least common indentation from all lines of [arg text], then returns it without expanding. A [" smarter] version of [cmd-ref raw].
      [ex
    [cmd-nilad space;
      Returns a space character. Useful in commands that strip whitespace.
    ]
    [cmd raw; text;
      Returns the given [param text] without expanding it.
      [ex [raw [I can use [as many brackets [as I want]], but [they] still have to [[be balanced]]].]]
      [cmd \; text;
        Removes the least common indentation from all lines of [param text], then returns it without expanding. A [" smarter] version of [cmd-ref raw].
        [ex
[code-block nim; [\
  for word in ["This", "correctly", "removes", "indentation"]:
    echo word
]]
        ]
      ]
    ]
    [cmd expand; text;
      After expanding [param text], expands it again. Useful for complex command definitions.
    ]
    [cmd hide; text;
      Expands [param text] for its side effects, but doesn't return anything.
    ]
    [cmd pass; code;
      Directly produces the given [param code] without escaping it. Useful if you want to go outside the capabilities of xidoc. The [param code] is still expanded so you can parametrize it, see the [cmd-ref pass-raw] command if you don't want this.
      [if-html [ex [pass <em>Haha!</em> I'm in! <code>'; DROP TABLE xidoc;</code> Oh no, this is a static site…]]]
      [cmd pass-raw; code;
        Directly produces the given [param code] without escaping it. Useful if you want to go outside the capabilities of xidoc. Works as a combination of [cmd-ref pass] and [cmd-ref raw].
      ]
    ]
    [cmd pass-raw; code;
      Directly produces the given [param code] without escaping it. Useful if you want to go outside the capabilities of xidoc. Works as a combination of [cmd-ref pass] and [cmd-ref raw].
    ]
    [cmd add-to-head; directive;
      Adds the [param directive] to the head of the document. Returns nothing.
    [cmd hide; text;
      Expands [param text] for its side effects, but doesn't return anything.
    ]
    [cmd raw; text;
      Returns the given [param text] without expanding it.
      [ex [raw [I can use [as many brackets [as I want]], but [they] still have to [[be balanced]]].]]
    [cmd expand; text;
      After expanding [param text], expands it again. Useful for complex command definitions.
    ]
    [cmd render; text;
      After expanding [param text], renders it. Useful for complex command definitions.
      [ex [render [raw [it This will be italic despite being inside [ms raw].]]]]
    ]
    [cmd-nilad space;
      Returns a space character. Useful in commands that strip whitespace.
    [cmd add-to-head; directive;
      Adds the [param directive] to the head of the document. Returns nothing.
    ]
  ]

  [section Formatting;
  [section Inline formatting;
    [cmd bf; text;
      Renders [param text] in bold face.
      [ex xidoc is [bf awesome]!]
    ]
    [cmd code; ?language[;] code;
      Renders the [param code] in monospace font. If the [param language] is specified and the target is HTML, the code is syntax-highlighted during compilation using [link Prism; https://prismjs.com/]. See the [link list of supported languages; https://prismjs.com/#supported-languages] to know how to specify the [param language]. xidoc is also supported under the name [ms xidoc]. For generic monospace text, use the [cmd-ref ms] command.
      [ex [code python; [raw print(f"The answer to the universe and stuff is {6 * 7}.")]]]
    ]
    [cmd color; color text;
      Colors the [param text] in the given CSS-style [param color].
      [ex You can use [color red; names] or [color #00f; codes]!]
    ]
    [cmd it; text;
      Renders [param text] in italics.
      [ex xidoc is [it fantastic!]]
    ]
    [cmd lang; language[;] text;
      Renders [param text] with the conventions of the specified [param language].
      [ex [" Hello!] [lang czech; [" Ahoj!]]]
    ]
    [cmd link; ?text[;] address;
      Adds a link to the given [param address] with an optional [param text] visually replacing the address.
      [ex [link xidoc; http://xidoc.nim.town/] is made in [link Nim; https://nim-lang.org/].]
    ]
    [cmd ms; text;
      Renders [param text] in monospace. If you want to show code, it's recommended to use the [cmd-ref code] or [cmd-ref code-block] command instead.
      [ex In HTML, this will produce [ms <code>]. In [LaTeX], this will produce [ms \texttt].]
    ]
    [cmd term; phrase;
      Introduces [param phrase] as a new term. Useful in definitions.
      [ex A [term group] is a monoid where every element has an inverse.]
    ]
    [cmd unit; ?number[;] unit;
      Renders a [param unit] or a quantity expressed with a [param number] and [param unit]. Also works inside math commands.
      [ex [unit 6378; km], [$ [unit 60; [/ km; h]]]]
    ]
  ]

  [section Block formatting;
    [cmd block-quote; text;
      Creates a block quote.
      [ex [p The first rule in the Zen of Nim is:] [block-quote Copying bad design is not good design.]]


@@ 143,10 202,6 @@
      Renders a list of [param items] with checkboxes. Use [ms [() -]] for an unchecked item, [ms [() v]] for a checked item and [ms [() x]] for a crossed item.
      [ex [checkboxes [v Kill the friend] [- Bury the body] [x Get caught by the police]]]
    ]
    [cmd code; ?language[;] code;
      Renders the [param code] in monospace font. If the [param language] is specified and the target is HTML, the code is syntax-highlighted during compilation using [link Prism; https://prismjs.com/]. See the [link list of supported languages; https://prismjs.com/#supported-languages] to know how to specify the [param language]. xidoc is also supported under the name [ms xidoc]. For generic monospace text, use the [cmd-ref ms] command.
      [ex [code python; [raw print(f"The answer to the universe and stuff is {6 * 7}.")]]]
    ]
    [cmd code-block; ?language[;] code;
      Renders the [param code] as a block in monospace font. If the [param language] is specified and the target is HTML, the code is syntax-highlighted during compilation using [link Prism; https://prismjs.com/]. See the [link list of supported languages; https://prismjs.com/#supported-languages] to know how to specify the [param language]. xidoc is also supported under the name [ms xidoc].
      [ex [code-block javascript; [raw


@@ 159,38 214,10 @@ const factorial = (n) => {
}
]]]
    ]
    [cmd color; color text;
      Colors the [param text] in the given CSS-style [param color].
      [ex You can use [color red; names] or [color #00f; codes]!]
    ]
    [cmd header-row; *fields;
      Creates a header row for a table with the given fields. Has to be used inside a [cmd-ref table] command.
      [ex
[table
  [header-row xidoc; HTML; [LaTeX]]
  [row [code xidoc; [() table]]; [code html; <table></table>]; [code latex; \begin{table}{[...]}\end{table}]]
]]
    ]
    [cmd it; text;
      Renders [param text] in italics.
      [ex xidoc is [it fantastic!]]
    ]
    [cmd lang; language[;] text;
      Renders [param text] in the specified [param language].
      [ex [" Hello!] [lang czech; [" Ahoj!]]]
    ]
    [cmd link; ?text[;] address;
      Adds a link to the given [param address] with an optional [param text] visually replacing the address.
      [ex [link xidoc; http://xidoc.nim.town/] is made in [link Nim; https://nim-lang.org/].]
    ]
    [cmd list; *items;
      Creates an unordered list of [param items].
      [ex Supported targets: [list HTML; [LaTeX]; Gemtext]]
    ]
    [cmd ms; text;
      Renders [param text] in monospace. If you want to show code, it's recommended to use the [cmd-ref code] or [cmd-ref code-block] command instead.
      [ex In HTML, this will produce [ms <code>]. In [LaTeX], this will produce [ms \texttt].]
    ]
    [cmd ordered-list; *items;
      Creates an ordered list of [param items].
      [ex TOP 5 LIST OF SMALLEST POSITIVE INTEGERS: [ordered-list 1; 2; 3; 4; 5]]


@@ 198,21 225,10 @@ const factorial = (n) => {
    [cmd p; text;
      Creates a paragraph with the given [param text].
    ]
    [cmd row; *fields;
      Creates a row for a table with the given fields. Has to be used inside a [cmd-ref table] command.
      [ex
[table
  [header-row xidoc; HTML; [LaTeX]]
  [row [code xidoc; [() table]]; [code html; <table></table>]; [code latex; \begin{table}{[...]}\end{table}]]
]]
    ]
    [cmd section; ?title[;] text;
      Creates a section with the given [param title] and [param text] (or without a title if not given). If it's inside another section, it will be a subsection. If it's inside a subsection, it will be a subsubsection. In HTML, this nesting can continue further.
      [ex [section Inception; Are we going too deep?]]
    ]
    [cmd show-title; title;
      Renders the given [param title] without setting it as the title of the document.
    ]
    [cmd spoiler; visible[;] secret;
      Hides the [param secret] text until the [param visible] text is clicked. Works only in environments that support interactivity.
      [ex [spoiler In the series [it The Simpsons], the surname of the main characters is; [it Simpson]]]


@@ 224,17 240,18 @@ const factorial = (n) => {
  [header-row xidoc; HTML; [LaTeX]]
  [row [code xidoc; [() table]]; [code html; <table></table>]; [code latex; \begin{table}{[...]}\end{table}]]
]]
    ]
    [cmd term; phrase;
      Introduces [param phrase] as a new term. Useful in definitions.
      [ex A [term group] is a monoid where every element has an inverse.]
      [cmd row; *fields;
        Creates a row for a table with the given fields. Has to be used inside a [cmd-ref table] command.
      ]
      [cmd header-row; *fields;
        Creates a header row for a table with the given fields. Has to be used inside a [cmd-ref table] command.
      ]
    ]
    [cmd title; title[;] ?author;
      Renders the given [param title] and sets it as the title of the document. If an [param author] is specified, their name is mentioned under the title.
    ]
    [cmd unit; ?number[;] unit;
      Renders a [param unit] or a quantity expressed with a [param number] and [param unit]. Also works inside math commands.
      [ex [unit 6378; km], [$ [unit 60; [/ km; h]]]]
      [cmd show-title; title;
        Renders the given [param title] without setting it as the title of the document.
      ]
    ]
  ]



@@ 258,6 275,7 @@ const factorial = (n) => {
  ]

  [section Math;
    [p In HTML, [LaTeX] math is rendered using [link KaTeX; https://katex.org/]. This requires a stylesheet and fonts, which are downloaded from the [link jsDelivr; https://www.jsdelivr.com/] CDN by default. If you'd like to use a different CDN or self-hoost the files, use [code xidoc; [raw [set katex-stylesheet-path; path/to/katex.min.css]]] to point xidoc to the stylesheet.]
    [cmd $; latex;
      Renders [LaTeX] inline math.
      [ex Einstein's famous equation is [$ E = m c^2].]


@@ 265,10 283,10 @@ const factorial = (n) => {
    [cmd $$; latex;
      Renders [LaTeX] block math.
      [ex [$$ (A+B)^n = \sum_{k=0}^n {n \choose k} A^{n-k} B^k]]
    ]
    [cmd $$&; latex;
      Renders [LaTeX] aligned block math (with the [ms align] environment).
      [ex [$$& ((f \circ g) \circ h)(x) &= f(g(h(x))) \\ &= (f \circ (g \circ h))(x)]]
      [cmd $$&; latex;
        Renders [LaTeX] aligned block math (with the [ms align] environment).
        [ex [$$& ((f \circ g) \circ h)(x) &= f(g(h(x))) \\ &= (f \circ (g \circ h))(x)]]
      ]
    ]
    [cmd matext; latex;
      Renders the given [LaTeX] [param math] using [link maTeXt; https://xigoi.srht.site/matext/] and presents it as preformatted text.


@@ 278,6 296,14 @@ const factorial = (n) => {
      Renders a mathematical definition paragraph with an optional [param name].
      [ex [dfn An [term inertial system] is a system where the law of inertia holds.]]
    ]
    [cmd theorem; ?name[;] text;
      Renders a mathematical theorem paragraph with an optional [param name].
      [ex [theorem Pythagorean; In a right triangle with legs [$ a,b] and hypotenuse [$ c], [$ a^2 + b^2 = c^2].]]
    ]
    [cmd proof; ?name[;] text;
      Renders a mathematical proof paragraph with an optional [param name].
      [ex [proof Left as an exercise to the reader.]]
    ]
    [cmd example; ?name[;] text;
      Renders a mathematical example paragraph with an optional [param name].
    ]


@@ 288,24 314,16 @@ const factorial = (n) => {
    [cmd lemma; ?name[;] text;
      Renders a mathematical lemma paragraph with an optional [param name].
    ]
    [cmd proof; ?name[;] text;
      Renders a mathematical proof paragraph with an optional [param name].
      [ex [proof Left as an exercise to the reader.]]
    [cmd solution; ?name[;] text;
      Renders a paragraph with the solution to a mathematical problem with an optional [param name].
      [cmd spoiler-solution; ?name[;] text;
        Renders a paragraph with the solution to a mathematical problem with an optional [param name]. In environments that support interactivity, the [param text] is hidden inside a spoiler (see the [cmd-ref spoiler] command).
      ]
    ]
    [cmd props; *properties;
      Creates a list of mathematical [param properties]. Currently the same as [cmd-ref list].
      [ex [props [$ \forall x,y,z \in G: (xy)z = x(yz)]; [$ \exists e \in G, \forall x \in G: ex = x = xe]; [$ \forall x \in G, \exists x^{-1} \in G: xx^{-1} = e = x^{-1}x]]]
    ]
    [cmd solution; ?name[;] text;
      Renders a paragraph with the solution to a mathematical problem with an optional [param name].
    ]
    [cmd spoiler-solution; ?name[;] text;
      Renders a paragraph with the solution to a mathematical problem with an optional [param name]. In environments that support interactivity, the [param text] is hidden inside a spoiler (see the [cmd-ref spoiler] command).
    ]
    [cmd theorem; ?name[;] text;
      Renders a mathematical theorem paragraph with an optional [param name].
      [ex [theorem Pythagorean; In a right triangle with legs [$ a,b] and hypotenuse [$ c], [$ a^2 + b^2 = c^2].]]
    ]
  ]

  [section Logos;


@@ 325,13 343,19 @@ const factorial = (n) => {
    ]
    [cmd include; file[;] *(name[;] value);
      Renders the content of [param file] as a separate document and pastes it. You can give arguments to the subdocument, which can be retrieved with the [cmd-ref template-arg] command.
    ]
    [cmd template-arg; name;
      In a document included with [cmd-ref include], returns the given argument passed to [cmd-ref include].
      [cmd template-arg; name;
        In a document included with [cmd-ref include], returns the given argument passed to [cmd-ref include].
      ]
    ]
  ]

  [section Settings;
    [cmd set; key[;] value;
      Changes the value of a setting. All settings are global. Currently the only setting is [ms katex-stylesheet-path], which is explained in the Math section.
      [cmd reset; key;
        Resets the value of a setting to the default.
      ]
    ]
    [cmd set-doc-lang; language;
      Sets the global [param language] of the document. Returns nothing.
    ]


@@ 347,29 371,29 @@ const factorial = (n) => {
    [cmd def; name[;] ?params[;] body;
      Defines a command with the given [param name] that expands to [param body]. If [param params], which should be space-separated words, are given, the command can take arguments, which can be accessed using the [cmd-ref arg] command and its variants ([cmd-ref arg-expand], [cmd-ref arg-raw], [cmd-ref arg-raw-escape]). The command will only be visible in the scope where it was defined[;] if you want it to be visible everywhere, use [cmd-ref def-global].
      [ex [def greet; name; Hello, [arg name]!][greet reader]]
    ]
    [cmd def-global; name[;] ?params[;] body;
      Defines a command with the given [param name] that expands to [param body]. If [param params], which should be space-separated words, are given, the command can take arguments, which can be accessed using the [cmd-ref arg] command and its variants ([cmd-ref arg-expand], [cmd-ref arg-raw], [cmd-ref arg-raw-escape]). The command will be visible everywhere[;] if you want it to be visible only in the scope where it was defined, use [cmd-ref def].
      [ex [hide [def-global greet; name; Hello, [arg name]!]][greet reader]]
      [cmd def-global; name[;] ?params[;] body;
        Defines a command with the given [param name] that expands to [param body]. If [param params], which should be space-separated words, are given, the command can take arguments, which can be accessed using the [cmd-ref arg] command and its variants ([cmd-ref arg-expand], [cmd-ref arg-raw], [cmd-ref arg-raw-escape]). The command will be visible everywhere[;] if you want it to be visible only in the scope where it was defined, use [cmd-ref def].
        [ex [hide [def-global greet; name; Hello, [arg name]!]][greet reader]]
      ]
    ]
    [cmd arg; parameter;
      Inside a command definition ([cmd-ref def]), renders the argument given to the [param parameter].
      [ex [def greet; name; Hello, [arg name]!][greet reader]]
    ]
    [cmd arg-expand; parameter;
      Inside a command definition ([cmd-ref def]), expands the argument given to the [param parameter], but doesn't render it.
    ]
    [cmd arg-raw; parameter;
      Inside a command definition ([cmd-ref def]), returns the argument given to the [param parameter], but doesn't expand it.
    ]
    [cmd arg-raw-escape; parameter;
      Inside a command definition ([cmd-ref def]), returns the argument given to the [param parameter], but doesn't expand it[;] however, the raw string is rendered.
    ]
    [# arg\; parameter;
      Inside a command definition ([cmd-ref def]), returns the argument given to the [param parameter], but doesn't expand it. Strips common indentation.
    ]
    [# arg\-escape; parameter;
      Inside a command definition ([cmd-ref def]), returns the argument given to the [param parameter], but doesn't expand it[;] however, the raw string is rendered. Strips common indentation.
      [cmd arg-expand; parameter;
        Inside a command definition ([cmd-ref def]), expands the argument given to the [param parameter], but doesn't render it.
      ]
      [cmd arg-raw; parameter;
        Inside a command definition ([cmd-ref def]), returns the argument given to the [param parameter], but doesn't expand it.
      ]
      [cmd arg-raw-escape; parameter;
        Inside a command definition ([cmd-ref def]), returns the argument given to the [param parameter], but doesn't expand it[;] however, the raw string is rendered.
      ]
      [# arg\; parameter;
        Inside a command definition ([cmd-ref def]), returns the argument given to the [param parameter], but doesn't expand it. Strips common indentation.
      ]
      [# arg\-escape; parameter;
        Inside a command definition ([cmd-ref def]), returns the argument given to the [param parameter], but doesn't expand it[;] however, the raw string is rendered. Strips common indentation.
      ]
    ]
  ]



@@ 456,10 480,10 @@ const factorial = (n) => {
    ]
    [cmd js-module; code;
      If the target is HTML, adds the given JavaScript code to the page as a JavaScript module. If you don't need to use any xidoc commands inside the code, it's recommended to use [cmd-ref js-module-raw].
    ]
    [cmd js-module-raw; code;
      Works as a combination of [cmd-ref js-module] and [cmd-ref raw].
      [if-html [ex [<span> #change-me; I will be changed] [js-module-raw document.getElementById("change-me").innerText = "I was changed"]]]
      [cmd js-module-raw; code;
        Works as a combination of [cmd-ref js-module] and [cmd-ref raw].
        [if-html [ex [<span> #change-me; I will be changed] [js-module-raw document.getElementById("change-me").innerText = "I was changed"]]]
      ]
    ]
    [cmd style; stylesheet;
      Styles an HTML document using xidoc's custom syntax for CSS.