[OCaml] Mobile-friendly clone of cgit.
fix hide TOC when document has only a single heading
A table of contents is unhelpful when the README contains just one heading (title-only or single section). The TOC now requires at least two body headings before rendering.
lib/doc_format.ml
@@ -129,7 +129,7 @@
129
129
130
130
let render_toc ~title_text body_headings =
131
131
match body_headings with
132
Removed:
| [] -> Ui.nothing
132
Added:
| [] | [ _ ] -> Ui.nothing
133
133
| _ ->
134
134
let toc_anchor = new_anchor () in
135
135
(match title_text with Some t -> ignore (toc_anchor t) | None -> ());