fix: do not show top-level modules twice in navbar

main
Gabriel Ebner 2022-01-20 15:01:51 +01:00
parent 69b5ee76d3
commit 5ed0a8e99f
2 changed files with 8 additions and 8 deletions

View File

@ -32,13 +32,12 @@ partial def moduleListDir (h : Hierarchy) : HtmlM Html := do
[fileNodes] [fileNodes]
</details> </details>
def moduleList : HtmlM (Array Html) := do def moduleList : HtmlM Html := do
let hierarchy := (←getResult).hierarchy let hierarchy := (←getResult).hierarchy
let mut list := Array.empty let mut list := Array.empty
for (n, cs) in hierarchy.getChildren do for (n, cs) in hierarchy.getChildren do
list := list.push <h4>{n.toString}</h4>
list := list.push $ ←moduleListDir cs list := list.push $ ←moduleListDir cs
list return <div "class"="module_list">[list]</div>
def navbar : HtmlM Html := do def navbar : HtmlM Html := do
<nav «class»="nav"> <nav «class»="nav">
@ -54,7 +53,7 @@ def navbar : HtmlM Html := do
<div «class»="nav_link"><a href={s!"{←getRoot}references.html"}>references</a></div> <div «class»="nav_link"><a href={s!"{←getRoot}references.html"}>references</a></div>
-/ -/
<h3>Library</h3> <h3>Library</h3>
[←moduleList] {← moduleList}
</nav> </nav>
end Output end Output

View File

@ -268,6 +268,11 @@ nav {
margin-bottom: 1ex; margin-bottom: 1ex;
} }
/* top-level modules in left navbar */
.nav .module_list > details {
margin-top: 1ex;
}
.nav details > * { .nav details > * {
padding-left: 2ex; padding-left: 2ex;
} }
@ -287,10 +292,6 @@ nav {
margin-block-end: 4px; margin-block-end: 4px;
} }
.nav h4 {
margin-bottom: 1ex;
}
/* People use way too long declaration names. */ /* People use way too long declaration names. */
.internal_nav, .decl_name { .internal_nav, .decl_name {
overflow-wrap: break-word; overflow-wrap: break-word;