diff mbox series

[3/4] tools/gen-releases-svg: store docs root dir in variable

Message ID 20261119-gen-releases-svg-fixes-v1-3-b6245fbf8294@bootlin.com
State New
Headers show
Series tools/gen-releases-svg: fixes/improvements | expand

Commit Message

Antonin Godard Nov. 19, 2026, 7:55 a.m. UTC
To improve readability, store the documentation root directory in a
variable and reuse it in the default assignment for -i and -o.

Suggested-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 documentation/tools/gen-releases-svg | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Quentin Schulz Nov. 19, 2026, 12:53 p.m. UTC | #1
Hi Antonin,

On 11/19/26 8:55 AM, Antonin Godard wrote:
> To improve readability, store the documentation root directory in a
> variable and reuse it in the default assignment for -i and -o.
> 

Yeah, that's... still confusing. yocto-docs is technically the 
documentation repository so when we say documentation root directory I 
could very well see people being confused that it points at 
documentation/ in yocto-docs.

> Suggested-by: Quentin Schulz <quentin.schulz@cherry.de>
> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
> ---
>   documentation/tools/gen-releases-svg | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/documentation/tools/gen-releases-svg b/documentation/tools/gen-releases-svg
> index 77281f37d..be69777ce 100755
> --- a/documentation/tools/gen-releases-svg
> +++ b/documentation/tools/gen-releases-svg
> @@ -18,13 +18,15 @@ import tempfile
>   
>   from pathlib import Path
>   
> +docs_root_dir = Path(__file__).resolve().parent.parent
> +

suggestion: rename and add a comment

documentation_dir instead of docs_root_dir. And add something like:

# documentation/ directory in yocto-docs

What do you think?

Cheers,
Quentin
diff mbox series

Patch

diff --git a/documentation/tools/gen-releases-svg b/documentation/tools/gen-releases-svg
index 77281f37d..be69777ce 100755
--- a/documentation/tools/gen-releases-svg
+++ b/documentation/tools/gen-releases-svg
@@ -18,13 +18,15 @@  import tempfile
 
 from pathlib import Path
 
+docs_root_dir = Path(__file__).resolve().parent.parent
+
 parser = argparse.ArgumentParser(
     description="Parse releases.json and output a releases.svg file"
 )
 parser.add_argument("-i", help="Path to the releases.json file", dest="releases_json_path",
-                    default=Path(__file__).resolve().parent.parent / "releases.json")
+                    default=docs_root_dir / "releases.json")
 parser.add_argument("-o", help="Path to the output SVG", dest="output",
-                    default=Path(__file__).resolve().parent.parent / "ref-manual/svg/releases.svg")
+                    default=docs_root_dir / "ref-manual/svg/releases.svg")
 args = parser.parse_args()
 
 if not shutil.which("mmdc"):