diff --git a/DocGen4/Output.lean b/DocGen4/Output.lean index a698145..9d79088 100644 --- a/DocGen4/Output.lean +++ b/DocGen4/Output.lean @@ -13,6 +13,7 @@ import DocGen4.Output.NotFound import DocGen4.Output.Find import DocGen4.Output.SourceLinker import DocGen4.Output.ToJson +import DocGen4.Output.FoundationalTypes import DocGen4.LeanInk.Process import Lean.Data.HashMap @@ -32,6 +33,7 @@ def htmlOutputSetup (config : SiteBaseContext) : IO Unit := do -- All the doc-gen static stuff let indexHtml := ReaderT.run index config |>.toString let notFoundHtml := ReaderT.run notFound config |>.toString + let foundationalTypesHtml := ReaderT.run foundationalTypes config |>.toString let navbarHtml := ReaderT.run navbar config |>.toString let docGenStatic := #[ ("style.css", styleCss), @@ -43,6 +45,7 @@ def htmlOutputSetup (config : SiteBaseContext) : IO Unit := do ("instances.js", instancesJs), ("importedBy.js", importedByJs), ("index.html", indexHtml), + ("foundational_types.html", foundationalTypesHtml), ("404.html", notFoundHtml), ("navbar.html", navbarHtml) ] diff --git a/DocGen4/Output/FoundationalTypes.lean b/DocGen4/Output/FoundationalTypes.lean new file mode 100644 index 0000000..6112832 --- /dev/null +++ b/DocGen4/Output/FoundationalTypes.lean @@ -0,0 +1,50 @@ +import DocGen4.Output.Template +import DocGen4.Output.Inductive + +namespace DocGen4.Output + +open scoped DocGen4.Jsx + +def foundationalTypes : BaseHtmlM Html := templateLiftExtends (baseHtml "Foundational Type") do + pure <| +
+ +

Foundational Types

+ +

Some of Lean's types are not defined in any Lean source files (even the prelude) since they come from its foundational type theory. This page provides basic documentation for these types.

+

For a more in-depth explanation of Lean's type theory, refer to + TPiL.

+ + +

Sort u

+

Sort u is the type of types in Lean, and Sort u : Sort (u + 1).

+ {← instancesForToHtml `_builtin_sortu} + +

Type u

+

Type u is notation for Sort (u + 1).

+ {← instancesForToHtml `_builtin_typeu} + +

Prop

+

Prop is notation for Sort 0.

+ {← instancesForToHtml `_builtin_prop} + +

Pi types, {"Π a : α, β a"}

+

The type of dependent functions is known as a pi type. + Non-dependent functions and implications are a special case.

+

Note that these can also be written with the alternative notations:

+ +

Lean also permits ASCII-only spellings of the three variants:

+ +

Note that despite not itself being a function, (→) is available as infix notation for + {"λ α β, α → β"}.

+ -- TODO: instnaces for pi types +
+ +end DocGen4.Output diff --git a/DocGen4/Output/Inductive.lean b/DocGen4/Output/Inductive.lean index b12f125..7d27cc3 100644 --- a/DocGen4/Output/Inductive.lean +++ b/DocGen4/Output/Inductive.lean @@ -8,7 +8,7 @@ namespace Output open scoped DocGen4.Jsx open Lean -def instancesForToHtml (typeName : Name) : HtmlM Html := do +def instancesForToHtml (typeName : Name) : BaseHtmlM Html := do pure
Instances For diff --git a/DocGen4/Output/Navbar.lean b/DocGen4/Output/Navbar.lean index 5952b6d..f5d2612 100644 --- a/DocGen4/Output/Navbar.lean +++ b/DocGen4/Output/Navbar.lean @@ -69,6 +69,7 @@ def navbar : BaseHtmlM Html := do