Skip to content
Open
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
8 changes: 5 additions & 3 deletions src/html/generator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ let text_align = function

let cell_kind = function `Header -> Html.th | `Data -> Html.td

let rec block ~config ~resolve (l : Block.t) : flow Html.elt list =
let rec block ?(inline_paragraph=false) ~config ~resolve (l : Block.t) : flow Html.elt list =
let as_flow x = (x : phrasing Html.elt list :> flow Html.elt list) in
let one (t : Block.one) =
let mk_block ?(extra_class = []) mk content =
Expand All @@ -234,7 +234,7 @@ let rec block ~config ~resolve (l : Block.t) : flow Html.elt list =
| Inline i ->
if t.attr = [] then as_flow @@ inline ~config ~resolve i
else mk_block Html.span (inline ~config ~resolve i)
| Paragraph i -> mk_block Html.p (inline ~config ~resolve i)
| Paragraph i -> if inline_paragraph then mk_block Html.span (inline ~config ~resolve i) else mk_block Html.p (inline ~config ~resolve i)
| List (typ, l) ->
let mk = match typ with Ordered -> Html.ol | Unordered -> Html.ul in
mk_block mk (List.map (fun x -> Html.li (block ~config ~resolve x)) l)
Expand All @@ -250,7 +250,9 @@ let rec block ~config ~resolve (l : Block.t) : flow Html.elt list =
: phrasing Html.elt list
:> flow Html.elt list)
in
let def = block ~config ~resolve i.Description.definition in
let def =
block ~inline_paragraph:(i.attr = ["raises"]) ~config ~resolve i.Description.definition
in
Html.li ~a (term @ (Html.txt " " :: def))
in
mk_block Html.ul (List.map item l)
Expand Down
2 changes: 1 addition & 1 deletion test/generators/html/Markup.html
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ <h2 id="math"><a href="#math" class="anchor"></a>Math</h2>
</ul>
<ul class="at-tags">
<li class="raises"><span class="at-tag">raises</span>
<code>Failure</code> <p>always</p>
<code>Failure</code> <span>always</span>
</li>
</ul>
<ul class="at-tags">
Expand Down
4 changes: 2 additions & 2 deletions test/generators/html/Ocamlary.html
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ <h4 id="basic-type-and-value-stuff-with-advanced-doc-comments">
<div class="spec-doc">
<ul class="at-tags">
<li class="raises"><span class="at-tag">raises</span>
<code>Not_found</code> <p>That's all it does</p>
<code>Not_found</code> <span>That's all it does</span>
</li>
</ul>
</div>
Expand All @@ -474,7 +474,7 @@ <h4 id="basic-type-and-value-stuff-with-advanced-doc-comments">
<ul class="at-tags">
<li class="raises"><span class="at-tag">raises</span>
<a href="#exception-Kaboom"><code>Kaboom</code></a>
<p>That's all it does</p>
<span>That's all it does</span>
</li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion test/generators/html/Tag_link.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1>Module <code><span>Tag_link</span></code></h1>
</ul>
<ul class="at-tags">
<li class="raises"><span class="at-tag">raises</span> <code>Foo</code>
<p><a href="#val-foo"><code>foo</code></a></p>
<span><a href="#val-foo"><code>foo</code></a></span>
</li>
</ul>
<ul class="at-tags">
Expand Down