Skip to content

Upgrade to Verso v4.36.0 / Lean v4.36.0 and migrate to html% syntax - #10

Merged
arademaker merged 4 commits into
mainfrom
chore/verso-v4.36.0
Nov 17, 2026
Merged

arademaker merged 4 commits into
mainfrom
chore/verso-v4.36.0

Conversation

@arademaker

@arademaker arademaker commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Upgrades the site to Verso v4.36.0 and Lean v4.36.0, and moves the templates to the new HTML syntax so the build has no warnings.

1. Upgrade (chore: upgrade to Verso v4.36.0 and Lean v4.36.0)

  • Pin Verso to the v4.36.0 tag instead of following main, so lake update no longer changes the version by surprise.
  • lean-toolchain → leanprover/lean4:v4.36.0.
  • Transitive dependencies (Cli, illuminate, plausible, subverso, MD4Lean) use the revisions from Verso v4.36.0's own manifest.
  • Html now lives in Lean core (Lean.Html), so the constructors were renamed: .tag → .element, .text true → .text, .text false → .raw.

2. Migrating the HTML syntax (refactor: migrate HTML templates to Lean core html% syntax)

  • Verso deprecated its {{ … }} syntax, so every use of it now uses html%{ … } from Lean.Data.Html.
  • The svg(...) elaborator now parses SVG files with html%.
  • Html.asString → Html.render.
  • Files now open Verso.Output instead of Verso.Output.Html. Opening the old namespace brought the deprecated {{/}} tokens into scope.

3. CI (ci: …)

  • The workflow now runs on pull_request, so PRs get a build check. The deploy job runs only on main.
  • leanprover/lean-action replaces the manual elan install and caches .lake. The build uses --wfail, so new warnings fail the check.
  • Removed the 12-hour schedule, the leanprover/cslib checkout and the commented-out docs steps. The API docs at api.cslib.io are deployed by the docs.yml workflow in leanprover/cslib (api.cslib.io → leanprover.github.io), so this repository plays no part in them. The workflow was renamed to "Build and deploy website".

How this was checked

  • The PR's CI check passes: build with --wfail + lake run generate; deploy skipped.
  • lake build completes with no errors and no warnings. Before the syntax migration there were 109 deprecation warnings.
  • lake run generate produces output that is byte-for-byte identical (diff -rq) to the output generated right after the upgrade, before the syntax migration.
  • The upgrade itself changes the HTML produced by Verso, but the page content (text, tags, attributes) is the same as before. The differences:
    • void tags are now written as <br/>, and indentation changed;
    • KaTeX is now served from the site itself (-verso-data/katex/) instead of the jsdelivr CDN;
    • marked.js is no longer loaded;
    • Verso's built-in CSS/JS was updated.

This change was prepared with the assistance of an AI tool (Claude Code) and reviewed by the author.

- Pin Verso to the v4.36.0 tag instead of tracking main
- Bump lean-toolchain to leanprover/lean4:v4.36.0
- Update transitive dependencies to the revisions used by Verso v4.36.0
- Port to Lean.Html (now in Lean core): `.tag` -> `.element`,
  `.text true` -> `.text`, `.text false` -> `.raw`, and handle `.raw`
  in pattern matches
- Reuse Verso's `Html.setAttribute` in Components.Basic

This change was prepared with the assistance of an AI tool (Claude
Code) and reviewed by the author.
Verso v4.36.0 deprecates its `{{ … }}` HTML syntax in favor of the
`html%{ … }` literal from Lean.Data.Html. This removes all deprecation
warnings from the build.

- Convert all `{{ … }}` literals to `html%{ … }`: text is now written
  literally, interpolations use `{term}`, attribute lists use `{... attrs}`
- Turn Lean comments inside HTML into HTML comments
- Port the `svg(...)` elaborator to parse SVG files with `html%`
- Replace deprecated `Html.asString` with `Html.render`
- Open `Verso.Output` instead of `Verso.Output.Html`, so the deprecated
  `{{`/`}}` tokens are no longer in scope

The generated site is byte-for-byte identical to the output before
this change.

This change was prepared with the assistance of an AI tool (Claude
Code) and reviewed by the author.
Copilot AI balanced review requested due to automatic review settings November 17, 2026 18:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the Lean/Verso upgrade and HTML API migration.

No open issues 🎉

What changed in this PR

Upgrades the CSLib website to Lean and Verso v4.36.0 and migrates its custom templates and components to Lean core’s HTML API, replacing deprecated Verso syntax.

Changes:

  • Pins Verso to a release tag and updates the Lean toolchain and dependency revisions.
  • Converts HTML templates to html%{ … } and removes deprecated namespace openings.
  • Updates HTML constructors, SVG parsing, rendering, and attribute handling to the new API.
File Description
lean-toolchain Selects Lean v4.36.0.
Lang/​Theme/​NavBar.lean Removes the deprecated HTML namespace opening.
Lang/​Theme/​Links.lean Removes the deprecated HTML namespace opening.
Lang/​Theme/​Head.lean Migrates metadata and page-head templates.
Lang/​Theme/​Blog.lean Updates HTML traversal and blog templates.
Lang/​Theme.lean Migrates shared page-layout templates.
Lang/​Pages/​Roadmap.lean Removes the deprecated HTML namespace opening.
Lang/​Pages/​Publications.lean Migrates publication markup and video embedding.
Lang/​Pages/​Initiative/​Team.lean Removes the deprecated HTML namespace opening.
Lang/​Pages/​Initiative/​Contact.lean Removes the deprecated HTML namespace opening.
Lang/​Pages/​Initiative.lean Removes the deprecated HTML namespace opening.
Lang/​Pages/​Home/​Sponsors.lean Migrates the sponsors section template.
Lang/​Pages/​Home/​Hero.lean Migrates hero markup and template comments.
Lang/​Pages/​Home.lean Removes the deprecated HTML namespace opening.
Lang/​Pages/​Governance.lean Removes the deprecated HTML namespace opening.
Lang/​Pages/​FORM.lean Migrates the FORM website-link template.
Lang/​Pages/​Contributing.lean Removes the deprecated HTML namespace opening.
Lang/​Pages/​404.lean Migrates the not-found page template.
Lang/​Meta/​Svg.lean Parses SVG content through html%.
Lang/​Features.lean Migrates custom documentation markup and constructors.
Lang/​Components/​ZulipInfo.lean Migrates the Zulip banner template.
Lang/​Components/​Title.lean Migrates heading templates and constructors.
Lang/​Components/​TeamData.lean Migrates the team-list wrapper.
Lang/​Components/​Team.lean Migrates team-member cards.
Lang/​Components/​Tabs.lean Migrates tab controls and panels.
Lang/​Components/​Sponsor.lean Migrates sponsor images and links.
Lang/​Components/​NoJSBar.lean Migrates the JavaScript-disabled notice.
Lang/​Components/​NavBar.lean Migrates navigation templates and comments.
Lang/​Components/​Modal.lean Migrates modal markup and entity syntax.
Lang/​Components/​LearnCard.lean Migrates learning cards and card grids.
Lang/​Components/​Icon.lean Migrates icon templates and uses Html.render.
Lang/​Components/​Grid.lean Migrates the SVG background wrapper.
Lang/​Components/​Gallery.lean Migrates gallery and gallery-item templates.
Lang/​Components/​Footer.lean Migrates footer markup and template comments.
Lang/​Components/​Feature.lean Migrates feature-card markup.
Lang/​Components/​Container.lean Removes the deprecated HTML namespace opening.
Lang/​Components/​CodeBlock.lean Migrates code-gallery templates.
Lang/​Components/​Citation.lean Migrates citation markup.
Lang/​Components/​Basic.lean Delegates attribute updates to the core HTML API.
Lang/​Components/​Aside.lean Migrates the sidebar template.
Lang/​Components/​ArchiveEntry.lean Updates HTML extraction and archive-entry markup.
lakefile.lean Pins Verso to the v4.36.0 tag.
lake-manifest.json Updates Verso and transitive dependency revisions.

Review effort: Balanced

- Run the workflow on pull_request so PRs get a build check
- Replace the manual elan install with leanprover/lean-action, which
  installs the toolchain from lean-toolchain and caches .lake
- Build with --wfail so new warnings fail the check
- Skip the deploy job entirely outside main

This change was prepared with the assistance of an AI tool (Claude
Code) and reviewed by the author.
The API docs at api.cslib.io are built and deployed by the docs
workflow in leanprover/cslib, so this repository does not need to
check out cslib or rebuild the site every 12 hours. Rename the
workflow to reflect what it does.

This change was prepared with the assistance of an AI tool (Claude
Code) and reviewed by the author.
@arademaker
arademaker merged commit 5906a4f into main Nov 17, 2026
2 checks passed
@arademaker
arademaker deleted the chore/verso-v4.36.0 branch November 17, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants