Skip to content

Commit

Permalink
Consider extension constructor as constructors in css
Browse files Browse the repository at this point in the history
  • Loading branch information
panglesd committed Sep 12, 2023
1 parent 51330e1 commit a8ba89c
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
4 changes: 3 additions & 1 deletion src/document/generator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,9 @@ module Make (Syntax : SYNTAX) = struct
| Error e -> failwith (Url.Error.to_string e)
| Ok url ->
let anchor = Some url in
let attrs = [ "def"; Url.Anchor.string_of_kind url.kind ] in
let attrs =
[ "def"; "variant"; Url.Anchor.string_of_kind url.kind ]
in
let code =
O.documentedSrc (O.txt "| ") @ constructor id t.args t.res
in
Expand Down
2 changes: 1 addition & 1 deletion test/generators/html/Labels.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ <h2 id="L2"><a href="#L2" class="anchor"></a>Attached to nothing</h2>
</span>
</code>
<ol>
<li id="extension-X" class="def extension anchored">
<li id="extension-X" class="def variant extension anchored">
<a href="#extension-X" class="anchor"></a>
<code><span>| </span><span><span class="extension">X</span></span>
</code>
Expand Down
2 changes: 1 addition & 1 deletion test/generators/html/Ocamlary-ExtMod.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h1>Module <code><span>Ocamlary.ExtMod</span></code></h1>
</span>
</code>
<ol>
<li id="extension-Leisureforce" class="def extension anchored">
<li id="extension-Leisureforce" class="def variant extension anchored">
<a href="#extension-Leisureforce" class="anchor"></a>
<code><span>| </span>
<span><span class="extension">Leisureforce</span></span>
Expand Down
2 changes: 1 addition & 1 deletion test/generators/html/Ocamlary-module-type-TypeExt.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1>Module type <code><span>Ocamlary.TypeExt</span></code></h1>
</span>
</code>
<ol>
<li id="extension-C" class="def extension anchored">
<li id="extension-C" class="def variant extension anchored">
<a href="#extension-C" class="anchor"></a>
<code><span>| </span><span><span class="extension">C</span></span>
</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h1>Module type <code><span>Ocamlary.TypeExtPruned</span></code></h1>
</span>
</code>
<ol>
<li id="extension-C" class="def extension anchored">
<li id="extension-C" class="def variant extension anchored">
<a href="#extension-C" class="anchor"></a>
<code><span>| </span><span><span class="extension">C</span></span>
</code>
Expand Down
24 changes: 12 additions & 12 deletions test/generators/html/Ocamlary.html
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ <h4 id="advanced-type-stuff">
</span>
</code>
<ol>
<li id="extension-ExtA" class="def extension anchored">
<li id="extension-ExtA" class="def variant extension anchored">
<a href="#extension-ExtA" class="anchor"></a>
<code><span>| </span><span><span class="extension">ExtA</span></span>
</code>
Expand All @@ -1813,7 +1813,7 @@ <h4 id="advanced-type-stuff">
</span>
</code>
<ol>
<li id="extension-ExtB" class="def extension anchored">
<li id="extension-ExtB" class="def variant extension anchored">
<a href="#extension-ExtB" class="anchor"></a>
<code><span>| </span><span><span class="extension">ExtB</span></span>
</code>
Expand All @@ -1829,15 +1829,15 @@ <h4 id="advanced-type-stuff">
</span>
</code>
<ol>
<li id="extension-ExtC" class="def extension anchored">
<li id="extension-ExtC" class="def variant extension anchored">
<a href="#extension-ExtC" class="anchor"></a>
<code><span>| </span>
<span><span class="extension">ExtC</span>
<span class="keyword">of</span> unit
</span>
</code>
</li>
<li id="extension-ExtD" class="def extension anchored">
<li id="extension-ExtD" class="def variant extension anchored">
<a href="#extension-ExtD" class="anchor"></a>
<code><span>| </span>
<span><span class="extension">ExtD</span>
Expand All @@ -1856,7 +1856,7 @@ <h4 id="advanced-type-stuff">
</span>
</code>
<ol>
<li id="extension-ExtE" class="def extension anchored">
<li id="extension-ExtE" class="def variant extension anchored">
<a href="#extension-ExtE" class="anchor"></a>
<code><span>| </span><span><span class="extension">ExtE</span></span>
</code>
Expand All @@ -1872,7 +1872,7 @@ <h4 id="advanced-type-stuff">
</span>
</code>
<ol>
<li id="extension-ExtF" class="def extension anchored">
<li id="extension-ExtF" class="def variant extension anchored">
<a href="#extension-ExtF" class="anchor"></a>
<code><span>| </span><span><span class="extension">ExtF</span></span>
</code>
Expand All @@ -1898,15 +1898,15 @@ <h4 id="advanced-type-stuff">
</span>
</code>
<ol>
<li id="extension-Foo" class="def extension anchored">
<li id="extension-Foo" class="def variant extension anchored">
<a href="#extension-Foo" class="anchor"></a>
<code><span>| </span>
<span><span class="extension">Foo</span>
<span class="keyword">of</span> <span class="type-var">'b</span>
</span>
</code>
</li>
<li id="extension-Bar" class="def extension anchored">
<li id="extension-Bar" class="def variant extension anchored">
<a href="#extension-Bar" class="anchor"></a>
<code><span>| </span>
<span><span class="extension">Bar</span>
Expand All @@ -1930,7 +1930,7 @@ <h4 id="advanced-type-stuff">
</span>
</code>
<ol>
<li id="extension-Quux" class="def extension anchored">
<li id="extension-Quux" class="def variant extension anchored">
<a href="#extension-Quux" class="anchor"></a>
<code><span>| </span>
<span><span class="extension">Quux</span>
Expand Down Expand Up @@ -1966,7 +1966,7 @@ <h4 id="advanced-type-stuff">
</span>
</code>
<ol>
<li id="extension-ZzzTop0" class="def extension anchored">
<li id="extension-ZzzTop0" class="def variant extension anchored">
<a href="#extension-ZzzTop0" class="anchor"></a>
<code><span>| </span>
<span><span class="extension">ZzzTop0</span></span>
Expand All @@ -1987,7 +1987,7 @@ <h4 id="advanced-type-stuff">
</span>
</code>
<ol>
<li id="extension-ZzzTop" class="def extension anchored">
<li id="extension-ZzzTop" class="def variant extension anchored">
<a href="#extension-ZzzTop" class="anchor"></a>
<code><span>| </span>
<span><span class="extension">ZzzTop</span>
Expand Down Expand Up @@ -2931,7 +2931,7 @@ <h2 id="new-reference-syntax">
</span>
</code>
<ol>
<li id="extension-C" class="def extension anchored">
<li id="extension-C" class="def variant extension anchored">
<a href="#extension-C" class="anchor"></a>
<code><span>| </span><span><span class="extension">C</span></span>
</code>
Expand Down
6 changes: 3 additions & 3 deletions test/generators/html/Type.html
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ <h1>Module <code><span>Type</span></code></h1>
</span>
</code>
<ol>
<li id="extension-Extension" class="def extension anchored">
<li id="extension-Extension" class="def variant extension anchored">
<a href="#extension-Extension" class="anchor"></a>
<code><span>| </span>
<span><span class="extension">Extension</span></span>
Expand All @@ -764,8 +764,8 @@ <h1>Module <code><span>Type</span></code></h1>
</p><span class="comment-delim">*)</span>
</div>
</li>
<li id="extension-Another_extension" class="def extension anchored">
<a href="#extension-Another_extension" class="anchor"></a>
<li id="extension-Another_extension" class="def variant extension
anchored"><a href="#extension-Another_extension" class="anchor"></a>
<code><span>| </span>
<span><span class="extension">Another_extension</span></span>
</code>
Expand Down

0 comments on commit a8ba89c

Please sign in to comment.