Skip to content

Commit

Permalink
Sidebar: Use a better name when no zero title are there
Browse files Browse the repository at this point in the history
  • Loading branch information
panglesd committed Nov 19, 2024
1 parent 8ff9c22 commit aa1bc95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/document/sidebar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,16 @@ end = struct
match Comment.find_zero_heading entry.doc with
| Some t -> t
| None ->
Location_.[ at (span []) (`Word (Id.name entry.id)) ]
let name =
match entry.id.iv with
| `LeafPage (Some parent, name)
when String.equal
(Names.PageName.to_string name)
"index" ->
Id.name parent
| _ -> Id.name entry.id
in
Location_.[ at (span []) (`Word name) ]
in
Comment.link_content title
| _ ->
Expand Down
2 changes: 1 addition & 1 deletion src/driver/odoc_driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ let run mode
(* Grep log index and co commands *)
grep_log `Count_occurrences index_grep;
grep_log `Count_occurrences index_grep;
grep_log `Index (* index_grep *) (Some "");
grep_log `Index index_grep;

List.iter
(fun { Cmd_outputs.log_dest; prefix; run } ->
Expand Down

0 comments on commit aa1bc95

Please sign in to comment.