Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 2/2] testplan: build also a PDF file with the testplan
Date: Mon, 20 Mar 2023 09:45:00 +0100	[thread overview]
Message-ID: <20230320084500.1434535-3-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20230320084500.1434535-1-mauro.chehab@linux.intel.com>

From: Mauro Carvalho Chehab <mchehab@kernel.org>

PDF files are easier to share, and it costs almost nothing to
produce them with Sphinx using rst2pdf. So, add support for it,
if rst2pdf is installed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 docs/testplan/meson.build | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/docs/testplan/meson.build b/docs/testplan/meson.build
index 11c08573307e..65bb6c31cd65 100644
--- a/docs/testplan/meson.build
+++ b/docs/testplan/meson.build
@@ -4,6 +4,7 @@ build_testplan = get_option('testplan')
 build_sphinx = get_option('sphinx')
 
 rst2html = find_program('rst2html-3', 'rst2html', required : build_testplan)
+rst2pdf = find_program('rst2pdf')
 sphinx = find_program('sphinx-build', required: build_sphinx)
 
 stylesheet = meson.current_source_dir() + '/testplan.css'
@@ -46,14 +47,30 @@ if sphinx.found()
                                 )
 
         custom_target('index.html',
-                    build_by_default : true,
-                    command : [ 'sphinx-build', '-c', meson.current_source_dir(), meson.current_build_dir(), sphinx_out_dir],
-                    input : index_rst,
-                    output : 'index.html'
-                    )
+                      build_by_default : true,
+                      command : [ 'sphinx-build', '-c', meson.current_source_dir(),
+                      meson.current_build_dir(), sphinx_out_dir],
+                      input : index_rst,
+                      output : 'index.html'
+                      )
+    endif
+
+    if rst2pdf.found()
+        sphinx_out_pdf = meson.current_build_dir() + '/pdf'
+
+        custom_target('xe_tests.pdf',
+                      build_by_default : true,
+                      command : [ 'sphinx-build', '-c', meson.current_source_dir(),
+                      '-b', 'pdf',
+                      '-D', 'version=' + meson.project_version(),
+                      meson.current_build_dir(), sphinx_out_pdf],
+                      input : index_rst,
+                      output : 'xe_tests.pdf'
+                      )
     endif
 endif
 
 build_info += 'Build ReST test documentation: @0@'.format(igt_doc_script.found())
 build_info += 'Build simple html testplan documentation: @0@'.format(rst2html.found())
 build_info += 'Build indexed html testplan documentation: @0@'.format(sphinx.found())
+build_info += 'Build pdf testplan documentation: @0@'.format(sphinx.found() and rst2pdf.found())
-- 
2.39.2

  parent reply	other threads:[~2023-03-20  8:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20  8:44 [igt-dev] [PATCH i-g-t v2 0/2] Build Xe test documentation Mauro Carvalho Chehab
2023-03-20  8:44 ` [igt-dev] [PATCH i-g-t v2 1/2] meson: build " Mauro Carvalho Chehab
2023-03-20 17:45   ` Kamil Konieczny
2023-03-20  8:45 ` Mauro Carvalho Chehab [this message]
2023-03-20 17:43   ` [igt-dev] [PATCH i-g-t v2 2/2] testplan: build also a PDF file with the testplan Kamil Konieczny
2023-03-20 12:15 ` [igt-dev] ✗ GitLab.Pipeline: warning for Build Xe test documentation Patchwork
2023-03-20 12:39 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230320084500.1434535-3-mauro.chehab@linux.intel.com \
    --to=mauro.chehab@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox