feat: equations for instances
parent
f54c192e6f
commit
419c1eb1e6
|
@ -7,11 +7,11 @@ namespace Output
|
|||
open scoped DocGen4.Jsx
|
||||
open Lean
|
||||
|
||||
def instanceToHtml (name : Name) : HtmlM Html := do
|
||||
def classInstanceToHtml (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
|
||||
def classInstancesToHtml (i : ClassInfo) : HtmlM Html := do
|
||||
let instancesHtml ← i.instances.mapM classInstanceToHtml
|
||||
return <details «class»="instances">
|
||||
<summary>Instances</summary>
|
||||
<ul>
|
||||
|
@ -20,7 +20,7 @@ def instancesToHtml (i : ClassInfo) : HtmlM Html := do
|
|||
</details>
|
||||
|
||||
def classToHtml (i : ClassInfo) : HtmlM (Array Html) := do
|
||||
(←structureToHtml i.toStructureInfo).push (←instancesToHtml i)
|
||||
(←structureToHtml i.toStructureInfo).push (←classInstancesToHtml i)
|
||||
|
||||
end Output
|
||||
end DocGen4
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
import DocGen4.Output.Template
|
||||
import DocGen4.Output.Definition
|
||||
|
||||
namespace DocGen4
|
||||
namespace Output
|
||||
|
||||
def instanceToHtml (i : InstanceInfo) : HtmlM (Array Html) := definitionToHtml i
|
||||
|
||||
end Output
|
||||
end DocGen4
|
|
@ -8,6 +8,7 @@ import DocGen4.Output.Inductive
|
|||
import DocGen4.Output.Structure
|
||||
import DocGen4.Output.Class
|
||||
import DocGen4.Output.Definition
|
||||
import DocGen4.Output.Instance
|
||||
|
||||
namespace DocGen4
|
||||
namespace Output
|
||||
|
@ -77,6 +78,7 @@ def docInfoToHtml (module : Name) (doc : DocInfo) : HtmlM Html := do
|
|||
| DocInfo.structureInfo i => structureToHtml i
|
||||
| DocInfo.classInfo i => classToHtml i
|
||||
| DocInfo.definitionInfo i => definitionToHtml i
|
||||
| DocInfo.instanceInfo i => instanceToHtml i
|
||||
| _ => #[]
|
||||
|
||||
return <div «class»="decl" id={doc.getName.toString}>
|
||||
|
|
Loading…
Reference in New Issue