DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: Ferruh Yigit <ferruh.yigit@amd.com>,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH v3 1/2] doc: copy custom CSS on guides build
Date: Wed, 31 Jul 2024 17:57:27 +0200	[thread overview]
Message-ID: <20240731155947.1681531-2-thomas@monjalon.net> (raw)
In-Reply-To: <20240731155947.1681531-1-thomas@monjalon.net>

The custom CSS file for Sphinx guides was copied during install,
but not during build time.
Before switching to Meson, the Makefile was copying this file
in the build steps, so the doc was complete and viewable
from the build directory.

It is especially useful to get full documentation in the build directory
when building only documentation with "ninja -C build doc".
The command "ninja install" was required to get the CSS file installed,
but it requires to build the libraries as well.

The CSS file is now copied as part of the Sphinx build script,
and it will be installed as part of the whole html directory.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
v2: create destination directory in case RtD theme is unavailable
v3: no change
---
 buildtools/call-sphinx-build.py | 10 ++++++++++
 doc/guides/meson.build          |  2 --
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py
index da19e950c9..623e7363ee 100755
--- a/buildtools/call-sphinx-build.py
+++ b/buildtools/call-sphinx-build.py
@@ -3,6 +3,8 @@
 # Copyright(c) 2019 Intel Corporation
 #
 
+import filecmp
+import shutil
 import sys
 import os
 from os.path import join
@@ -30,4 +32,12 @@
 with open(join(dst, '.html.d'), 'w') as d:
     d.write('html: ' + ' '.join(srcfiles) + '\n')
 
+# copy custom CSS file
+css = 'custom.css'
+src_css = join(src, css)
+dst_css = join(dst, 'html', '_static', 'css', css)
+if not os.path.exists(dst_css) or not filecmp.cmp(src_css, dst_css):
+    os.makedirs(os.path.dirname(dst_css), exist_ok=True)
+    shutil.copyfile(src_css, dst_css)
+
 sys.exit(process.returncode)
diff --git a/doc/guides/meson.build b/doc/guides/meson.build
index 51f81da2e3..f8bbfba9f5 100644
--- a/doc/guides/meson.build
+++ b/doc/guides/meson.build
@@ -24,7 +24,5 @@ html_guides = custom_target('html_guides',
         install: get_option('enable_docs'),
         install_dir: htmldir)
 
-install_data(files('custom.css'), install_dir: join_paths(htmldir,'_static', 'css'))
-
 doc_targets += html_guides
 doc_target_names += 'HTML_Guides'
-- 
2.45.0


  reply	other threads:[~2024-07-31 16:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-21  9:15 [PATCH 0/2] custom doc styling Thomas Monjalon
2024-07-21  9:15 ` [PATCH 1/2] doc: copy custom CSS on guides build Thomas Monjalon
2024-07-21  9:15 ` [PATCH 2/2] doc: give full width to NIC overview page Thomas Monjalon
2024-07-31  8:31 ` [PATCH v2 0/2] custom doc styling Thomas Monjalon
2024-07-31  8:31   ` [PATCH v2 1/2] doc: copy custom CSS on guides build Thomas Monjalon
2024-07-31 11:25     ` Ferruh Yigit
2024-07-31  8:31   ` [PATCH v2 2/2] doc: give full width to NIC overview page Thomas Monjalon
2024-07-31 11:29     ` Ferruh Yigit
2024-07-31 12:43       ` Thomas Monjalon
2024-07-31 15:56         ` Thomas Monjalon
2024-07-31 15:57 ` [PATCH v3 0/2] custom doc styling Thomas Monjalon
2024-07-31 15:57   ` Thomas Monjalon [this message]
2024-07-31 15:57   ` [PATCH v3 2/2] doc: give full width to NIC overview page Thomas Monjalon
2024-07-31 16:17     ` Ferruh Yigit
2024-07-31 16:21       ` Thomas Monjalon
2024-07-31 16:22   ` [PATCH v3 0/2] custom doc styling Thomas Monjalon
2024-07-31 16:38     ` Ferruh Yigit

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=20240731155947.1681531-2-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    /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;
as well as URLs for NNTP newsgroup(s).