bookshelf-doc/DocGen4/Output/Class.lean

27 lines
682 B
Plaintext
Raw Normal View History

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
2022-02-04 21:48:08 +00:00
def classInstanceToHtml (name : Name) : HtmlM Html := do
2022-01-06 13:51:46 +00:00
<li><a href={←declNameToLink name}>{name.toString}</a></li>
2022-02-04 21:48:08 +00:00
def classInstancesToHtml (i : ClassInfo) : HtmlM Html := do
let instancesHtml ← i.instances.mapM classInstanceToHtml
2022-01-06 13:51:46 +00:00
return <details «class»="instances">
<summary>Instances</summary>
<ul>
[instancesHtml]
</ul>
</details>
def classToHtml (i : ClassInfo) : HtmlM (Array Html) := do
2022-02-04 21:48:08 +00:00
(←structureToHtml i.toStructureInfo).push (←classInstancesToHtml i)
end Output
end DocGen4