Skip to content

[DOC] Fix RST syntax#18732

Open
ruslo wants to merge 1 commit intoapache:mainfrom
ruslo:pr.fix_rst_syntax
Open

[DOC] Fix RST syntax#18732
ruslo wants to merge 1 commit intoapache:mainfrom
ruslo:pr.fix_rst_syntax

Conversation

@ruslo
Copy link
Contributor

@ruslo ruslo commented Feb 8, 2026

Fix RST syntax in 'export_and_load_executable.py'


The code is not correctly rendered here:

See the code-block parts:

Screenshot from 2026-02-08 11-11-23

I guess the problem is about spaces. However, I was not able to build documentation locally. I checked the instructions from https://github.com/apache/tvm/tree/9eac0e1635c83904aedd1100c9471c608d89a7ad/docs#build-locally

Both ended up in error.

$ USE_SCCACHE=0 DEBUG=1 python tests/scripts/ci.py docs --cpu

+ python3 -m pip install Sphinx==4.2.0 tlcpack-sphinx-addon==0.2.1 image==1.5.33 git+https://github.com/sphinx-gallery/sphinx-gallery.git@6142f1791151849b5bec4bf3959f75697ba226cd sphinx-rtd-theme==1.0.0 matplotlib==3.3.4 commonmark==0.9.1 Pillow==8.3.2 autodocsumm==0.2.7 docutils==0.16

ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: 'WHEEL'
Check the permissions.
$ ./docker/bash.sh ci_gpu -c 'python3 -m pip install --quiet tlcpack-sphinx-addon==0.2.1 && python3 -m pip freeze'

Error: Unknown flag: -c

Hints are welcome 🙏

Fix RST syntax in 'export_and_load_executable.py'
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ruslo, 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 addresses a rendering issue in the online documentation for the export_and_load_executable.py tutorial. By adjusting the reStructuredText syntax, specifically by adding necessary blank lines before code block directives, the PR aims to improve the readability and correct display of code examples within the tutorial, ensuring a better user experience for those following the guide.

Highlights

  • Documentation Fix: Corrected reStructuredText (RST) syntax in export_and_load_executable.py to ensure proper rendering of code blocks in the online documentation.
  • RST Code Block Formatting: Added blank lines before .. code-block:: python directives to resolve rendering issues, which is a common requirement for RST parsers to correctly interpret directives.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/how_to/tutorials/export_and_load_executable.py
    • Added blank lines before .. code-block:: python directives to fix RST rendering issues for code snippets.
Activity
  • The pull request was opened by ruslo to fix a documentation rendering issue.
  • The author provided screenshots demonstrating the incorrect rendering of code blocks on the live documentation site.
  • The author attempted to build documentation locally to verify the fix but encountered permission errors and an unknown flag error with Docker, requesting assistance from reviewers.
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.

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 PR correctly fixes the reStructuredText syntax for code-block directives in the export_and_load_executable.py tutorial by adding the required blank lines. This change should resolve the rendering issue on the documentation website.

Regarding the build issues you mentioned in the description, here are a couple of hints:

  1. The OSError: [Errno 13] Permission denied error typically occurs when pip tries to install packages into a system-protected directory. Using a Python virtual environment should resolve this. You can create one using python3 -m venv venv and activate it with source venv/bin/activate before running the build script.

  2. For the docker/bash.sh error, Unknown flag: -c, it's likely that the script passes arguments directly to the container's entrypoint. You might not need the -c flag. Try wrapping your command in quotes like this: ./docker/bash.sh ci_gpu 'python3 -m pip install --quiet tlcpack-sphinx-addon==0.2.1 && python3 -m pip freeze'.

The code changes look good. Thank you for the contribution!

@tlopex
Copy link
Member

tlopex commented Feb 8, 2026

Hi @ruslo Thanks for looking into this.
On my side, the page seems to be rendered correctly (the code blocks appear properly formatted and .. code-block:: is not shown as plain text). I also checked the current online docs and they look fine as well though.

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