Skip to content

Conversation

@junrushao
Copy link
Member

@junrushao junrushao commented Dec 13, 2025

This PR adds a version switcher on tvm-ffi doc site, so that one could look up docs based on different version tags.

The multi-version site can be built with the simple instruction below:

BUILD_CPP_DOCS=1 BUILD_RUST_DOCS=1 \
  uv run --group docs \
        python docs/run_sphinx_multiversion.py \
                --base-url "/ffi"

Demo in thread: #343 (comment)

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @junrushao, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the tvm-ffi documentation by introducing a robust version switching mechanism. By leveraging sphinx-multiversion and custom scripting, the documentation site can now host and display multiple versions of the documentation, including the main branch and specific release tags. This change improves the user experience by making it easier to access and compare documentation across different project versions.

Highlights

  • Version Switcher Integration: Implemented a version switcher on the tvm-ffi documentation site using sphinx-multiversion to allow users to browse documentation for different versions (main branch and tagged releases).
  • Multi-version Build Script: Introduced docs/build_multiversion.sh to automate the process of building multi-version documentation, including setting environment variables and generating necessary metadata.
  • Dynamic Version JSON Generation: Added docs/tools/write_versions_json.py to parse sphinx-multiversion's metadata and create the _static/versions.json file, which powers the version switcher in the sphinx-book-theme.
  • Configuration Updates: Modified docs/conf.py to integrate sphinx-multiversion, dynamically determine the documentation version, and configure the sphinx-book-theme to display the version switcher with appropriate settings.
  • Dependency Addition: sphinx-multiversion has been added as a documentation dependency in pyproject.toml.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@junrushao
Copy link
Member Author

junrushao commented Dec 13, 2025

Demo:

image

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a version switcher for the documentation site, which is a valuable addition for users. The implementation leverages sphinx-multiversion and includes a new build script and a Python helper to generate the version metadata. The overall approach is solid. I've identified a few areas for improvement in the new Python script, primarily concerning more specific exception handling and correcting a type hint, to enhance code robustness and maintainability.

@junrushao junrushao force-pushed the 2025-12-12/multi-ver branch 2 times, most recently from e544e39 to 4920279 Compare December 13, 2025 07:42
@junrushao
Copy link
Member Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a version switcher for the documentation site, enabling users to navigate between different versions of the documentation (specifically main and version tags). The implementation leverages sphinx-multiversion and includes a new build script and a Python helper to generate the necessary version metadata. The changes are well-implemented and significantly improve the documentation's usability. I've added a few suggestions to enhance the robustness of the build process and the new scripts by using more specific exception handling and improving the documentation for the build command.

@junrushao junrushao force-pushed the 2025-12-12/multi-ver branch from 4920279 to c704041 Compare December 13, 2025 20:12
@junrushao junrushao marked this pull request as draft December 13, 2025 20:35
@junrushao junrushao force-pushed the 2025-12-12/multi-ver branch from c704041 to f217b4e Compare December 13, 2025 21:28
@junrushao junrushao marked this pull request as ready for review December 13, 2025 21:35
@junrushao junrushao force-pushed the 2025-12-12/multi-ver branch from f217b4e to 6ff5450 Compare December 14, 2025 04:19
@junrushao junrushao marked this pull request as draft December 14, 2025 06: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.

1 participant