diff mbox series

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

Message ID 20261120-gen-releases-svg-fixes-v2-3-abc66b9dd7da@bootlin.com
State New
Headers show
Series tools/gen-releases-svg: fixes/improvements | expand

Commit Message

Antonin Godard Nov. 20, 2026, 8:14 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 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Quentin Schulz Nov. 20, 2026, 9:16 a.m. UTC | #1
Hi Antonin,

On 11/20/26 9:14 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.
> 
> Suggested-by: Quentin Schulz <quentin.schulz@cherry.de>
> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>

Thanks!
Quentin
diff mbox series

Patch

diff --git a/documentation/tools/gen-releases-svg b/documentation/tools/gen-releases-svg
index 32458bd9e..f8dc8e72d 100755
--- a/documentation/tools/gen-releases-svg
+++ b/documentation/tools/gen-releases-svg
@@ -18,13 +18,16 @@  import tempfile
 
 from pathlib import Path
 
+# documentation/ directory in yocto-docs
+documentation_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=documentation_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=documentation_dir / "ref-manual/svg/releases.svg")
 args = parser.parse_args()
 
 if not shutil.which("mmdc"):