chore: update compiler version
parent
1edf4bbdab
commit
735bfa35a7
|
@ -11,9 +11,8 @@ namespace DocGen4
|
||||||
open Lean Std Name
|
open Lean Std Name
|
||||||
|
|
||||||
def getNLevels (name : Name) (levels: Nat) : Name :=
|
def getNLevels (name : Name) (levels: Nat) : Name :=
|
||||||
|
let components := name.components'
|
||||||
(components.drop (components.length - levels)).reverse.foldl (· ++ ·) Name.anonymous
|
(components.drop (components.length - levels)).reverse.foldl (· ++ ·) Name.anonymous
|
||||||
where
|
|
||||||
components := name.components'
|
|
||||||
|
|
||||||
inductive Hierarchy where
|
inductive Hierarchy where
|
||||||
| node (name : Name) (isFile : Bool) (children : RBNode Name (λ _ => Hierarchy)) : Hierarchy
|
| node (name : Name) (isFile : Bool) (children : RBNode Name (λ _ => Hierarchy)) : Hierarchy
|
||||||
|
@ -54,8 +53,6 @@ partial def insert! (h : Hierarchy) (n : Name) : Hierarchy := Id.run $ do
|
||||||
let hn := h.getName
|
let hn := h.getName
|
||||||
let mut cs := h.getChildren
|
let mut cs := h.getChildren
|
||||||
|
|
||||||
assert! getNumParts hn ≤ getNumParts n
|
|
||||||
|
|
||||||
if getNumParts hn + 1 == getNumParts n then
|
if getNumParts hn + 1 == getNumParts n then
|
||||||
match cs.find Name.cmp n with
|
match cs.find Name.cmp n with
|
||||||
| none =>
|
| none =>
|
||||||
|
|
|
@ -38,14 +38,12 @@ def moduleNameToLink (n : Name) : HtmlM String := do
|
||||||
(←getRoot) ++ (parts.intersperse "/").foldl (· ++ ·) "" ++ ".html"
|
(←getRoot) ++ (parts.intersperse "/").foldl (· ++ ·) "" ++ ".html"
|
||||||
|
|
||||||
def moduleNameToFile (basePath : FilePath) (n : Name) : FilePath :=
|
def moduleNameToFile (basePath : FilePath) (n : Name) : FilePath :=
|
||||||
|
let parts := n.components.map Name.toString
|
||||||
FilePath.withExtension (basePath / parts.foldl (· / ·) (FilePath.mk ".")) "html"
|
FilePath.withExtension (basePath / parts.foldl (· / ·) (FilePath.mk ".")) "html"
|
||||||
where
|
|
||||||
parts := n.components.map Name.toString
|
|
||||||
|
|
||||||
def moduleNameToDirectory (basePath : FilePath) (n : Name) : FilePath :=
|
def moduleNameToDirectory (basePath : FilePath) (n : Name) : FilePath :=
|
||||||
|
let parts := n.components.dropLast.map Name.toString
|
||||||
basePath / parts.foldl (· / ·) (FilePath.mk ".")
|
basePath / parts.foldl (· / ·) (FilePath.mk ".")
|
||||||
where
|
|
||||||
parts := n.components.dropLast.map Name.toString
|
|
||||||
|
|
||||||
section Static
|
section Static
|
||||||
def styleCss : String := include_str "./static/style.css"
|
def styleCss : String := include_str "./static/style.css"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
leanprover/lean4:nightly-2022-01-04
|
leanprover/lean4:nightly-2022-01-15
|
||||||
|
|
Loading…
Reference in New Issue