fix(doc): Always download images to doc site#194
fix(doc): Always download images to doc site#194junrushao wants to merge 1 commit intoapache:mainfrom
Conversation
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
|
@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 |
|
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 |
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.