bookshelf-doc/DocGen4/Output/Inductive.lean

18 lines
491 B
Plaintext
Raw Normal View History

import DocGen4.Output.Template
namespace DocGen4
namespace Output
open scoped DocGen4.Jsx
def ctorToHtml (i : NameInfo) : HtmlM Html := do
let shortName := i.name.components'.head!.toString
let name := i.name.toString
return <li «class»="constructor" id={name}>{shortName} : [←infoFormatToHtml i.type]</li>
2022-01-20 13:51:24 +00:00
def inductiveToHtml (i : InductiveInfo) : HtmlM (Array Html) :=
return #[<ul "class"="constructors">[← i.ctors.toArray.mapM ctorToHtml]</ul>]
end Output
end DocGen4