import DocGen4.Output.Template
namespace DocGen4
namespace Output
open scoped DocGen4.Jsx
open Lean
def fieldToHtml (f : NameInfo) : HtmlM Html := do
let shortName := f.name.components'.head!.toString
let name := f.name.toString
return
{s!"{shortName} "} : [←infoFormatToHtml f.type]
def structureToHtml (i : StructureInfo) : HtmlM (Array Html) := do
if Name.isSuffixOf `mk i.ctor.name then
#[
[←i.fieldInfo.mapM fieldToHtml]
]
else
let ctorShortName := i.ctor.name.components'.head!.toString
#[
- {s!"{ctorShortName} "} :: (
[←i.fieldInfo.mapM fieldToHtml]
- )
]
end Output
end DocGen4