Description
Note the following is about definitions not code fences.
The markup for definitions could be more semantic and the layout should be improved as it can be pretty bad on long definitions since it may wrap anywhere, something a sensitive OCaml programmer would never do.
First these things would be good to have:
- The whole definition should be wrapped by a
<code>
tag. - The identifier being defined should be
class
ified via a<span>
. - The constructors of variants should be
class
ified via a<span>
the same way they are classified in textualcode
spans.
Regarding the layout there are at least two solutions that can be tried.
a) <pre>
can be used instead of <div class="def">
and all the formatting is done manually (this is the way ocamldoc
proceeds), the disadvantage is that it will not be responsive to the page width.
b) <div class = "def">
is kept but we try to control the line breaking algorithm by only using spaces at the places where we would like to break (e.g. before |
, after ->
) and using non breaking spaces U+00A0 where we don't want to break. I should then be able to make an indent via css' text-indent
.
I have a slight preference to try what b) can give us.