Skip to content

Commit a538125

Browse files
committed
ToC nesting levels
1 parent 71a0082 commit a538125

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

scaladoc-js/main/src/searchbar/SearchbarComponent.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ class SearchbarComponent(engine: PageSearchEngine, inkuireEngine: InkuireJSSearc
301301
val searchbarFooter = div(id := "searchbar-footer", cls := "body-small")(
302302
span(cls := "searchbar-footer-left-container")(
303303
span("Smart search:"),
304-
span(b("CC "), "to find CamcelCase phrases"),
305-
span(b("A=>B "), "to find CamcelCase signatures"),
304+
span(b("CC "), "to find CamelCase phrases"),
305+
span(b("A=>B "), "to find CamelCase signatures"),
306306
),
307307
span(cls := "searchbar-footer-right-container")(
308308
span(b("Esc "), "to close"),

scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ class HtmlRenderer(rootPackage: Member, members: Map[DRI, Member])(using ctx: Do
188188
li(ul(renderTocRec(level + 1, prefix))) +: renderTocRec(level, suffix)
189189
}
190190

191-
renderTocRec(1, toc).headOption.map(toc => nav(cls := "toc-nav")(ul(cls := "toc-list")(toc)))
191+
if toc.nonEmpty then
192+
val minLevel = toc.minBy(_.level).level
193+
Some(nav(cls := "toc-nav")(ul(cls := "toc-list")(renderTocRec(minLevel, toc))))
194+
else None
192195

193196

194197
private def mkFrame(link: Link, parents: Vector[Link], content: AppliedTag, toc: Seq[TocEntry]): AppliedTag =

0 commit comments

Comments
 (0)