[PATCH 1/7] docs: build: Don't include stylesheet in intermediate html files generated from RST

Peter Krempa posted 7 patches 5 years, 6 months ago
[PATCH 1/7] docs: build: Don't include stylesheet in intermediate html files generated from RST
Posted by Peter Krempa 5 years, 6 months ago
'docutils' add a stylesheet to the output html file for direct
consumption. Since we use the html files just as an intermediate step
which is post-processed to add our own stylesheet and drop the docutils
one in the process we can ask 'rst2html' to not add any for a
intermediate file with less garbage.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 docs/manpages/meson.build | 2 +-
 docs/meson.build          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build
index e9d9ac8069..97133adf3a 100644
--- a/docs/manpages/meson.build
+++ b/docs/manpages/meson.build
@@ -99,7 +99,7 @@ foreach data : docs_man_files
     html_in_file,
     input: rst_file,
     output: html_in_file,
-    command: [ rst2html_prog, '--strict', '@INPUT@' ],
+    command: [ rst2html_prog, '--stylesheet=', '--strict', '@INPUT@' ],
     capture: true,
   )

diff --git a/docs/meson.build b/docs/meson.build
index 2f06e8eace..a98147f7fd 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -188,7 +188,7 @@ docs_admin_api_xml = docs_api_generated[3]
 docs_rst2html_gen = generator(
   rst2html_prog,
   output: '@BASENAME@.html.in',
-  arguments: [ '--strict', '@INPUT@' ],
+  arguments: [ '--stylesheet=', '--strict', '@INPUT@' ],
   capture: true,
 )

-- 
2.26.2

Re: [PATCH 1/7] docs: build: Don't include stylesheet in intermediate html files generated from RST
Posted by Ján Tomko 5 years, 6 months ago
On a Monday in 2020, Peter Krempa wrote:
>'docutils' add a stylesheet to the output html file for direct
>consumption. Since we use the html files just as an intermediate step
>which is post-processed to add our own stylesheet and drop the docutils
>one in the process we can ask 'rst2html' to not add any for a
>intermediate file with less garbage.

'an intermediate'

>

Hmm,
   Minimal style sheet for the HTML output of Docutils
does not look minimal to me:
"docs/kbase.html.p/kbase.html.in" 610L, 16789B                            557,1         93%

>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> docs/manpages/meson.build | 2 +-
> docs/meson.build          | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>

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

Jano