Skip to content

Commit

Permalink
Remove rendering of links to documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Paul-Elliot <[email protected]>
  • Loading branch information
panglesd committed Dec 6, 2023
1 parent 4f78011 commit 7053c25
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 40 deletions.
30 changes: 5 additions & 25 deletions src/html/html_source.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,11 @@ let html_of_doc ~config ~resolve docs =
let children = List.concat @@ List.map (doc_to_html ~is_in_a) docs in
match info with
| Syntax tok -> [ span ~a:[ a_class [ tok ] ] children ]
| Link { documentation; implementation } -> (
let href_implementation =
Option.map (Link.href ~config ~resolve) implementation
in
let href_documentation =
Option.map (Link.href ~config ~resolve) documentation
in
let body =
match href_implementation with
| Some href -> [ a ~a:[ a_href href ] children ]
| None -> children
in
match href_documentation with
| None -> body
| Some href ->
[
span
~a:[ a_class [ "jump-to-doc-container" ] ]
[
span ~a:[] body;
a
~a:[ a_href href; a_class [ "jump-to-doc" ] ]
[ txt " 📖" ];
];
])
(* Currently, we do not render links to documentation *)
| Link { documentation = _; implementation = None } -> children
| Link { documentation = _; implementation = Some anchor } ->
let href = Link.href ~config ~resolve anchor in
[ a ~a:[ a_href href ] children ]
| Anchor lbl -> [ span ~a:[ a_id lbl ] children ])
in
span ~a:[] @@ List.concat @@ List.map (doc_to_html ~is_in_a:false) docs
Expand Down
8 changes: 0 additions & 8 deletions src/html_support_files/odoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1203,14 +1203,6 @@ td.def-doc *:first-child {
color: #657b83;
}

.jump-to-doc-container:hover .jump-to-doc {
display: inline;
}

.jump-to-doc {
display: none;
}

/* Source directories */

.odoc-directory::before {
Expand Down
Loading

0 comments on commit 7053c25

Please sign in to comment.