DPDK patches and discussions
 help / color / mirror / Atom feed
From: Paul Szczepanek <paul.szczepanek@arm.com>
To: dev@dpdk.org
Cc: probb@iol.unh.edu, Paul Szczepanek <paul.szczepanek@arm.com>
Subject: [PATCH v2] dts: fix doxygen API link and DTS docs placement
Date: Fri, 25 Oct 2024 11:35:20 +0100	[thread overview]
Message-ID: <20241025103520.394951-1-paul.szczepanek@arm.com> (raw)
In-Reply-To: <20241023145732.286071-1-paul.szczepanek@arm.com>

Alias used to produce the link to the DTS API docs uses config data.
The required value in config data was being added in the wrong scope.
This moves the key addition to where the config data object is created.

DTS docs need to be placed in the same dir as main API docs.
Made DTS docs dependent on main docs and stopped separate install step
relying instead on the parent docs to install them.
This means they can no longer be build without main docs.

Added a line to sphinx python wrapper to create the destination path
if not already present.

Fixes: 7f9326423a04 ("dts: add API doc generation")

Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
Acked-by: Patrick Robb <probb@iol.unh.edu>
---
 buildtools/call-sphinx-build.py |  3 +++
 doc/api/dts/meson.build         | 12 +++++-------
 doc/api/meson.build             |  7 ++++---
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py
index 5810b7c84e..2c7de54285 100755
--- a/buildtools/call-sphinx-build.py
+++ b/buildtools/call-sphinx-build.py
@@ -25,6 +25,9 @@
 for root, dirs, files in os.walk(src):
     srcfiles.extend([join(root, f) for f in files])
 
+# create destination path if not already present
+os.makedirs(dst, exist_ok=True)
+
 # run sphinx, putting the html output in a "html" directory
 with open(join(dst, 'sphinx_html.out'), 'w') as out:
     process = run(sphinx_cmd + ['-b', 'html', src, join(dst, 'html')],
diff --git a/doc/api/dts/meson.build b/doc/api/dts/meson.build
index 5115df7095..fc147f13f3 100644
--- a/doc/api/dts/meson.build
+++ b/doc/api/dts/meson.build
@@ -11,21 +11,19 @@ if python_ver_satisfied != 0
     subdir_done()
 endif
 
-cdata.set('DTS_API_MAIN_PAGE', join_paths('..', 'dts', 'html', 'index.html'))
-
 extra_sphinx_args = ['-E', '-c', join_paths(doc_source_dir, 'guides')]
 if get_option('werror')
     extra_sphinx_args += '-W'
 endif
 
-htmldir = join_paths(get_option('datadir'), 'doc', 'dpdk', 'dts')
+# DTS docs are generated inside main Doxygen docs build directory
+# DTS docs relies on main docs to install it so does not define install dir
 dts_api_html = custom_target('dts_api_html',
+        depends: doxy_html_build,
         output: 'html',
         command: [sphinx_wrapper, sphinx, meson.project_version(),
-            meson.current_source_dir(), meson.current_build_dir(), extra_sphinx_args],
-        build_by_default: get_option('enable_docs'),
-        install: get_option('enable_docs'),
-        install_dir: htmldir)
+            meson.current_source_dir(), join_paths(api_build_dir, 'html', 'dts'), extra_sphinx_args],
+        build_by_default: get_option('enable_docs'))
 
 doc_targets += dts_api_html
 doc_target_names += 'DTS_API_HTML'
diff --git a/doc/api/meson.build b/doc/api/meson.build
index ae23e9825e..f9f1326bbd 100644
--- a/doc/api/meson.build
+++ b/doc/api/meson.build
@@ -4,9 +4,6 @@
 doxygen = find_program('doxygen', required: get_option('enable_docs'))
 
 if not doxygen.found()
-  # process DTS API doc build even if DPDK API doc build can't be done
-  cdata = configuration_data()
-  subdir('dts')
   subdir_done()
 endif
 
@@ -40,6 +37,7 @@ cdata.set('OUTPUT', join_paths(dpdk_build_root, 'doc', 'api'))
 cdata.set('TOPDIR', dpdk_source_root)
 cdata.set('STRIP_FROM_PATH', ' '.join([dpdk_source_root, join_paths(dpdk_build_root, 'doc', 'api')]))
 cdata.set('WARN_AS_ERROR', 'NO')
+cdata.set('DTS_API_MAIN_PAGE', join_paths('.', 'dts', 'html', 'index.html'))
 if get_option('werror')
     cdata.set('WARN_AS_ERROR', 'YES')
 endif
@@ -104,4 +102,7 @@ if mandb.found() and get_option('enable_docs')
     meson.add_install_script(mandb)
 endif
 
+# used by DTS to place its files into
+api_build_dir = meson.current_build_dir()
+
 subdir('dts')
-- 
2.39.2


  parent reply	other threads:[~2024-10-25 10:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23 14:57 [PATCH] dts: fix doxygen API link Paul Szczepanek
2024-10-23 15:00 ` Luca Vizzarro
2024-10-23 15:07 ` David Marchand
2024-10-23 15:10   ` Patrick Robb
2024-10-23 15:30 ` David Marchand
2024-10-24  9:12   ` David Marchand
2024-10-24 17:45     ` Paul Szczepanek
2024-10-25 10:35 ` Paul Szczepanek [this message]
2024-10-28 18:56   ` [PATCH v2] dts: fix doxygen API link and DTS docs placement Dean Marx
2024-11-06 20:14   ` Nicholas Pratte
2024-11-07 13:54   ` Patrick Robb

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=20241025103520.394951-1-paul.szczepanek@arm.com \
    --to=paul.szczepanek@arm.com \
    --cc=dev@dpdk.org \
    --cc=probb@iol.unh.edu \
    /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).