types, types everywhere
parent
14afcdbeaf
commit
0ac64f0873
|
@ -35,7 +35,7 @@ def TypeInfo.toHtml (tyi : TypeInfo) : AlectryonM Html := do
|
||||||
<span class="hyp-type">
|
<span class="hyp-type">
|
||||||
<var>{tyi.name}</var>
|
<var>{tyi.name}</var>
|
||||||
<b>: </b>
|
<b>: </b>
|
||||||
<span>{tyi.type}</span>
|
<span>[←DocGen4.Output.infoFormatToHtml tyi.type.fst]</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
@ -80,16 +80,16 @@ def Contents.toHtml : Contents → AlectryonM Html
|
||||||
|
|
||||||
def Hypothesis.toHtml (h : Hypothesis) : AlectryonM Html := do
|
def Hypothesis.toHtml (h : Hypothesis) : AlectryonM Html := do
|
||||||
let mut hypParts := #[<var>[h.names.intersperse ", " |>.map Html.text |>.toArray]</var>]
|
let mut hypParts := #[<var>[h.names.intersperse ", " |>.map Html.text |>.toArray]</var>]
|
||||||
if h.body != "" then
|
if h.body.snd != "" then
|
||||||
hypParts := hypParts.push
|
hypParts := hypParts.push
|
||||||
<span class="hyp-body">
|
<span class="hyp-body">
|
||||||
<b>:= </b>
|
<b>:= </b>
|
||||||
<span>{h.body}</span>
|
<span>[←infoFormatToHtml h.body.fst]</span>
|
||||||
</span>
|
</span>
|
||||||
hypParts := hypParts.push
|
hypParts := hypParts.push
|
||||||
<span class="hyp-type">
|
<span class="hyp-type">
|
||||||
<b>: </b>
|
<b>: </b>
|
||||||
<span >{h.type}</span>
|
<span >[←infoFormatToHtml h.type.fst]</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
pure
|
pure
|
||||||
|
@ -103,6 +103,11 @@ def Goal.toHtml (g : Goal) : AlectryonM Html := do
|
||||||
let rendered ← hyp.toHtml
|
let rendered ← hyp.toHtml
|
||||||
hypotheses := hypotheses.push rendered
|
hypotheses := hypotheses.push rendered
|
||||||
hypotheses := hypotheses.push <br/>
|
hypotheses := hypotheses.push <br/>
|
||||||
|
let conclusionHtml ←
|
||||||
|
match g.conclusion with
|
||||||
|
| .typed info _ => infoFormatToHtml info
|
||||||
|
| .untyped str => pure <| #[Html.text str]
|
||||||
|
|
||||||
pure
|
pure
|
||||||
<blockquote class="alectryon-goal">
|
<blockquote class="alectryon-goal">
|
||||||
<div class="goal-hyps">
|
<div class="goal-hyps">
|
||||||
|
@ -112,7 +117,7 @@ def Goal.toHtml (g : Goal) : AlectryonM Html := do
|
||||||
<hr><span class="goal-name">{g.name}</span></hr>
|
<hr><span class="goal-name">{g.name}</span></hr>
|
||||||
</span>
|
</span>
|
||||||
<div class="goal-conclusion">
|
<div class="goal-conclusion">
|
||||||
{g.conclusion}
|
[conclusionHtml]
|
||||||
</div>
|
</div>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
|
@ -209,14 +209,14 @@ partial def infoFormatToHtml (i : CodeWithInfos) : HtmlM (Array Html) := do
|
||||||
| Info.ofTermInfo i =>
|
| Info.ofTermInfo i =>
|
||||||
match i.expr.consumeMData with
|
match i.expr.consumeMData with
|
||||||
| Expr.const name _ =>
|
| Expr.const name _ =>
|
||||||
match t with
|
match t with
|
||||||
| TaggedText.text t =>
|
| TaggedText.text t =>
|
||||||
let (front, t, back) := splitWhitespaces <| Html.escape t
|
let (front, t, back) := splitWhitespaces <| Html.escape t
|
||||||
let elem := <a href={←declNameToLink name}>{t}</a>
|
let elem := <a href={←declNameToLink name}>{t}</a>
|
||||||
pure #[Html.text front, elem, Html.text back]
|
pure #[Html.text front, elem, Html.text back]
|
||||||
| _ =>
|
| _ =>
|
||||||
-- TODO: Is this ever reachable?
|
-- TODO: Is this ever reachable?
|
||||||
pure #[<a href={←declNameToLink name}>[←infoFormatToHtml t]</a>]
|
pure #[<a href={←declNameToLink name}>[←infoFormatToHtml t]</a>]
|
||||||
| _ =>
|
| _ =>
|
||||||
pure #[<span class="fn">[←infoFormatToHtml t]</span>]
|
pure #[<span class="fn">[←infoFormatToHtml t]</span>]
|
||||||
| _ => pure #[<span class="fn">[←infoFormatToHtml t]</span>]
|
| _ => pure #[<span class="fn">[←infoFormatToHtml t]</span>]
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"rev": "112b35fc348a4a18d2111ac2c6586163330b4941",
|
"rev": "112b35fc348a4a18d2111ac2c6586163330b4941",
|
||||||
"name": "Cli"},
|
"name": "Cli"},
|
||||||
{"url": "https://github.com/hargonix/LeanInk",
|
{"url": "https://github.com/hargonix/LeanInk",
|
||||||
"rev": "3ab183e60a2aa082fb20c3bc139b992f683ae1d4",
|
"rev": "0c113bb4cc88d4b8dc6b2d26a4c4c9cf6008a2eb",
|
||||||
"name": "leanInk"},
|
"name": "leanInk"},
|
||||||
{"url": "https://github.com/xubaiw/Unicode.lean",
|
{"url": "https://github.com/xubaiw/Unicode.lean",
|
||||||
"rev": "1fb004da96aa1d1e98535951e100439a60f5b7f0",
|
"rev": "1fb004da96aa1d1e98535951e100439a60f5b7f0",
|
||||||
|
|
Loading…
Reference in New Issue