Repository navigation
Upgrade to Verso v4.36.0 / Lean v4.36.0 and migrate to html% syntax - #10
Merged
Merged
Conversation
- 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.
There was a problem hiding this comment.
🟢 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)v4.36.0tag instead of followingmain, solake updateno longer changes the version by surprise.lean-toolchain→leanprover/lean4:v4.36.0.Htmlnow 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){{ … }}syntax, so every use of it now useshtml%{ … }fromLean.Data.Html.svg(...)elaborator now parses SVG files withhtml%.Html.asString→Html.render.Verso.Outputinstead ofVerso.Output.Html. Opening the old namespace brought the deprecated{{/}}tokens into scope.3. CI (
ci: …)pull_request, so PRs get a build check. Thedeployjob runs only onmain.leanprover/lean-actionreplaces the manual elan install and caches.lake. The build uses--wfail, so new warnings fail the check.schedule, theleanprover/cslibcheckout and the commented-out docs steps. The API docs atapi.cslib.ioare deployed by thedocs.ymlworkflow inleanprover/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
--wfail+lake run generate; deploy skipped.lake buildcompletes with no errors and no warnings. Before the syntax migration there were 109 deprecation warnings.lake run generateproduces output that is byte-for-byte identical (diff -rq) to the output generated right after the upgrade, before the syntax migration.<br/>, and indentation changed;-verso-data/katex/) instead of the jsdelivr CDN;marked.jsis no longer loaded;This change was prepared with the assistance of an AI tool (Claude Code) and reviewed by the author.