This is an archive of the discontinued LLVM Phabricator instance.

Add support to generate Sphinx DOCX documentation
AbandonedPublic

Authored by ldionne on Jul 19 2021, 8:13 PM.

Details

Reviewers
scott.linder
bollu
sscalpone
jdoerfert
MaskRay
t-tye
Group Reviewers
Restricted Project
Restricted Project
Summary

Add support for Sphinx docx builder. Requires Sphinx docx builder to be
installed using pip install docxbuilder.

Added SPHINX_OUTPUT_DOCX CMake variable to control generation of docx
documentation. Defaults to OFF.

Added <project>_INSTALL_SPHINX_DOCX_DIR CMake variable to control where docx
files are installed. Defaults to share/doc/<project>/<project>.docx.

Documented new CMake variables in llvm/docs/CMake.rst.

Updated description of building documentation is lld/docs/sphinx_intro.rst,
lldb/docs/resources/build.rst, llvm/docs/README.txt, and
openmp/docs/README.txt,

Update clang/docs/CMakeLists.txt for Sphinx man and docx builders to ensure
.td generated .rst files are available to prevent warnings of missing rst files.
Minor CMake cleanups.

Added docx as an additional target for the documentation make.bat scripts.

Added docx as an additional target rule in the Makefile.sphinx files.

Diff Detail

Event Timeline

t-tye created this revision.Jul 19 2021, 8:13 PM
Herald added a reviewer: MaskRay. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
t-tye requested review of this revision.Jul 19 2021, 8:13 PM
Herald added projects: Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.Jul 20 2021, 6:54 AM
ldionne added a subscriber: ldionne.

What's the benefit of having docx documentation? We generate HTML documentation, which ends up in the website, and that seems strictly superior to generating docx. What do you need it for?

The libc++ changes are almost trivial so I would not object to the change on that basis, however in general I think it's better to avoid adding support for things we won't be using on a regular basis.

This revision now requires changes to proceed.Jul 20 2021, 6:54 AM
t-tye updated this revision to Diff 361402.Jul 23 2021, 6:54 PM

Split change for clang makefile to elimnate Sphinx warnings of missing .rst fies when building man pages into D106734.

t-tye updated this revision to Diff 361407.Jul 23 2021, 7:50 PM

Factor out documentation and CMake file changes unrelated to adding DOCX support to D106736.

t-tye added a comment.Jul 23 2021, 8:14 PM

What's the benefit of having docx documentation? We generate HTML documentation, which ends up in the website, and that seems strictly superior to generating docx. What do you need it for?

The libc++ changes are almost trivial so I would not object to the change on that basis, however in general I think it's better to avoid adding support for things we won't be using on a regular basis.

We do have a project that requires docx documentation that includes parts of the LLVM documentation, so being able to generate it from the build is helpful. However, if adding docx support is not useful to anyone else then the changes can be kept out of tree.

A few observations are that the makefile.bat and Makefile.sphinx files already appear to support many of the build targets supported by Sphinx, so adding docx did not seem out of place. Building docx as part of the LLVM build is disabled by default so has no impact unless explicitly enabled. The changes to support it appeared fairly minor.

The changes not directly related to adding docx support have been split out to D106338, D106734 and D106736 which may be worth considering independent of whether this review is useful.

I remember that we even converted some *.md to *.rst to remove the number of supported documentation formats, so I agree that adding support the even less used *.docx may not be the proper direction.

Thanks for splitting this off.

If there is no plan to move forward with generating .docx documentation, can we please abandon this review? I'm trying to clean up libc++'s review queue.

Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2021, 1:45 PM
ldionne removed projects: Restricted Project, Restricted Project.EditedNov 25 2021, 11:08 AM
ldionne removed reviewers: Restricted Project, Restricted Project, ldionne.

Removing from the runtimes review queue -- please ping me directly if you need my attention on this.

_edit_: It looks like Herald won't let me do that.

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 25 2021, 11:08 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
MaskRay requested changes to this revision.Nov 26 2021, 1:46 PM
This revision now requires changes to proceed.Nov 26 2021, 1:46 PM
ldionne commandeered this revision.Aug 31 2023, 8:47 AM
ldionne added a reviewer: t-tye.

[GitHub PR transition cleanup]

This has been open for 2 years with multiple subscribers able to see this discussion, but there doesn't seem to be a lot of interest for moving forward with this. I will commandeer and abandon to clear the review queue in the context of moving to Github PRs. If you'd still like to push for this to happen, feel free to re-open this as a Github PR.

Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2023, 8:47 AM
Herald added a subscriber: jplehr. · View Herald Transcript
ldionne abandoned this revision.Aug 31 2023, 8:47 AM