Skip to content

Commit

Permalink
feat: autolink references to files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben-VandeVelde authored and hargoniX committed Sep 16, 2023
1 parent f9b5a29 commit 19568c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion DocGen4/Output/DocString.lean
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ partial def xmlGetHeadingId (el : Xml.Element) : String :=
-/
def nameToLink? (s : String) : HtmlM (Option String) := do
let res ← getResult
if let some name := Lean.Syntax.decodeNameLit ("`" ++ s) then
if s.endsWith ".lean" && s.contains '/' then
return (← getRoot) ++ s.dropRight 5 ++ ".html"
else if let some name := Lean.Syntax.decodeNameLit ("`" ++ s) then
-- with exactly the same name
if res.name2ModIdx.contains name then
declNameToLink name
Expand Down

0 comments on commit 19568c0

Please sign in to comment.