Skip to content

Commit

Permalink
feat: heuristically render Markdown in docstrings
Browse files Browse the repository at this point in the history
Adds a pass to docstring rendering that tries various approaches to
get sensible highlighted Lean code, and that makes many examples look
better.
  • Loading branch information
david-christiansen committed Dec 18, 2024
1 parent 2bdd4ba commit 248962a
Show file tree
Hide file tree
Showing 11 changed files with 645 additions and 166 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ jobs:
sourcecodepro
sourcesanspro
sourceserifpro
fvextra
upquote
lineno
- name: Check `tlmgr` version
run: tlmgr --version
Expand Down
22 changes: 22 additions & 0 deletions doc/UsersGuide/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,28 @@ results in

{docstring List.forM}

## More Docstring Examples

{docstring Lean.Syntax}

{docstring List}

{docstring String}

{docstring Subtype}

{docstring OfNat}

{docstring Monad}

:::tactic "induction"
:::

:::tactic "simp"
:::

{docstring Nat}

# Index
%%%
number := false
Expand Down
2 changes: 1 addition & 1 deletion src/verso-manual/VersoManual.lean
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def page (toc : List Html.Toc) (path : Path) (textTitle : String) (htmlTitle con
(extraJsFiles := config.extraJs.toArray ++ state.extraJsFiles.map ("/-verso-js/" ++ ·.1))

def Config.relativize (config : Config) (path : Path) (html : Html) : Html :=
if let some _ := config.baseURL then
if config.baseURL.isSome then
-- Make all absolute URLS be relative to the site root, because that'll make them `base`-relative
Html.relativize #[] html
else
Expand Down
Loading

0 comments on commit 248962a

Please sign in to comment.