Skip to content

Conversation

@junrushao
Copy link
Member

This PR explicitly asks Sphinx's builtin image downloader to fetch the external images to local .doctrees/images/, as another attempt after #193 to fix the image not rendering issue: https://tvm.apache.org/ffi/get_started/stable_c_abi.html#fig-layout-any.

#193 didn't fix the problem and ChatGPT suggests that it's due to tvm.apache.org's Content Security Policy (CSP) that disallows embedding external resources.

It is tested locally that the Sphinx does fetch the images desired. Hopefully this time this issue can be fixed.

@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 introduces a configuration change to the Sphinx documentation build process to ensure that all external images are downloaded and served locally. This is a targeted effort to resolve an ongoing problem where images fail to display on the live documentation site, which previous attempts (like #193) did not fully address. By disabling remote image support for HTML builders, Sphinx's built-in image downloader is activated, aiming to provide a robust solution for image rendering.

Highlights

  • Image Rendering Fix: Implemented a mechanism to explicitly tell Sphinx to download external images to the local .doctrees/images/ directory, addressing a persistent issue where images were not rendering on the documentation site, potentially due to Content Security Policy (CSP) restrictions.
  • Sphinx Configuration Update: A new function, _force_local_images, has been added to docs/conf.py and connected to the builder-inited event. This function disables remote image support for HTML-family builders, activating Sphinx's built-in image downloader.
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 pull request introduces a fix for rendering external images in the documentation by forcing Sphinx to download them locally. The change is implemented by connecting a new function, _force_local_images, to the builder-inited event in docs/conf.py. This function disables remote image support for HTML builders, which correctly triggers Sphinx's built-in image downloader. The overall approach is sound. My review includes a suggestion to improve the detection of HTML builders, making it more robust and maintainable for the future.

@junrushao
Copy link
Member Author

@Hzfengsy if you have time, could you also comment on this issue? I’m asking because you probably have experienced similar issues before in apache/tvm#17611

@tqchen
Copy link
Member

tqchen commented Oct 27, 2025

this is likely not something that needs to be fixed here, instead it should be fixed in https://github.com/apache/tvm-site/blob/main/scripts/download_3rdparty_embeds.py

@tqchen tqchen closed this Oct 27, 2025
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