Skip to content

[docs] migrate to vitepress#2221

Open
Belonit wants to merge 18 commits into
developfrom
docs/migrate-to-vitepress
Open

[docs] migrate to vitepress#2221
Belonit wants to merge 18 commits into
developfrom
docs/migrate-to-vitepress

Conversation

@Belonit
Copy link
Copy Markdown
Member

@Belonit Belonit commented May 22, 2026

Summary

This PR migrates the documentation from Sphinx to VitePress and updates the docs build pipeline around the new stack.

Why VitePress:

  • provides a more modern documentation frontend with faster client-side navigation;
  • improves the built-in local search experience;
  • provides a cleaner responsive layout for desktop and mobile readers;
  • supports richer Markdown features and custom containers with less Sphinx/MyST-specific syntax.

Main changes:

  • skip the PR DLL build for documentation-only pull requests whose title starts with [Docs];
  • migrate the documentation site configuration, theme, and custom styling to VitePress;
  • add separate online and offline documentation builds;
  • generate an offline HTML zip archive instead of the previous PDF download;
  • update the Read the Docs configuration for the new build flow;
  • replace 43 animated GIF demos with WebM videos, reducing media size from 93.45 MiB to 19.56 MiB and saving 73.88 MiB / 79.1%;
  • add automatic media dimension handling for images and videos;
  • replace raw video embeds in Markdown with GitHub-friendly video links, which are converted back during the VitePress build;
  • update documentation content, custom block styling, favicon, credits, and related translations.

Notes for reviewers

Please pay extra attention to:

  • the Read the Docs build output and downloadable offline HTML zip archive;
  • navigation and anchor links in the offline documentation;
  • media rendering in both VitePress and GitHub Markdown previews.

The Chinese translation files were updated as part of the migration. I do not know Chinese, so these updates were generated with AI assistance and should be reviewed carefully by native Chinese speakers.

@Phobos-developers Phobos-developers deleted a comment from github-actions Bot May 22, 2026
@Belonit Belonit changed the title Docs/migrate to vitepress [docs] migrate to vitepress May 22, 2026
@Belonit Belonit force-pushed the docs/migrate-to-vitepress branch from b0561a0 to 237b380 Compare May 22, 2026 21:11
@Belonit
Copy link
Copy Markdown
Member Author

Belonit commented May 22, 2026

You can test the documentation online here - https://phobos--2221.org.readthedocs.build/en/2221/

Offline documentation can be built locally with:

scripts/build_docs_offline.bat

The output will be generated in:

docs/.artifacts/offline-doc/

I cannot attach the generated archive to this PR comment because GitHub limits attachments to 25 MiB, while the current archive is about 26 MiB.

@Phobos-developers Phobos-developers deleted a comment from github-actions Bot May 22, 2026
@Phobos-developers Phobos-developers deleted a comment from github-actions Bot May 22, 2026
@Belonit Belonit requested a review from DeathFishAtEase May 22, 2026 22:48
@Phobos-developers Phobos-developers deleted a comment from github-actions Bot May 23, 2026
@DeathFishAtEase
Copy link
Copy Markdown
Collaborator

I fully agree with migrating to VitePress. Based on my earlier understanding of it, this will definitely bring a great improvement to the user experience of our documentation.
I will later try a full build of the documentation for testing. The key points I have currently thought of are as follows:

  1. Support for basic Alert/Attention formatting, as well as the semantic compatibility of color schemes with our original formatting—perhaps some color schemes need adjustment.
  2. Whether the Dropdowns format originally based on sphinx_design can work as usual, and possible CSS improvement requirements.
  3. Some calculators originally implemented by us using HTML code need to ensure they still work properly after migration, and their text retains a degree of localization freedom no less than that of the old version.

Additionally, regarding CI improvements, would it be better to add a label like #2099 for all scenarios that do not require Nightly Build, such as CI improvements and similar to #2098 and #2201?

@Belonit Belonit force-pushed the docs/migrate-to-vitepress branch from 5b21810 to 504a433 Compare May 23, 2026 04:30
@DeathFishAtEase
Copy link
Copy Markdown
Collaborator

After checking the online documentation, I found that the document's path is incorrect. Even if I set the language to Chinese using the ReadTheDocs option in the bottom right corner, it still shows this directory.

image

The correct Chinese documentation directory is as follows:

image

In addition, you can see in this image that some heading texts have not been translated, even though they are exactly the same in the .po file as before (this PR did not break this part of the localization). However, there are exceptions, such as Building manually and Legal and License , which correctly use the localized text. At present, I don't know the specific reason for this issue.

image

@Belonit
Copy link
Copy Markdown
Member Author

Belonit commented May 23, 2026

After checking the online documentation, I found that the document's path is incorrect. Even if I set the language to Chinese using the ReadTheDocs option in the bottom right corner, it still shows this directory.

This is by design, language switching occurs on the VitePress side, in the top panel. If this PR is still accepted, we will need to disable language switching on the RtD side

@Belonit
Copy link
Copy Markdown
Member Author

Belonit commented May 23, 2026

In addition, you can see in this image that some heading texts have not been translated, even though they are exactly the same in the .po file as before (this PR did not break this part of the localization). However, there are exceptions, such as Building manually and Legal and License , which correctly use the localized text. At present, I don't know the specific reason for this issue.

I'll take a look at this and try to fix it

3. Some calculators originally implemented by us using HTML code need to ensure they still work properly after migration, and their text retains a degree of localization freedom no less than that of the old version.

The calculator is implemented in the component /docs/.vitepress/theme/components/CustomGameSpeedGenerator.vue.
Initially it was not translated enough, this has now been fixed

@TaranDahl
Copy link
Copy Markdown
Contributor

From my understanding, there isn't much difference in the way of writing documentation code compared with before?
Then it is fine for me, I think.

@Metadorius
Copy link
Copy Markdown
Member

  • supports richer Markdown features and custom containers with less Sphinx/MyST-specific syntax

elaborate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants