Skip to content

Render docs with DocumenterVitePress#445

Merged
lkdvos merged 11 commits into
mainfrom
ld-docs
Jul 3, 2026
Merged

Render docs with DocumenterVitePress#445
lkdvos merged 11 commits into
mainfrom
ld-docs

Conversation

@lkdvos

@lkdvos lkdvos commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

Switches the documentation rendering pipeline from the default Documenter.HTML backend to DocumenterVitePress.jl, giving the docs a modernized look: a hero landing page, cleaner navigation, built-in dark mode, and local search.

Changes

  • Backend swapmake.jl now uses DocumenterVitepress.MarkdownVitepress and DocumenterVitepress.deploydocs; the MathJax3 block is dropped (VitePress's bundled MathJax already loads the braket package, covering the only macros used, \ket/\bra).
  • Deps — added DocumenterVitepress to docs/Project.toml and bumped Documenter compat to 1.11. DocumenterCitations (bibliography) and DocumenterInterLinks continue to work unchanged.
  • Theme/branding — generated the .vitepress config/theme/components and package.json; ported the .color-invertible diagram dark-mode inversion and a green logo accent into the theme stylesheet; removed the obsolete assets/custom.css.
  • Hero pageindex.md is now a VitePress hero landing page with a feature grid.
  • Favicon — added docs/src/assets/favicon.ico rendered from the logo.
  • Image path fixes — corrected <img> relative paths (./file, ../assets/...) for VitePress's build-time asset resolution; the old paths assumed Documenter's prettyurls directory depth. Also fixed the Literate source examples/quantum1d/1.ising-cft/main.jl so the fix survives regeneration.

Scope

Backend cutover only. The diff is config/build/theme plus the content edits the backend requires (the hero landing page and the <img> path fixes). The planned four-section Diátaxis restructure is intentionally not part of this PR — pages/nav still mirror the existing manual.

CI

No workflow change needed — DocumenterVitePress bundles Node via NodeJS_20_jll, and the previews/PR<n> deploy path is unchanged, so the existing Documentation, PR_comment, and DocumentationCleanup workflows keep working.

Verification

A clean local julia --project=docs docs/make.jl builds end-to-end: Documenter doctests + example execution + @autodocs pass, then the VitePress build completes (~11s). Verified in the rendered output: hero page, logo, dark-mode-invertible diagrams, and bundled example images all render correctly.

Re-verified locally on 2026-06-30: make.jl builds end-to-end (doctests pass via the preserved setdocmeta!, VitePress build complete in 11.89s), producing docs/build/ with 22 rendered HTML pages (index.html titled "MPSKit.jl", plus man/, lib/, examples/, changelog, references). No errors; the only warnings are pre-existing DocumenterCitations "could not link DOI" notes on a few bibliography entries.

Deploy readiness (checked against the live repo)

Most deploy infrastructure is already in place from the prior Documenter HTML deploys:

  • DOCUMENTER_KEY secret + deploy key — already configured (secret since 2020; the documenter deploy key has write access). The Documentation.yml build job already passes GITHUB_TOKEN + DOCUMENTER_KEY. No action.
  • Pages source — already Deploy from a branch → gh-pages / (root) (build_type: legacy). No action.
  • gh-pages legacy symlinksstable and the vX.Y aliases (v0.1v0.13) are symlinks from the old Documenter layout. DocumenterVitepress cannot overwrite symlinked folders, so a future tagged-release deploy that updates stable/vX.Y may fail. Clean these up on gh-pages before the first tagged deploy. The dev deploy from this branch writes to the real dev/ directory and is unaffected.

Left as a draft pending review; do not merge until the physics/content owners have looked it over.

🤖 Generated with Claude Code

@lkdvos lkdvos added the documentation Improvements or additions to documentation label Jun 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

After the build completes, the updated documentation will be available here

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/algorithms/changebonds/randexpand.jl 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/algorithms/changebonds/svdcut.jl 89.18% <100.00%> (ø)
src/algorithms/changebonds/vumpssvd.jl 100.00% <ø> (ø)
src/algorithms/excitation/chepigaansatz.jl 91.48% <ø> (ø)
src/algorithms/changebonds/randexpand.jl 64.38% <0.00%> (ø)

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@borisdevos

Copy link
Copy Markdown
Member

This looks amazing! I certainly didn't go in detail through the preview, but something I already noticed is that the links to the examples inherit the reference label instead of the title if provided.

@leburgel

leburgel commented Jul 1, 2026

Copy link
Copy Markdown
Member

I think the new look is okay, but I don't feel it's that much of an improvement compared to the default Documenter style. I much prefer the navigation and search tools of this update though, very smooth.

However, I'm not really a fan of adding this much HTML/CSS to the repo. I know this wasn't manually generated, but there's still a lot of properties being manually specified, and I have no idea how any of this works. Do we really need to add this much CSS, or is there a more standard template that we can reuse that would lead to less CSS in the repo itself while still being reliable?

@lkdvos

lkdvos commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

Fair point, let me investigate that a bit more. I think quite a lot of it is just that I asked for a custom theme that goes along with the MPSKit colors, so probably it's just a matter of getting rid of the theme and using a bit more defaults. That being said, I do really like the landing page a lot more, so this is probably the only thing I will try to keep, either through some template or just by manually keeping this in. In general this is stuff that doesn't really need to be touched so I think a little of it is fine, but I do agree that it is better not to overengineer this for maintainability purposes

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Your PR no longer requires formatting changes. Thank you for your contribution!

@lkdvos lkdvos force-pushed the ld-docs branch 2 times, most recently from a522f00 to 67448f7 Compare July 1, 2026 17:55
@lkdvos

lkdvos commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

I think I managed to remove a bunch of the css, and did some other improvements on the entire system - for example improving load times by not inlining the images. I think it looks a lot better now, and would be happy to merge as-is.
I have a number of follow-up PRs for actually improving the content, this is mostly about getting the architecture right first.

@lkdvos lkdvos requested a review from leburgel July 1, 2026 18:44
lkdvos and others added 7 commits July 2, 2026 08:34
Switch the documentation backend from `Documenter.HTML` to
`DocumenterVitepress.MarkdownVitepress` for a modernized look: a hero
landing page, cleaner navigation, built-in dark mode and local search.

- Add `DocumenterVitepress` to the docs project and bump `Documenter` to 1.11.
- Swap `format`/`deploydocs` to the VitePress equivalents in `make.jl` and
  drop the MathJax3 block (the bundled MathJax already loads the `braket`
  package, covering the `\ket`/`\bra` macros used).
- Generate the `.vitepress` config/theme/components and `package.json`.
- Convert `index.md` into a VitePress hero landing page with a feature grid.
- Port the `.color-invertible` image dark-mode inversion and a green logo
  accent into the theme stylesheet; remove the obsolete `assets/custom.css`.
- Fix `<img>` relative paths for VitePress's build-time resolution
  (`./file`, `../assets/...`); the old paths assumed Documenter's prettyurls
  directory depth.
- Add a favicon rendered from the logo.

Node is bundled via `NodeJS_20_jll`, so no CI workflow change is needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The VitePress hero frontmatter was written as a bare `---...---` block at
the top of `index.md`, which Documenter consumed as its own page metadata
instead of forwarding to VitePress. As a result `layout: home` never took
effect and the hero fields rendered as plain body text with no VPHero.

Wrap the frontmatter in a ```@raw html``` block (the DocumenterVitePress
idiom) so Documenter emits it verbatim to the top of the output markdown,
where VitePress parses it as real frontmatter. Also add emoji icons to the
feature cards.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The `@contents` block rendered manual-page headings of the form
`# [Title](@id anchor)` as the bare anchor id (`um_states`, `um_operators`,
…) under DocumenterVitepress instead of the title text. Replace it with an
explicit `@ref` link list so the ToC shows real section titles, and drop the
dead `man/conventions.md` entry (no such file exists).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The @contents blocks in examples/index.md rendered example-page headings of
the form `# [Title](@id anchor)` as the bare anchor id (demo_haldane,
hubbard, …) under DocumenterVitepress. These anchors were unreferenced
anywhere, so drop the `[…](@id …)` wrapper and use plain `# Title` headings,
which @contents renders correctly while keeping the readdir-based
auto-discovery of examples. Fixed in both the generated index.md and the
Literate main.jl sources so it survives regeneration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Plots.jl figures were baked into the generated example index.md as base64
inside `@raw html`/`<img data:image/png;base64,…>` blocks, bloating the
committed pages (xy-finiteT 323 KB, bose-hubbard 204 KB, …; ~1.2 MB total).

Add a centralized `externalize_figures` (examples/figure_externalization.jl):
it decodes those base64 blocks to external `figure-N.png` files next to the
page and rewrites them to standard markdown `![](figure-N.png)`, keying only
on `data:…;base64,` so file-referenced SVG diagrams are left untouched. Wire
it as the Literate `postprocess` in examples/make.jl so future regenerations
stay externalized, and apply it once to the already-committed pages (decoding
the existing figures verbatim — no example re-execution).

27 figures externalized across 8 pages; VitePress bundles them via /assets.
Full docs build stays green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The DocumenterVitepress cutover vendored 10 files under docs/src/.vitepress
and docs/src/components; 9 were byte-identical to the DVP template, which the
backend re-supplies into the build automatically when they are absent.

Delete those 9 boilerplate files and move the only genuine customizations
(MPSKit-green light-mode branding and the .color-invertible dark-mode diagram
inversion) into a small theme/custom.css imported from theme/index.ts. The
rendered site is unchanged; the repo now carries ~2 small files instead of ~10.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
DocumenterInterLinks only expands @extref when it is the destination of an
inline markdown link, `[text](@extref target)`. Four docstrings used
reference-style `[text][@extref ...]` or a mismatched `(@extref ...]`, so they
rendered as literal text instead of external links.

Fix the truncation links in RandExpand, SvdCut and VUMPSSvdCut, and the Arnoldi
link in ChepigaAnsatz.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lkdvos lkdvos marked this pull request as ready for review July 2, 2026 12:35
@lkdvos

lkdvos commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

I'm rerunning the examples, and will then push this

@lkdvos lkdvos mentioned this pull request Jul 2, 2026
@lkdvos lkdvos merged commit 1fd50cd into main Jul 3, 2026
29 of 30 checks passed
@lkdvos lkdvos deleted the ld-docs branch July 3, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants