~xigoi/xidoc

65a7e0af0fd87d15a16850a4a343585ce32bc347 — Adam Blažek 2 months ago ea3eb3f
[corollary]
M docs/commands.html => docs/commands.html +1 -0
@@ 216,6 216,7 @@ font-family:var(--sans-serif);}code[class*=language-],pre[class*=language-]{font
<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="corollary" class="command"><h4 class="xd-section-heading"><code class="language-xidoc"><span class="token punctuation">[</span><span class="token tag">corollary</span> ?name<span class="token punctuation">;</span> text<span class="token punctuation">]</span></code></h4>Renders a mathematical corollary paragraph with an optional <code>name</code>.</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>

M docs/commands.xd => docs/commands.xd +3 -0
@@ 315,6 315,9 @@ const factorial = (n) => {
      Renders a mathematical proof paragraph with an optional [param name].
      [ex [proof Left as an exercise to the reader.]]
    ]
    [cmd corollary; ?name[;] text;
      Renders a mathematical corollary paragraph with an optional [param name].
    ]
    [cmd example; ?name[;] text;
      Renders a mathematical example paragraph with an optional [param name].
    ]

M src/xidocpkg/commands/default.nim => src/xidocpkg/commands/default.nim +2 -0
@@ 205,6 205,8 @@ commands defaultCommands:
    of tGemtext:
      text

  theoremLikeCommand(corollaryCmd, "corollary", pCorollary, "$1", "$1")

  template def(global: static bool): string {.dirty.} =
    let params = paramList.map(it => it.splitWhitespace).get(@[])
    doc.stack[when global: 0 else: ^2].commands[name] = proc(arg: string): XidocValue =

M src/xidocpkg/translations.nim => src/xidocpkg/translations.nim +5 -0
@@ 3,6 3,7 @@ type
    lEnglish
    lCzech
  Phrase* = enum
    pCorollary
    pDefinition
    pExample
    pExercise


@@ 15,6 16,10 @@ type
    pTheorem

const translations = [
  pCorollary: [
    lEnglish: "Corollary",
    lCzech: "Důsledek",
  ],
  pDefinition: [
    lEnglish: "Definition",
    lCzech: "Definice",