diff --git a/DocGen4/Output/Structure.lean b/DocGen4/Output/Structure.lean
index 2c5b76d..688324f 100644
--- a/DocGen4/Output/Structure.lean
+++ b/DocGen4/Output/Structure.lean
@@ -4,14 +4,27 @@ 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
{shortName} : [←infoFormatToHtml f.type]
+ return {s!"{shortName} "} : [←infoFormatToHtml f.type]
def structureToHtml (i : StructureInfo) : HtmlM (Array Html) := do
- #[Html.element "ul" false #[("class", "structure_fields"), ("id", s!"{i.name.toString}.mk")] (←i.fieldInfo.mapM fieldToHtml)]
+ 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
diff --git a/lean-toolchain b/lean-toolchain
index 19c9eec..42a3c93 100644
--- a/lean-toolchain
+++ b/lean-toolchain
@@ -1 +1 @@
-leanprover/lean4:nightly-2022-01-16
+leanprover/lean4:nightly-2022-02-01
diff --git a/static/style.css b/static/style.css
index 958eb2f..7e28a65 100644
--- a/static/style.css
+++ b/static/style.css
@@ -455,7 +455,8 @@ main h2, main h3, main h4, main h5, main h6 {
}
.imports li, code, .decl_header, .attributes, .structure_field,
- .constructor, .instances li, .equation, #search_results div {
+ .constructor, .instances li, .equation, #search_results div,
+ .structure_ext_ctor {
font-family: 'Source Code Pro', monospace;
}
@@ -484,6 +485,22 @@ pre code { padding: 0 0; }
margin-left: 2ex;
}
+.structure_ext_fields {
+ display: block;
+ padding-inline-start: 0;
+ margin-top: 1ex;
+ text-indent: -2ex; padding-left: 2ex;
+}
+
+.structure_ext_fields .structure_field {
+ margin-left: -1ex !important;
+}
+
+.structure_ext_ctor {
+ display: block;
+ text-indent: -3ex;
+}
+
.constructor {
display: block;
}