-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Remove empty code blocks #13689
Conversation
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
d3a927d
to
bd890bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - the empty code blocks thing has bugged me for a while.
For what it's worth, I've never been a fan of how we need to add the following to every tutorial: # sphinx_gallery_start_ignore
from tvm import testing
testing.utils.install_request_hook(depth=3)
# sphinx_gallery_end_ignore Instead, we could use from tvm import testing
def add_hook(gallery_conf, fname):
testing.utils.install_request_hook(depth=3)
sphinx_gallery_conf = {
...
'reset_modules': (add_hook),
} If we needed the hook for |
bd890bf
to
41f2f40
Compare
41f2f40
to
7bcd019
Compare
@guberti that makes a lot more sense, I updated the PR to use that and delete the linter which wasn't really correct anyways (some of the preamble was misplaced in a few files). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good change, but there's one nuance to highlight - per-file config options like sphinx_gallery_requires_cuda
. If we take them out of the ignore block, the flag renders in HTML, which we do not want:
I can see two ways to fix this behavior. The easier, uglier way is to continue wrapping all flags in ignore blocks:
# sphinx_gallery_start_ignore
# sphinx_gallery_requires_cuda = True
# sphinx_gallery_end_ignore
This is what's done right now, and changing this may be out of scope for this pull request.
A better alternative would be updating sphinx-gallery
to version 4484d35 or beyond, and then setting remove_config_comments=True
in the config file. Unfortunately, 4484d35 is not part of any PyPI releases right now, making this a little more annoying.
What do you think @driazati?
I updated the PR to wrap the configs with ignores and made sure they are inside a code block so they don't show up on their own, so now this PR should make everything look fine from the frontend. We could merge this then update the sphinx gallery version (installing from the latest commit isn't a problem with Docker) and remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good - we'll merge this, and can consider updating sphinx-gallery
later. LGTM!
This removes the linter that checks that each sphinx gallery tutorial begins with the proper boilerplate by extracting it out to sphinx gallery reset functions. This runs automatically so no code in the tutorials nor associated linters are necessary.
This removes the linter that checks that each sphinx gallery tutorial begins with the proper boilerplate by extracting it out to sphinx gallery reset functions. This runs automatically so no code in the tutorials nor associated linters are necessary.