[PATCH] docs: manpages: Strip table of contents from manpages

Peter Krempa posted 1 patch 3 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/35f8dcc77fbcf1584e9de3430f049114085d1ea1.1600867070.git.pkrempa@redhat.com
Test syntax-check failed
docs/manpages/meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] docs: manpages: Strip table of contents from manpages
Posted by Peter Krempa 3 years, 6 months ago
After meson conversion the man pages started to contain the table of
contents.

In autoconf we prevented this by a 'grep -v ::contents' in the command
building the manpages.

A more cultured solution is to strip out the 'contents' docutils element
directly.

Reported-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 docs/manpages/meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build
index 3888bb8efe..7ed1d304a4 100644
--- a/docs/manpages/meson.build
+++ b/docs/manpages/meson.build
@@ -89,7 +89,8 @@ foreach data : docs_man_files
       man_file,
       input: rst_file,
       output: man_file,
-      command: [ rst2man_prog, '--strict', '@INPUT@', '@OUTPUT@' ],
+      # 'contents' element is the table of contents which is undesired in manpage
+      command: [ rst2man_prog, '--strip-elements-with-class', 'contents', '--strict', '@INPUT@', '@OUTPUT@' ],
       install: true,
       install_dir: mandir / 'man@0@'.format(data['section']),
     )
-- 
2.26.2

Re: [PATCH] docs: manpages: Strip table of contents from manpages
Posted by Pavel Hrdina 3 years, 6 months ago
On Wed, Sep 23, 2020 at 03:17:50PM +0200, Peter Krempa wrote:
> After meson conversion the man pages started to contain the table of
> contents.
> 
> In autoconf we prevented this by a 'grep -v ::contents' in the command
> building the manpages.
> 
> A more cultured solution is to strip out the 'contents' docutils element
> directly.
> 
> Reported-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  docs/manpages/meson.build | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Re: [PATCH] docs: manpages: Strip table of contents from manpages
Posted by Daniel P. Berrangé 3 years, 6 months ago
On Wed, Sep 23, 2020 at 03:17:50PM +0200, Peter Krempa wrote:
> After meson conversion the man pages started to contain the table of
> contents.
> 
> In autoconf we prevented this by a 'grep -v ::contents' in the command
> building the manpages.
> 
> A more cultured solution is to strip out the 'contents' docutils element
> directly.

Ah, very nice and clever !

> 
> Reported-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  docs/manpages/meson.build | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build
> index 3888bb8efe..7ed1d304a4 100644
> --- a/docs/manpages/meson.build
> +++ b/docs/manpages/meson.build
> @@ -89,7 +89,8 @@ foreach data : docs_man_files
>        man_file,
>        input: rst_file,
>        output: man_file,
> -      command: [ rst2man_prog, '--strict', '@INPUT@', '@OUTPUT@' ],
> +      # 'contents' element is the table of contents which is undesired in manpage
> +      command: [ rst2man_prog, '--strip-elements-with-class', 'contents', '--strict', '@INPUT@', '@OUTPUT@' ],
>        install: true,
>        install_dir: mandir / 'man@0@'.format(data['section']),
>      )

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

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 :|

Re: [PATCH] docs: manpages: Strip table of contents from manpages
Posted by Ján Tomko 3 years, 6 months ago
On a Wednesday in 2020, Peter Krempa wrote:
>After meson conversion the man pages started to contain the table of
>contents.
>
>In autoconf we prevented this by a 'grep -v ::contents' in the command
>building the manpages.
>
>A more cultured solution is to strip out the 'contents' docutils element
>directly.
>
>Reported-by: Daniel P. Berrangé <berrange@redhat.com>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> docs/manpages/meson.build | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano