DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] dts: remove html dir from dts doc path
@ 2024-11-26 16:25 Paul Szczepanek
  2024-11-27  0:02 ` Thomas Monjalon
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Paul Szczepanek @ 2024-11-26 16:25 UTC (permalink / raw)
  To: dev; +Cc: thomas, Paul Szczepanek, Luca Vizzarro

To facilitate deploying docs to the website
and make paths more consistent remove the html
directory from the dts doc path.

Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
---
 buildtools/call-sphinx-build.py | 5 +++--
 doc/api/meson.build             | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py
index 2c7de54285..93ed81ac88 100755
--- a/buildtools/call-sphinx-build.py
+++ b/buildtools/call-sphinx-build.py
@@ -30,8 +30,9 @@
 
 # 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')],
-                  stdout=out)
+    # dts is a special case which doesn't require an html dir in destination path
+    html_dst = dst if 'dts' in src else join(dst, 'html')
+    process = run(sphinx_cmd + ['-b', 'html', src, html_dst], stdout=out)
 
 # create a gcc format .d file giving all the dependencies of this doc build
 with open(join(dst, '.html.d'), 'w') as d:
diff --git a/doc/api/meson.build b/doc/api/meson.build
index f9f1326bbd..ac6eb8236d 100644
--- a/doc/api/meson.build
+++ b/doc/api/meson.build
@@ -37,7 +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'))
+cdata.set('DTS_API_MAIN_PAGE', join_paths('.', 'dts', 'index.html'))
 if get_option('werror')
     cdata.set('WARN_AS_ERROR', 'YES')
 endif
-- 
2.39.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] dts: remove html dir from dts doc path
  2024-11-26 16:25 [PATCH] dts: remove html dir from dts doc path Paul Szczepanek
@ 2024-11-27  0:02 ` Thomas Monjalon
  2024-11-27 11:41 ` [PATCH v2] docs: remove html dir from nested docs Paul Szczepanek
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2024-11-27  0:02 UTC (permalink / raw)
  To: Paul Szczepanek; +Cc: dev, Luca Vizzarro

26/11/2024 17:25, Paul Szczepanek:
> To facilitate deploying docs to the website
> and make paths more consistent remove the html
> directory from the dts doc path.
> 
> Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
> Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
> ---
>  # 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')],
> -                  stdout=out)
> +    # dts is a special case which doesn't require an html dir in destination path

The comment could be simpler like:
	# DTS API doc is already located in the API html dir

> +    html_dst = dst if 'dts' in src else join(dst, 'html')

This check is too weak.
It would be better to check for /html/dts in dst
or for /html/ in 1 of the last 2 path children.

> +    process = run(sphinx_cmd + ['-b', 'html', src, html_dst], stdout=out)




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] docs: remove html dir from nested docs
  2024-11-26 16:25 [PATCH] dts: remove html dir from dts doc path Paul Szczepanek
  2024-11-27  0:02 ` Thomas Monjalon
@ 2024-11-27 11:41 ` Paul Szczepanek
  2024-11-27 12:35   ` Thomas Monjalon
  2024-11-28 23:05 ` [PATCH v3] dts: " Paul Szczepanek
  2024-11-29 11:54 ` [PATCH v4] dts: remove nested html dir for API doc Thomas Monjalon
  3 siblings, 1 reply; 9+ messages in thread
From: Paul Szczepanek @ 2024-11-27 11:41 UTC (permalink / raw)
  To: dev; +Cc: thomas, Paul Szczepanek, Luca Vizzarro

To facilitate deploying docs to the website
and make paths more consistent remove the html
directory from nested docs.

Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
---
 buildtools/call-sphinx-build.py | 7 +++++--
 doc/api/meson.build             | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py
index 2c7de54285..fa245afa73 100755
--- a/buildtools/call-sphinx-build.py
+++ b/buildtools/call-sphinx-build.py
@@ -30,8 +30,11 @@

 # 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')],
-                  stdout=out)
+    # don't append html dir if dst is already nested in one but first
+    # remove the part of the path outside the tree in case html dir exists there
+    rel_path = os.path.relpath(dst, os.path.dirname(__file__))
+    html_dst = dst if 'html' in rel_path else join(dst, 'html')
+    process = run(sphinx_cmd + ['-b', 'html', src, html_dst], stdout=out)

 # create a gcc format .d file giving all the dependencies of this doc build
 with open(join(dst, '.html.d'), 'w') as d:
diff --git a/doc/api/meson.build b/doc/api/meson.build
index f9f1326bbd..ac6eb8236d 100644
--- a/doc/api/meson.build
+++ b/doc/api/meson.build
@@ -37,7 +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'))
+cdata.set('DTS_API_MAIN_PAGE', join_paths('.', 'dts', 'index.html'))
 if get_option('werror')
     cdata.set('WARN_AS_ERROR', 'YES')
 endif
--
2.39.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] docs: remove html dir from nested docs
  2024-11-27 11:41 ` [PATCH v2] docs: remove html dir from nested docs Paul Szczepanek
@ 2024-11-27 12:35   ` Thomas Monjalon
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2024-11-27 12:35 UTC (permalink / raw)
  To: Paul Szczepanek; +Cc: dev, Luca Vizzarro

27/11/2024 12:41, Paul Szczepanek:
> +    # don't append html dir if dst is already nested in one but first
> +    # remove the part of the path outside the tree in case html dir exists there
> +    rel_path = os.path.relpath(dst, os.path.dirname(__file__))
> +    html_dst = dst if 'html' in rel_path else join(dst, 'html')

What happens if the build directory is a completely different path
of the source tree?
Is there a risk of having the build directory inside a tree having /html/?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3] dts: remove html dir from nested docs
  2024-11-26 16:25 [PATCH] dts: remove html dir from dts doc path Paul Szczepanek
  2024-11-27  0:02 ` Thomas Monjalon
  2024-11-27 11:41 ` [PATCH v2] docs: remove html dir from nested docs Paul Szczepanek
@ 2024-11-28 23:05 ` Paul Szczepanek
  2024-11-29 11:39   ` Thomas Monjalon
  2024-11-29 11:54 ` [PATCH v4] dts: remove nested html dir for API doc Thomas Monjalon
  3 siblings, 1 reply; 9+ messages in thread
From: Paul Szczepanek @ 2024-11-28 23:05 UTC (permalink / raw)
  To: dev; +Cc: thomas, Paul Szczepanek, Luca Vizzarro

To facilitate deploying docs to the website
and make paths more consistent remove the html
directory from docs nested in html directories.

Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
---
 buildtools/call-sphinx-build.py | 6 ++++--
 doc/api/meson.build             | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py
index 2c7de54285..3e5fc813a2 100755
--- a/buildtools/call-sphinx-build.py
+++ b/buildtools/call-sphinx-build.py
@@ -30,8 +30,10 @@
 
 # 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')],
-                  stdout=out)
+    # don't append html dir if dst is already nested in a html dir
+    top_2_dirs = os.path.join(*os.path.normpath(dst).split(os.path.sep)[-2:])
+    html_dst = dst if 'html' in top_2_dirs else join(dst, 'html')
+    process = run(sphinx_cmd + ['-b', 'html', src, html_dst], stdout=out)
 
 # create a gcc format .d file giving all the dependencies of this doc build
 with open(join(dst, '.html.d'), 'w') as d:
diff --git a/doc/api/meson.build b/doc/api/meson.build
index f9f1326bbd..ac6eb8236d 100644
--- a/doc/api/meson.build
+++ b/doc/api/meson.build
@@ -37,7 +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'))
+cdata.set('DTS_API_MAIN_PAGE', join_paths('.', 'dts', 'index.html'))
 if get_option('werror')
     cdata.set('WARN_AS_ERROR', 'YES')
 endif
-- 
2.39.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3] dts: remove html dir from nested docs
  2024-11-28 23:05 ` [PATCH v3] dts: " Paul Szczepanek
@ 2024-11-29 11:39   ` Thomas Monjalon
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2024-11-29 11:39 UTC (permalink / raw)
  To: Paul Szczepanek; +Cc: dev, Luca Vizzarro

29/11/2024 00:05, Paul Szczepanek:
> To facilitate deploying docs to the website
> and make paths more consistent remove the html
> directory from docs nested in html directories.
> 
> Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
> Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
> ---
>  buildtools/call-sphinx-build.py | 6 ++++--
>  doc/api/meson.build             | 2 +-
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py
> index 2c7de54285..3e5fc813a2 100755
> --- a/buildtools/call-sphinx-build.py
> +++ b/buildtools/call-sphinx-build.py
> @@ -30,8 +30,10 @@
>  
>  # 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')],
> -                  stdout=out)
> +    # don't append html dir if dst is already nested in a html dir
> +    top_2_dirs = os.path.join(*os.path.normpath(dst).split(os.path.sep)[-2:])
> +    html_dst = dst if 'html' in top_2_dirs else join(dst, 'html')
> +    process = run(sphinx_cmd + ['-b', 'html', src, html_dst], stdout=out)

There is still a file in the extra html directory:

build/doc/api/html/dts/html/_static/css/custom.css

I suppose that we need to change this line:

dst_css = join(dst, 'html', '_static', 'css', css)

into

dst_css = join(html_dst, '_static', 'css', css)

Then it should become this path:

build/doc/api/html/dts/_static/css/custom.css



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v4] dts: remove nested html dir for API doc
  2024-11-26 16:25 [PATCH] dts: remove html dir from dts doc path Paul Szczepanek
                   ` (2 preceding siblings ...)
  2024-11-28 23:05 ` [PATCH v3] dts: " Paul Szczepanek
@ 2024-11-29 11:54 ` Thomas Monjalon
  2024-11-29 12:15   ` Paul Szczepanek
  3 siblings, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2024-11-29 11:54 UTC (permalink / raw)
  To: dev; +Cc: Paul Szczepanek, Luca Vizzarro, Bruce Richardson

From: Paul Szczepanek <paul.szczepanek@arm.com>

To facilitate deploying docs to the website
and make paths more consistent remove the html
directory from docs nested in API html directory.

Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v4: fix custom.css path and reword a little
---
 buildtools/call-sphinx-build.py | 8 +++++---
 doc/api/meson.build             | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py
index 2c7de54285..c891f68ae4 100755
--- a/buildtools/call-sphinx-build.py
+++ b/buildtools/call-sphinx-build.py
@@ -30,8 +30,10 @@
 
 # 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')],
-                  stdout=out)
+    # don't append html dir if dst is already nested in a html dir
+    last_two_dirs = os.path.join(*os.path.normpath(dst).split(os.path.sep)[-2:])
+    html_dst = dst if 'html' in last_two_dirs else join(dst, 'html')
+    process = run(sphinx_cmd + ['-b', 'html', src, html_dst], stdout=out)
 
 # create a gcc format .d file giving all the dependencies of this doc build
 with open(join(dst, '.html.d'), 'w') as d:
@@ -40,7 +42,7 @@
 # copy custom CSS file
 css = 'custom.css'
 src_css = join(src, css)
-dst_css = join(dst, 'html', '_static', 'css', css)
+dst_css = join(html_dst, '_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)
diff --git a/doc/api/meson.build b/doc/api/meson.build
index f9f1326bbd..ac6eb8236d 100644
--- a/doc/api/meson.build
+++ b/doc/api/meson.build
@@ -37,7 +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'))
+cdata.set('DTS_API_MAIN_PAGE', join_paths('.', 'dts', 'index.html'))
 if get_option('werror')
     cdata.set('WARN_AS_ERROR', 'YES')
 endif
-- 
2.47.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v4] dts: remove nested html dir for API doc
  2024-11-29 11:54 ` [PATCH v4] dts: remove nested html dir for API doc Thomas Monjalon
@ 2024-11-29 12:15   ` Paul Szczepanek
  2024-11-29 12:59     ` Thomas Monjalon
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Szczepanek @ 2024-11-29 12:15 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: nd



On 29/11/2024 11:54, Thomas Monjalon wrote:
> From: Paul Szczepanek <paul.szczepanek@arm.com>
> 
> To facilitate deploying docs to the website
> and make paths more consistent remove the html
> directory from docs nested in API html directory.
> 
> Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
> Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---

Makes sense to remove the html from the css, thanks.

Won't the scripts complain about the order of tags? Signed off should
come before reviewed.

Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v4] dts: remove nested html dir for API doc
  2024-11-29 12:15   ` Paul Szczepanek
@ 2024-11-29 12:59     ` Thomas Monjalon
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2024-11-29 12:59 UTC (permalink / raw)
  To: Paul Szczepanek; +Cc: dev, nd

29/11/2024 13:15, Paul Szczepanek:
> 
> On 29/11/2024 11:54, Thomas Monjalon wrote:
> > From: Paul Szczepanek <paul.szczepanek@arm.com>
> > 
> > To facilitate deploying docs to the website
> > and make paths more consistent remove the html
> > directory from docs nested in API html directory.
> > 
> > Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
> > Reviewed-by: Luca Vizzarro <luca.vizzarro@arm.com>
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> 
> Makes sense to remove the html from the css, thanks.
> 
> Won't the scripts complain about the order of tags? Signed off should
> come before reviewed.

Scripts are emitting warnings, and sometimes we can do differently :)

Here I prefer adding my Signoff at the end to show I did only last minute change.



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-11-29 12:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-26 16:25 [PATCH] dts: remove html dir from dts doc path Paul Szczepanek
2024-11-27  0:02 ` Thomas Monjalon
2024-11-27 11:41 ` [PATCH v2] docs: remove html dir from nested docs Paul Szczepanek
2024-11-27 12:35   ` Thomas Monjalon
2024-11-28 23:05 ` [PATCH v3] dts: " Paul Szczepanek
2024-11-29 11:39   ` Thomas Monjalon
2024-11-29 11:54 ` [PATCH v4] dts: remove nested html dir for API doc Thomas Monjalon
2024-11-29 12:15   ` Paul Szczepanek
2024-11-29 12:59     ` Thomas Monjalon

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).