Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions crates/mdman/doc/out/mdman.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ man page:

<dl>

<dt class="option-term" id="option-mdman--t"><a class="option-anchor" href="#option-mdman--t"></a><code>-t</code> <em>type</em></dt>
<dt class="option-term" id="option-mdman--t"><a class="option-anchor" href="#option-mdman--t"><code>-t</code> <em>type</em></a></dt>
<dd class="option-desc"><p>Specifies the output type. The following output types are supported:</p>
<ul>
<li><code>man</code> — A troff-style man page. Outputs with a numbered extension (like
Expand All @@ -66,26 +66,26 @@ available. Outputs with the <code>.txt</code> extension.</li>
</dd>


<dt class="option-term" id="option-mdman--o"><a class="option-anchor" href="#option-mdman--o"></a><code>-o</code> <em>outdir</em></dt>
<dt class="option-term" id="option-mdman--o"><a class="option-anchor" href="#option-mdman--o"><code>-o</code> <em>outdir</em></a></dt>
<dd class="option-desc"><p>Specifies the directory where to save the output.</p>
</dd>


<dt class="option-term" id="option-mdman---url"><a class="option-anchor" href="#option-mdman---url"></a><code>--url</code> <em>base_url</em></dt>
<dt class="option-term" id="option-mdman---url"><a class="option-anchor" href="#option-mdman---url"><code>--url</code> <em>base_url</em></a></dt>
<dd class="option-desc"><p>Specifies a base URL to use for relative URLs within the document. Any
relative URL will be joined with this URL.</p>
</dd>


<dt class="option-term" id="option-mdman---man"><a class="option-anchor" href="#option-mdman---man"></a><code>--man</code> <em>name</em><code>:</code><em>section</em><code>=</code><em>url</em></dt>
<dt class="option-term" id="option-mdman---man"><a class="option-anchor" href="#option-mdman---man"><code>--man</code> <em>name</em><code>:</code><em>section</em><code>=</code><em>url</em></a></dt>
<dd class="option-desc"><p>Specifies a URL to use for the given man page. When the <code>{{man name section}}</code> expression is used, the given URL will be inserted as a link. This
may be specified multiple times. If a man page reference does not have a
matching <code>--man</code> entry, then a relative link to a file named <em>name</em><code>.md</code> will
be used.</p>
</dd>


<dt class="option-term" id="option-mdman-sources…"><a class="option-anchor" href="#option-mdman-sources…"></a><em>sources…</em></dt>
<dt class="option-term" id="option-mdman-sources…"><a class="option-anchor" href="#option-mdman-sources…"><em>sources…</em></a></dt>
<dd class="option-desc"><p>The source input filename, may be specified multiple times.</p>
</dd>

Expand Down
6 changes: 2 additions & 4 deletions crates/mdman/src/format/md.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ impl super::Formatter for MdFormatter {
let id = format!("option-{}-{}", man_name, no_tags);
write!(
result,
"<dt class=\"option-term\" id=\"{ID}\">\
<a class=\"option-anchor\" href=\"#{ID}\"></a>{OPTION}</dt>\n",
ID = id,
OPTION = no_p
"<dt class=\"option-term\" id=\"{id}\">\
<a class=\"option-anchor\" href=\"#{id}\">{no_p}</a></dt>\n",
)?;
}
let rendered_block = self.render_html(block)?;
Expand Down
4 changes: 2 additions & 2 deletions crates/mdman/tests/compare/expected/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Shortcut unknown: [shortcut unknown]
[Some link](foo.html)

<dl>
<dt class="option-term" id="option-links---include"><a class="option-anchor" href="#option-links---include"></a><code>--include</code></dt>
<dt class="option-term" id="option-links---include"><a class="option-anchor" href="#option-links---include"><code>--include</code></a></dt>
<dd class="option-desc"><p>Testing an <a href="included_link.html">included link</a>.</p>
</dd>

Expand All @@ -44,7 +44,7 @@ Shortcut unknown: [shortcut unknown]

<dl>

<dt class="option-term" id="option-links---foo-bar"><a class="option-anchor" href="#option-links---foo-bar"></a><code>--foo-bar</code></dt>
<dt class="option-term" id="option-links---foo-bar"><a class="option-anchor" href="#option-links---foo-bar"><code>--foo-bar</code></a></dt>
<dd class="option-desc"><p>Example <a href="bar.html">link</a>.
See <a href="https://example.org/commands/other-cmd.html">other-cmd(1)</a>, <a href="local-cmd.html">local-cmd(1)</a></p>
</dd>
Expand Down
18 changes: 9 additions & 9 deletions crates/mdman/tests/compare/expected/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ A description of the command.

<dl>

<dt class="option-term" id="option-options---foo-bar"><a class="option-anchor" href="#option-options---foo-bar"></a><code>--foo-bar</code></dt>
<dt class="option-term" id="option-options---foo-bar"><a class="option-anchor" href="#option-options---foo-bar"><code>--foo-bar</code></a></dt>
<dd class="option-desc"><p>Demo <em>emphasis</em>, <strong>strong</strong>, <del>strike</del></p>
</dd>


<dt class="option-term" id="option-options--p"><a class="option-anchor" href="#option-options--p"></a><code>-p</code> <em>spec</em></dt>
<dt class="option-term" id="option-options---package"><a class="option-anchor" href="#option-options---package"></a><code>--package</code> <em>spec</em></dt>
<dt class="option-term" id="option-options--p"><a class="option-anchor" href="#option-options--p"><code>-p</code> <em>spec</em></a></dt>
<dt class="option-term" id="option-options---package"><a class="option-anchor" href="#option-options---package"><code>--package</code> <em>spec</em></a></dt>
<dd class="option-desc"><p>This has multiple flags.</p>
</dd>


<dt class="option-term" id="option-options-named-arg…"><a class="option-anchor" href="#option-options-named-arg…"></a><em>named-arg…</em></dt>
<dt class="option-term" id="option-options-named-arg…"><a class="option-anchor" href="#option-options-named-arg…"><em>named-arg…</em></a></dt>
<dd class="option-desc"><p>A named argument.</p>
</dd>


<dt class="option-term" id="option-options---complex"><a class="option-anchor" href="#option-options---complex"></a><code>--complex</code></dt>
<dt class="option-term" id="option-options---complex"><a class="option-anchor" href="#option-options---complex"><code>--complex</code></a></dt>
<dd class="option-desc"><p>This option has a list.</p>
<ul>
<li>alpha</li>
Expand All @@ -60,22 +60,22 @@ A description of the command.
### Common Options

<dl>
<dt class="option-term" id="option-options-@filename"><a class="option-anchor" href="#option-options-@filename"></a><code>@</code><em>filename</em></dt>
<dt class="option-term" id="option-options-@filename"><a class="option-anchor" href="#option-options-@filename"><code>@</code><em>filename</em></a></dt>
<dd class="option-desc"><p>Load from filename.</p>
</dd>


<dt class="option-term" id="option-options---foo"><a class="option-anchor" href="#option-options---foo"></a><code>--foo</code> [<em>bar</em>]</dt>
<dt class="option-term" id="option-options---foo"><a class="option-anchor" href="#option-options---foo"><code>--foo</code> [<em>bar</em>]</a></dt>
<dd class="option-desc"><p>Flag with optional value.</p>
</dd>


<dt class="option-term" id="option-options---foo[=bar]"><a class="option-anchor" href="#option-options---foo[=bar]"></a><code>--foo</code>[<code>=</code><em>bar</em>]</dt>
<dt class="option-term" id="option-options---foo[=bar]"><a class="option-anchor" href="#option-options---foo[=bar]"><code>--foo</code>[<code>=</code><em>bar</em>]</a></dt>
<dd class="option-desc"><p>Alternate syntax for optional value (with required = for disambiguation).</p>
</dd>


<dt class="option-term" id="option-options---split-block"><a class="option-anchor" href="#option-options---split-block"></a><code>--split-block</code></dt>
<dt class="option-term" id="option-options---split-block"><a class="option-anchor" href="#option-options---split-block"><code>--split-block</code></a></dt>
<dd class="option-desc"><p>An option where the description has a <code>block statement that is split across multiple lines</code></p>
</dd>

Expand Down
Loading