fix: do not show top-level modules twice in navbar
parent
69b5ee76d3
commit
5ed0a8e99f
|
@ -32,13 +32,12 @@ partial def moduleListDir (h : Hierarchy) : HtmlM Html := do
|
|||
[fileNodes]
|
||||
</details>
|
||||
|
||||
def moduleList : HtmlM (Array Html) := do
|
||||
def moduleList : HtmlM Html := do
|
||||
let hierarchy := (←getResult).hierarchy
|
||||
let mut list := Array.empty
|
||||
for (n, cs) in hierarchy.getChildren do
|
||||
list := list.push <h4>{n.toString}</h4>
|
||||
list := list.push $ ←moduleListDir cs
|
||||
list
|
||||
return <div "class"="module_list">[list]</div>
|
||||
|
||||
def navbar : HtmlM Html := do
|
||||
<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>
|
||||
-/
|
||||
<h3>Library</h3>
|
||||
[←moduleList]
|
||||
{← moduleList}
|
||||
</nav>
|
||||
|
||||
end Output
|
||||
|
|
|
@ -268,6 +268,11 @@ nav {
|
|||
margin-bottom: 1ex;
|
||||
}
|
||||
|
||||
/* top-level modules in left navbar */
|
||||
.nav .module_list > details {
|
||||
margin-top: 1ex;
|
||||
}
|
||||
|
||||
.nav details > * {
|
||||
padding-left: 2ex;
|
||||
}
|
||||
|
@ -287,10 +292,6 @@ nav {
|
|||
margin-block-end: 4px;
|
||||
}
|
||||
|
||||
.nav h4 {
|
||||
margin-bottom: 1ex;
|
||||
}
|
||||
|
||||
/* People use way too long declaration names. */
|
||||
.internal_nav, .decl_name {
|
||||
overflow-wrap: break-word;
|
||||
|
|
Loading…
Reference in New Issue