Skip to content

Commit

Permalink
Simplify css for docs on variants and poly-variants
Browse files Browse the repository at this point in the history
- Consider poly-variants as variants
- Always go to line to display a doc-comment

Signed-off-by: Paul-Elliot <[email protected]>
  • Loading branch information
panglesd committed Jul 5, 2023
1 parent 50c676e commit 745ba87
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
4 changes: 3 additions & 1 deletion src/document/generator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,9 @@ module Make (Syntax : SYNTAX) = struct
let markers = Syntax.Comment.markers in
try
let url = Url.Anchor.polymorphic_variant ~type_ident item 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 anchor = Some url in
let code = O.code (O.txt "| ") @ cstr in
let doc = match doc with None -> [] | Some doc -> doc in
Expand Down
6 changes: 1 addition & 5 deletions src/html_support_files/odoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,6 @@ div.odoc-spec,.odoc-include {
.spec.type .variant, .spec.type .record {
margin-left: 2ch;
list-style: none;
display: flex;
flex-wrap: wrap;
row-gap: 4px;
}

.spec.type .record > code, .spec.type .variant > code {
Expand All @@ -560,9 +557,8 @@ div.odoc-spec,.odoc-include {
padding: 0.25em 0.5em;
margin-left: 10%;
border-radius: 3px;
flex-grow:1;
background: var(--main-background);
box-shadow: 2px 2px 4px lightgrey;
box-shadow: 1px 1px 2px lightgrey;
}

div.def {
Expand Down
Loading

0 comments on commit 745ba87

Please sign in to comment.