We planned to upgrade GitLab and Mattermost to the latest version this Friday morning (early). You may experience some downtime!

Verified Commit fafd771b authored by Camil Staps's avatar Camil Staps 🚀

Implement a basic sidebar

parent acb3beba
Pipeline #14409 passed with stage
in 58 seconds
......@@ -43,7 +43,7 @@ where
[ DivTag [IdAttr "container"]
[ DivTag [IdAttr "content"] [html]
, DivTag [IdAttr "sidebar"]
[ DivTag [IdAttr "toc"] [Text "sidebar"]
[ DivTag [IdAttr "toc"] [H1Tag [] [Text "Documentation"], UlTag [] (map sidebarLink (sort mcoll))]
, DivTag [IdAttr "search"] [Text "(search functionality not implemented yet)"]
]
]
......@@ -57,7 +57,11 @@ where
dirLength "" = 0
dirLength fp = 1 + dirLength (takeDirectory fp)
moduleFile :: !(Described ModuleDescription ModuleDoc) -> (FilePath, HtmlTag)
sidebarLink :: !DescribedModule -> HtmlTag
sidebarLink dm = LiTag []
[ATag [HrefAttr (relativePath ("mod" </> dm.name +++ ".html"))] [Text dm.name]]
moduleFile :: !DescribedModule -> (FilePath, HtmlTag)
moduleFile m = ("mod" </> m.name +++ ".html", html)
where
html = DivTag [] $ catMaybes
......@@ -69,7 +73,7 @@ where
, Just $ DivTag [IdAttr "functions"] functions
]
typedefs =
typedefs = if (isEmpty m.elem.mod_type_defs) []
[ H1Tag [] [Text "Type definitions"]
: map html (sort m.elem.mod_type_defs)
]
......@@ -80,7 +84,7 @@ where
, Just $ PreTag [ClassAttr "clean-code"] [Html (fromJust dtd.repr)]
]
classes =
classes = if (isEmpty m.elem.mod_classes) []
[ H1Tag [] [Text "Classes"]
: map html (sort m.elem.mod_classes)
]
......@@ -93,7 +97,7 @@ where
macros = []
functions =
functions = if (isEmpty m.elem.mod_functions) []
[ H1Tag [] [Text "Functions"]
: map html (sort m.elem.mod_functions)
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment