2022-01-06 13:28:41 +00:00
|
|
|
import DocGen4.Output.Template
|
|
|
|
import DocGen4.Output.Structure
|
|
|
|
|
|
|
|
namespace DocGen4
|
|
|
|
namespace Output
|
|
|
|
|
|
|
|
open scoped DocGen4.Jsx
|
2022-01-06 13:51:46 +00:00
|
|
|
open Lean
|
|
|
|
|
|
|
|
def instanceToHtml (name : Name) : HtmlM Html := do
|
|
|
|
<li><a href={←declNameToLink name}>{name.toString}</a></li>
|
|
|
|
|
|
|
|
def instancesToHtml (i : ClassInfo) : HtmlM Html := do
|
|
|
|
let instancesHtml ← i.instances.mapM instanceToHtml
|
|
|
|
return <details «class»="instances">
|
|
|
|
<summary>Instances</summary>
|
|
|
|
<ul>
|
|
|
|
[instancesHtml]
|
|
|
|
</ul>
|
|
|
|
</details>
|
2022-01-06 13:28:41 +00:00
|
|
|
|
|
|
|
def classToHtml (i : ClassInfo) : HtmlM (Array Html) := do
|
2022-01-06 13:51:46 +00:00
|
|
|
(←structureToHtml i.toStructureInfo).push (←instancesToHtml i)
|
2022-01-06 13:28:41 +00:00
|
|
|
|
|
|
|
end Output
|
|
|
|
end DocGen4
|