diff --git a/DocGen4/Output/Navbar.lean b/DocGen4/Output/Navbar.lean index e2ab585..6cd28b3 100644 --- a/DocGen4/Output/Navbar.lean +++ b/DocGen4/Output/Navbar.lean @@ -15,7 +15,7 @@ open scoped DocGen4.Jsx def moduleListFile (file : NameExt) : BaseHtmlM Html := do return
- {file.getString!} + {file.getString!}
/-- @@ -23,11 +23,14 @@ Build the HTML tree representing the module hierarchy. -/ partial def moduleListDir (h : Hierarchy) : BaseHtmlM Html := do let children := Array.mk (h.getChildren.toList.map Prod.snd) - let dirs := children.filter (fun c => c.getChildren.toList.length != 0) - let files := children.filter (fun c => Hierarchy.isFile c && c.getChildren.toList.length = 0) - |>.map Hierarchy.getNameExt - let dirNodes ← dirs.mapM moduleListDir - let fileNodes ← files.mapM moduleListFile + let nodes ← children.mapM (fun c => + if c.getChildren.toList.length != 0 then + moduleListDir c + else if Hierarchy.isFile c && c.getChildren.toList.length = 0 then + moduleListFile (Hierarchy.getNameExt c) + else + pure "" + ) let moduleLink ← moduleNameToHtmlLink h.getName let summary := if h.isFile then @@ -38,8 +41,7 @@ partial def moduleListDir (h : Hierarchy) : BaseHtmlM Html := do pure /-- diff --git a/DocGen4/Process/NameExt.lean b/DocGen4/Process/NameExt.lean index 7353b1a..2966f40 100644 --- a/DocGen4/Process/NameExt.lean +++ b/DocGen4/Process/NameExt.lean @@ -18,6 +18,12 @@ def cmp : Extension → Extension → Ordering | pdf, pdf => Ordering.eq | pdf, _ => Ordering.gt +instance : BEq Extension where + beq e1 e2 := + match cmp e1 e2 with + | Ordering.eq => true + | _ => false + def toString : Extension → String | html => "html" | pdf => "pdf" diff --git a/static/style.css b/static/style.css index 27179a6..1ca6899 100644 --- a/static/style.css +++ b/static/style.css @@ -14,6 +14,10 @@ a { color: var(--link-color); } +a.pdf_link { + color: purple; +} + h1, h2, h3, h4, h5, h6 { font-family: 'Merriweather', serif; }