fix: add nav link to non leaf node modules
parent
2dac93d360
commit
2f5a95b312
|
@ -28,7 +28,7 @@ partial def moduleListDir (h : Hierarchy) : HtmlM Html := do
|
|||
pure
|
||||
<details "class"="nav_sect" "data-path"={moduleLink}
|
||||
[if (←getCurrentName).any (h.getName.isPrefixOf ·) then #[("open", "")] else #[]]>
|
||||
<summary>{h.getName.toString}</summary>
|
||||
<summary><a "href"={← moduleNameToLink h.getName}>{h.getName.toString}</a></summary>
|
||||
[dirNodes]
|
||||
[fileNodes]
|
||||
</details>
|
||||
|
|
|
@ -33,9 +33,9 @@ def attributesToString (attrs : Array (String × String)) :String :=
|
|||
|
||||
-- TODO: Termination proof
|
||||
partial def toStringAux : Html → String
|
||||
| element tag false attrs #[text s] => s!"<{tag}{attributesToString attrs}>{s}</{tag}>\n"
|
||||
| element tag false attrs #[child] => s!"<{tag}{attributesToString attrs}>\n{child.toStringAux}</{tag}>\n"
|
||||
| element tag false attrs children => s!"<{tag}{attributesToString attrs}>\n{children.foldl (· ++ toStringAux ·) ""}</{tag}>\n"
|
||||
| element tag false attrs #[text s] => s!"<{tag}{attributesToString attrs}>{s}</{tag}>"
|
||||
| element tag false attrs #[child] => s!"<{tag}{attributesToString attrs}>{child.toStringAux}</{tag}>"
|
||||
| element tag false attrs children => s!"<{tag}{attributesToString attrs}>{children.foldl (· ++ toStringAux ·) ""}</{tag}>"
|
||||
| element tag true attrs children => s!"<{tag}{attributesToString attrs}>{children.foldl (· ++ toStringAux ·) ""}</{tag}>"
|
||||
| text s => s
|
||||
|
||||
|
|
|
@ -273,13 +273,10 @@ nav {
|
|||
margin-top: 1ex;
|
||||
}
|
||||
|
||||
.nav details > * {
|
||||
.nav details, .nav_link {
|
||||
padding-left: 2ex;
|
||||
}
|
||||
.nav summary {
|
||||
cursor: pointer;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.nav summary::marker {
|
||||
font-size: 85%;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue