[libvirt] [PATCH 00/17] docs: remove all use of POD for man pages in favour of RST

Daniel P. Berrangé posted 17 patches 4 years, 4 months ago
Test syntax-check failed
Failed in applying to current master (apply log)
docs/Makefile.am                              |  118 +
docs/docs.html.in                             |    3 +
docs/manpages/index.rst                       |   37 +
docs/manpages/libvirtd.rst                    |  259 +
docs/manpages/virsh.rst                       | 7096 +++++++++++++++++
docs/manpages/virt-admin.rst                  |  610 ++
docs/manpages/virt-host-validate.rst          |   95 +
docs/manpages/virt-login-shell.rst            |  144 +
docs/manpages/virt-pki-validate.rst           |   89 +
docs/manpages/virt-sanlock-cleanup.rst        |   79 +
.../manpages/virt-xml-validate.rst            |  107 +-
docs/manpages/virtlockd.rst                   |  177 +
docs/manpages/virtlogd.rst                    |  179 +
docs/styleguide.rst                           |   86 +
libvirt.spec.in                               |    7 +-
m4/virt-external-programs.m4                  |    5 +
src/Makefile.am                               |   18 -
src/keycodemapdb                              |    2 +-
src/locking/Makefile.inc.am                   |   18 -
src/locking/virtlockd.pod                     |  165 -
src/logging/Makefile.inc.am                   |   13 -
src/logging/virtlogd.pod                      |  165 -
src/remote/Makefile.inc.am                    |   15 -
src/remote/libvirtd.pod                       |  235 -
src/util/Makefile.inc.am                      |   47 +-
tools/Makefile.am                             |   68 -
tools/virsh.pod                               | 5526 -------------
tools/virt-admin.pod                          |  497 --
tools/virt-host-validate.pod                  |   68 -
tools/virt-login-shell.pod                    |  112 -
tools/virt-pki-validate.pod                   |   61 -
tools/virt-sanlock-cleanup.pod                |   49 -
32 files changed, 9052 insertions(+), 7098 deletions(-)
create mode 100644 docs/manpages/index.rst
create mode 100644 docs/manpages/libvirtd.rst
create mode 100644 docs/manpages/virsh.rst
create mode 100644 docs/manpages/virt-admin.rst
create mode 100644 docs/manpages/virt-host-validate.rst
create mode 100644 docs/manpages/virt-login-shell.rst
create mode 100644 docs/manpages/virt-pki-validate.rst
create mode 100644 docs/manpages/virt-sanlock-cleanup.rst
rename tools/virt-xml-validate.pod => docs/manpages/virt-xml-validate.rst (53%)
create mode 100644 docs/manpages/virtlockd.rst
create mode 100644 docs/manpages/virtlogd.rst
delete mode 100644 src/locking/virtlockd.pod
delete mode 100644 src/logging/virtlogd.pod
delete mode 100644 src/remote/libvirtd.pod
delete mode 100644 tools/virsh.pod
delete mode 100644 tools/virt-admin.pod
delete mode 100644 tools/virt-host-validate.pod
delete mode 100644 tools/virt-login-shell.pod
delete mode 100644 tools/virt-pki-validate.pod
delete mode 100644 tools/virt-sanlock-cleanup.pod
[libvirt] [PATCH 00/17] docs: remove all use of POD for man pages in favour of RST
Posted by Daniel P. Berrangé 4 years, 4 months ago
As part of the goal to eliminate Perl from libvirt, this gets rid of the
use of POD format for man pages. There's nothing especially bad about
POD as a markup language compared to other lightweight markup languages
like RST or Markdown. It hasn't found widespread usage outside of the
Perl world though, and so switching from POD to RST brings a language
which likely has more familiarity to contributors.

This also nicely aligns with our use of RST of web pages, and indeed
in this series things are setup so that all the man pages get published
on the main libvirt.org website. Over time this will hopefuly draw
search engines traffic to libvirt.org instead of random 3rd party
websites hosting various out of date copies of the man pages.

Reviewing the individual RST files is likely a very unpleasant task,
especially the enourmous virsh man page. Most of the conversion work
was automated with pod2rst, followed by lots of editting to cleanup
its output. virsh had some further automated processing done to create
headers for each command.

It is probably more useful to review the rendered man page output
and/or websites to see that it looks sane when read.

Daniel P. Berrangé (17):
  src: update keycodemapdb submodule
  rpm: move pod2man & rst2html deps outside the autotools conditional
  rpm: use python3-docutils as the direct dep
  docs: introduce rst2man as a mandatory tool for building docs
  docs: describe the basic RST structure for a man page
  docs: convert libvirtd man page from pod to rst
  docs: convert virtlockd man page from pod to rst
  docs: convert virtlogd man page from pod to rst
  docs: convert virt-host-validate man page from pod to rst
  docs: convert virt-pki-validate man page from pod to rst
  docs: convert virt-xml-validate man page from pod to rst
  docs: convert virt-sanlock-cleanup man page from pod to rst
  docs: convert virt-login-shell man page from pod to rst
  docs: convert virt-admin man page from pod to rst
  docs: convert virsh man page from pod to rst
  docs: convert virkeycode*/virkeyname* man pages from pod to rst
  docs: remove build recipes related to pod2man usage

 docs/Makefile.am                              |  118 +
 docs/docs.html.in                             |    3 +
 docs/manpages/index.rst                       |   37 +
 docs/manpages/libvirtd.rst                    |  259 +
 docs/manpages/virsh.rst                       | 7096 +++++++++++++++++
 docs/manpages/virt-admin.rst                  |  610 ++
 docs/manpages/virt-host-validate.rst          |   95 +
 docs/manpages/virt-login-shell.rst            |  144 +
 docs/manpages/virt-pki-validate.rst           |   89 +
 docs/manpages/virt-sanlock-cleanup.rst        |   79 +
 .../manpages/virt-xml-validate.rst            |  107 +-
 docs/manpages/virtlockd.rst                   |  177 +
 docs/manpages/virtlogd.rst                    |  179 +
 docs/styleguide.rst                           |   86 +
 libvirt.spec.in                               |    7 +-
 m4/virt-external-programs.m4                  |    5 +
 src/Makefile.am                               |   18 -
 src/keycodemapdb                              |    2 +-
 src/locking/Makefile.inc.am                   |   18 -
 src/locking/virtlockd.pod                     |  165 -
 src/logging/Makefile.inc.am                   |   13 -
 src/logging/virtlogd.pod                      |  165 -
 src/remote/Makefile.inc.am                    |   15 -
 src/remote/libvirtd.pod                       |  235 -
 src/util/Makefile.inc.am                      |   47 +-
 tools/Makefile.am                             |   68 -
 tools/virsh.pod                               | 5526 -------------
 tools/virt-admin.pod                          |  497 --
 tools/virt-host-validate.pod                  |   68 -
 tools/virt-login-shell.pod                    |  112 -
 tools/virt-pki-validate.pod                   |   61 -
 tools/virt-sanlock-cleanup.pod                |   49 -
 32 files changed, 9052 insertions(+), 7098 deletions(-)
 create mode 100644 docs/manpages/index.rst
 create mode 100644 docs/manpages/libvirtd.rst
 create mode 100644 docs/manpages/virsh.rst
 create mode 100644 docs/manpages/virt-admin.rst
 create mode 100644 docs/manpages/virt-host-validate.rst
 create mode 100644 docs/manpages/virt-login-shell.rst
 create mode 100644 docs/manpages/virt-pki-validate.rst
 create mode 100644 docs/manpages/virt-sanlock-cleanup.rst
 rename tools/virt-xml-validate.pod => docs/manpages/virt-xml-validate.rst (53%)
 create mode 100644 docs/manpages/virtlockd.rst
 create mode 100644 docs/manpages/virtlogd.rst
 delete mode 100644 src/locking/virtlockd.pod
 delete mode 100644 src/logging/virtlogd.pod
 delete mode 100644 src/remote/libvirtd.pod
 delete mode 100644 tools/virsh.pod
 delete mode 100644 tools/virt-admin.pod
 delete mode 100644 tools/virt-host-validate.pod
 delete mode 100644 tools/virt-login-shell.pod
 delete mode 100644 tools/virt-pki-validate.pod
 delete mode 100644 tools/virt-sanlock-cleanup.pod

-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 00/17] docs: remove all use of POD for man pages in favour of RST
Posted by Cole Robinson 4 years, 4 months ago
On 12/6/19 9:50 AM, Daniel P. Berrangé wrote:
> As part of the goal to eliminate Perl from libvirt, this gets rid of the
> use of POD format for man pages. There's nothing especially bad about
> POD as a markup language compared to other lightweight markup languages
> like RST or Markdown. It hasn't found widespread usage outside of the
> Perl world though, and so switching from POD to RST brings a language
> which likely has more familiarity to contributors.
> 
> This also nicely aligns with our use of RST of web pages, and indeed
> in this series things are setup so that all the man pages get published
> on the main libvirt.org website. Over time this will hopefuly draw
> search engines traffic to libvirt.org instead of random 3rd party
> websites hosting various out of date copies of the man pages.
> 
> Reviewing the individual RST files is likely a very unpleasant task,
> especially the enourmous virsh man page. Most of the conversion work
> was automated with pod2rst, followed by lots of editting to cleanup
> its output. virsh had some further automated processing done to create
> headers for each command.
> 
> It is probably more useful to review the rendered man page output
> and/or websites to see that it looks sane when read.
> 

Reviewed-by: Cole Robinson <crobinso@redhat.com>

With some tweaks:

* There's a leftover pod2man in the spec file.
* This conflicts with the virsh --tls-destination changes so don't
forget to re-merge those
* virt-host-validate patch needs this diff

diff --git a/docs/Makefile.am b/docs/Makefile.am
index e1f8f7646d..4027c2e26c 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -236,7 +236,7 @@ manpages_rst += \
   $(NULL)
 endif ! WITH_LIBVIRTD
 if WITH_HOST_VALIDATE
-  manpages8_rst += manpages/virt-host-validate.rst
+  manpages1_rst += manpages/virt-host-validate.rst
 else ! WITH_HOST_VALIDATE
   manpages_rst += manpages/virt-host-validate.rst
 endif ! WITH_HOST_VALIDATE


Non-blocking stuff:

The build process spits out noise like this now, but I didn't
investigate, maybe it was there before and I missed it:

I/O error : Attempt to load network entity
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
manpages/virkeycode-osx.html.in:2: warning: failed to load external
entity "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"


As for the format, there's some improvements and some worse things, most
are minor. The one place it's pretty ugly is virt-admin and virsh, with
the command format immediately after the command header. Old style looks
like:

    quit, exit
        quit this interactive terminal

Now it is:

   quit, exit
          quit
          exit

       quit this interactive terminal

For larger commands it's better, so it's mostly noticeable at the start
of the document with the short commands. Maybe drop the shell section
entirely for short style commands, or maybe there's some other option, I
didn't look into it much

The other bit is nested Example: sections with ~ underline. It puts the
Example: at the same indent as the top level command, which is ugly and
tough to read. Just grep the rst for '~~~~' and see how it manifests in
the output manpage. I think those few sections can be replaced by
boldified text with *Example:* and it looks better, at least with the
man page, but I didn't review the HTML.

- Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 00/17] docs: remove all use of POD for man pages in favour of RST
Posted by Daniel P. Berrangé 4 years, 4 months ago
On Tue, Dec 10, 2019 at 08:25:25PM -0500, Cole Robinson wrote:
> On 12/6/19 9:50 AM, Daniel P. Berrangé wrote:
> > As part of the goal to eliminate Perl from libvirt, this gets rid of the
> > use of POD format for man pages. There's nothing especially bad about
> > POD as a markup language compared to other lightweight markup languages
> > like RST or Markdown. It hasn't found widespread usage outside of the
> > Perl world though, and so switching from POD to RST brings a language
> > which likely has more familiarity to contributors.
> > 
> > This also nicely aligns with our use of RST of web pages, and indeed
> > in this series things are setup so that all the man pages get published
> > on the main libvirt.org website. Over time this will hopefuly draw
> > search engines traffic to libvirt.org instead of random 3rd party
> > websites hosting various out of date copies of the man pages.
> > 
> > Reviewing the individual RST files is likely a very unpleasant task,
> > especially the enourmous virsh man page. Most of the conversion work
> > was automated with pod2rst, followed by lots of editting to cleanup
> > its output. virsh had some further automated processing done to create
> > headers for each command.
> > 
> > It is probably more useful to review the rendered man page output
> > and/or websites to see that it looks sane when read.
> > 
> 
> Reviewed-by: Cole Robinson <crobinso@redhat.com>
> 
> With some tweaks:
> 
> * There's a leftover pod2man in the spec file.
> * This conflicts with the virsh --tls-destination changes so don't
> forget to re-merge those
> * virt-host-validate patch needs this diff
> 
> diff --git a/docs/Makefile.am b/docs/Makefile.am
> index e1f8f7646d..4027c2e26c 100644
> --- a/docs/Makefile.am
> +++ b/docs/Makefile.am
> @@ -236,7 +236,7 @@ manpages_rst += \
>    $(NULL)
>  endif ! WITH_LIBVIRTD
>  if WITH_HOST_VALIDATE
> -  manpages8_rst += manpages/virt-host-validate.rst
> +  manpages1_rst += manpages/virt-host-validate.rst
>  else ! WITH_HOST_VALIDATE
>    manpages_rst += manpages/virt-host-validate.rst
>  endif ! WITH_HOST_VALIDATE
> 
> 
> Non-blocking stuff:
> 
> The build process spits out noise like this now, but I didn't
> investigate, maybe it was there before and I missed it:
> 
> I/O error : Attempt to load network entity
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
> manpages/virkeycode-osx.html.in:2: warning: failed to load external
> entity "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>  1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"

That's fixed by this patch to use HTML5 instead of HTML4:

  https://www.redhat.com/archives/libvir-list/2019-December/msg00387.html

> 
> 
> As for the format, there's some improvements and some worse things, most
> are minor. The one place it's pretty ugly is virt-admin and virsh, with
> the command format immediately after the command header. Old style looks
> like:
> 
>     quit, exit
>         quit this interactive terminal
> 
> Now it is:
> 
>    quit, exit
>           quit
>           exit
> 
>        quit this interactive terminal
> 
> For larger commands it's better, so it's mostly noticeable at the start
> of the document with the short commands. Maybe drop the shell section
> entirely for short style commands, or maybe there's some other option, I
> didn't look into it much

It is a tradeoff between the man page formatting and the HTML. The
first is a heading, linked from the ToC, the second gives the actual
syntax & args. I don't think its worth changing just these few
cases without args, but maybe make it clearer 

    quit, exit
       syntax: quit
       syntax: exit
 
        quit this interactive terminal

or something similar.

> The other bit is nested Example: sections with ~ underline. It puts the
> Example: at the same indent as the top level command, which is ugly and
> tough to read. Just grep the rst for '~~~~' and see how it manifests in
> the output manpage. I think those few sections can be replaced by
> boldified text with *Example:* and it looks better, at least with the
> man page, but I didn't review the HTML.

It was done so that Example turns into a heading in the HTML, but I'l
see if there's a way to make both look nice.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list