This is an archive of the discontinued LLVM Phabricator instance.

[clang][docs] Use `option` directive in User's Manual
ClosedPublic

Authored by kawashima-fj on Nov 15 2022, 8:50 PM.

Details

Summary

Sphinx has the option directive. Most option descriptions in clang/docs/UsersManual.rst used it but some didn't. This commit changes the remaining option descriptions to use the option directive. This makes a consistent view in HTML.

The option directive automatically creates a cross-reference target. So labeling by .. _opt_XXX: is almost unnecessary. However, options with and without no- (e.g. -fno-show-column/-fshow-column) cannot be distinguish for the cross-reference. So some required .. _opt_XXX: directives are kept unremoved.

Diff Detail

Event Timeline

kawashima-fj created this revision.Nov 15 2022, 8:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2022, 8:50 PM
kawashima-fj requested review of this revision.Nov 15 2022, 8:50 PM

Thank you for this cleanup! In general, I thin this looks correct. However, I know we've had to fix a bunch of options that cause the sphinx build to fail (IIRC, oftentimes due to duplicate options) and our precommit CI doesn't test the documentation build. Did you try building the docs locally to ensure there are no new warnings/errors from Sphinx?

Thank you for this cleanup! In general, I thin this looks correct. However, I know we've had to fix a bunch of options that cause the sphinx build to fail (IIRC, oftentimes due to duplicate options) and our precommit CI doesn't test the documentation build. Did you try building the docs locally to ensure there are no new warnings/errors from Sphinx?

Yes. I confirmed no new warnings/errors with the following commands. I used Sphinx packaged by distributions (Ubuntu 22.04 and Debian GNU/Linux 11). Is it sufficient? If no, let me know.

cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=clang -DLLVM_ENABLE_SPHINX=ON -DLLVM_INCLUDE_DOCS=ON [other unrelated options ...]
ninja docs-clang-html
aaron.ballman accepted this revision.Nov 21 2022, 5:00 AM

Thank you for this cleanup! In general, I thin this looks correct. However, I know we've had to fix a bunch of options that cause the sphinx build to fail (IIRC, oftentimes due to duplicate options) and our precommit CI doesn't test the documentation build. Did you try building the docs locally to ensure there are no new warnings/errors from Sphinx?

Yes. I confirmed no new warnings/errors with the following commands. I used Sphinx packaged by distributions (Ubuntu 22.04 and Debian GNU/Linux 11). Is it sufficient? If no, let me know.

cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=clang -DLLVM_ENABLE_SPHINX=ON -DLLVM_INCLUDE_DOCS=ON [other unrelated options ...]
ninja docs-clang-html

Excellent, thank you! This LGTM!

This revision is now accepted and ready to land.Nov 21 2022, 5:00 AM