Skip to content

Commit 15defae

Browse files
committed
Sidebar: Use a better name when no zero title are there
1 parent 57854ca commit 15defae

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/document/sidebar.ml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,16 @@ end = struct
8686
match Comment.find_zero_heading entry.doc with
8787
| Some t -> t
8888
| None ->
89-
Location_.[ at (span []) (`Word (Id.name entry.id)) ]
89+
let name =
90+
match entry.id.iv with
91+
| `LeafPage (Some parent, name)
92+
when String.equal
93+
(Names.PageName.to_string name)
94+
"index" ->
95+
Id.name parent
96+
| _ -> Id.name entry.id
97+
in
98+
Location_.[ at (span []) (`Word name) ]
9099
in
91100
Comment.link_content title
92101
| _ ->

src/driver/odoc_driver.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ let run mode
258258
(* Grep log index and co commands *)
259259
grep_log `Count_occurrences index_grep;
260260
grep_log `Count_occurrences index_grep;
261-
grep_log `Index (* index_grep *) (Some "");
261+
grep_log `Index index_grep;
262262

263263
List.iter
264264
(fun { Cmd_outputs.log_dest; prefix; run } ->

0 commit comments

Comments
 (0)