This is an archive of the discontinued LLVM Phabricator instance.

Sphinx-based clang man pages
ClosedPublic

Authored by axw on Jun 18 2015, 10:01 PM.

Details

Summary

This diff introduces .rst files, Sphinx config, and a CMake target
for building clang man pages. This will deprecate the existing .pod-
based man page, and will integrate nicely with CMake. This diff does
not remove the existing man page; that will be done in a follow-up
once packagers have had a chance to react to the change.

For now, only clang(1) has been done; others can be added over time
by dropping additional files into the docs/CommandGuide directory.
The index page for CommandGuide has been copied from LLVM's
docs/CommandGuide.

The man page itself is mostly the same, with a few minor cosmetic
changes. The only major change is the SYNOPSIS section. I was unable
to get .rst/Sphinx produce the same style as in the existing man page.
Instead, I changed it to match the LLVM tools' relatively simple style.

To build the man pages, use the "docs-clang-man" target if building
with CMake. Otherwise, use "make -f Makefile.sphinx man".

Diff Detail

Event Timeline

axw updated this revision to Diff 28005.Jun 18 2015, 10:01 PM
axw retitled this revision from to Sphinx-based clang man pages.
axw updated this object.
axw edited the test plan for this revision. (Show Details)
axw added reviewers: silvas, cmatthews.
axw added a subscriber: Unknown Object (MLST).
beanz added a subscriber: beanz.Jun 19 2015, 1:39 PM

These patches only modify the CMake build system, not the autoconf build system. Was that intentional? If so, you're only deprecating the pod-based manpage generation for CMake, which means it will still need to be kept in-sync and up-to-date for autoconf generation.

silvas edited edge metadata.Jun 19 2015, 4:59 PM

This is looking good. What is the ETA for getting packagers to update? It would be nice if you could chase down a couple and alert them to this change. Otherwise I fear that we will be keeping the pod file forever.

docs/conf.py
215–249

Probably mention in a comment that this chunk of autodiscovery code is derived from llvm's.

axw added a comment.Jun 19 2015, 11:43 PM

These patches only modify the CMake build system, not the autoconf build system. Was that intentional? If so, you're only deprecating the pod-based manpage generation for CMake, which means it will still need to be kept in-sync and up-to-date for autoconf generation.

I'm not really sure what the policies, if any, are around breaking packaging. My intention is to set a date to remove the files:

clang/docs/clang.pod
clang/docs/tools/Makefile
clang/docs/tools/manpage.css

Since there'll be a branch for 3.7 soon, that could be done when 3.7 is out.

The change for packagers should be pretty small, assuming they're already building the sphinx docs. If using CMake (nobody yet, I expect), the new target can be used. Otherwise, use Makefile.sphinx directly. The latter is what the Debian packaging scripts do for the LLVM docs and man pages, since there are no targets for them in the autotools build.

axw added a comment.Jun 19 2015, 11:48 PM

This is looking good. What is the ETA for getting packagers to update? It would be nice if you could chase down a couple and alert them to this change. Otherwise I fear that we will be keeping the pod file forever.

As in my other reply, my intention is to set a date to remove the files, forcing packaging scripts to be updated. I'm not sure if that is acceptable practice, so would need guidance. I'll send an email to cfe-dev. I intend to send a patch for the Debian packaging, and I'll see if I can find the maintainers for other popular distros to let them know.

axw updated this revision to Diff 28076.Jun 19 2015, 11:49 PM
axw edited edge metadata.

Mention that conf.py's autodiscovery is based on LLVM's

docs/conf.py
215–249

Done.

In D10562#191408, @axw wrote:

This is looking good. What is the ETA for getting packagers to update? It would be nice if you could chase down a couple and alert them to this change. Otherwise I fear that we will be keeping the pod file forever.

As in my other reply, my intention is to set a date to remove the files, forcing packaging scripts to be updated. I'm not sure if that is acceptable practice, so would need guidance. I'll send an email to cfe-dev. I intend to send a patch for the Debian packaging, and I'll see if I can find the maintainers for other popular distros to let them know.

Maybe chime in on Hans' post [LLVMdev] LLVM 3.7 release plan and call for testers. That's probably going to be the highest concentration of people involved in packaging/releasing.

axw updated this revision to Diff 28540.Jun 25 2015, 11:45 PM

Remove clang/docs/tools/Makefile, clang.pod, etc.

axw added a comment.Jun 25 2015, 11:50 PM
In D10562#191408, @axw wrote:

This is looking good. What is the ETA for getting packagers to update? It would be nice if you could chase down a couple and alert them to this change. Otherwise I fear that we will be keeping the pod file forever.

As in my other reply, my intention is to set a date to remove the files, forcing packaging scripts to be updated. I'm not sure if that is acceptable practice, so would need guidance. I'll send an email to cfe-dev. I intend to send a patch for the Debian packaging, and I'll see if I can find the maintainers for other popular distros to let them know.

Maybe chime in on Hans' post [LLVMdev] LLVM 3.7 release plan and call for testers. That's probably going to be the highest concentration of people involved in packaging/releasing.

I replied to a slightly older 3.7 release plan thread, and also to the package maintainers for Fedora (Adam) and SuSE (Ismail). So far only have heard back from Ismail, who said it's fine. It's a fairly trivial change, so IMO it would be fair to give until next week before assuming tacit approval, and removing the old stuff (which I've added to the diff),

gaeke added a subscriber: gaeke.Jun 26 2015, 1:06 AM
gaeke added a comment.Jun 26 2015, 1:13 AM

It looks like this patch (because it is based on r239597) may have lost the changes made to clang.pod in r239652. It might be a good idea to incorporate these before removing clang.pod for good.

axw updated this revision to Diff 28544.Jun 26 2015, 1:24 AM

Incorporate updates from r239652

axw added a comment.Jun 26 2015, 1:25 AM

It looks like this patch (because it is based on r239597) may have lost the changes made to clang.pod in r239652. It might be a good idea to incorporate these before removing clang.pod for good.

Thanks for catching that - updated.

gaeke added a comment.Jun 26 2015, 6:41 PM

Looks good.

dim added a subscriber: dim.Jun 27 2015, 2:42 AM

This looks good to me too. We had been using the .pod based man page in FreeBSD for a while, since building man pages from the other .rst files in tools/clang/docs resulted in *very* incomplete output, which looked partly like documentation, partly like a manpage...

This revision was automatically updated to reflect the committed changes.
docs/index.rst