diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-09-12 08:50:52 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-09-12 11:43:12 +0200 |
commit | 5cf22dbc36d31a52775ebd15ea061e3fce6d30ca (patch) | |
tree | 3c7d86f2d8af85902088f89d966fd5326ad37482 /tools | |
parent | ace680f4c5fc8564df9daaa41bf8779c9fffa671 (diff) |
Documentation/example_gallery: Use relative paths in auto-generated titles
Currently, auto-generated titles show up as:
/tmp/snapshot-pyside-6.3-rel/pyside-setup/examples/widgets/graphicsview/elasticnodes
Use a path relative to the repository instead
(examples/widgets/graphicsview/elasticnodes).
Task-number: PYSIDE-2056
Pick-to: 6.3 6.2
Change-Id: Idbd301d4e2050517185d67c21ed2befb9e2b8506
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/example_gallery/main.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/example_gallery/main.py b/tools/example_gallery/main.py index 35e09bce3..29c5ae702 100644 --- a/tools/example_gallery/main.py +++ b/tools/example_gallery/main.py @@ -150,10 +150,10 @@ def get_code_tabs(files, project_dir): def get_header_title(example_dir): - _title = str(example_dir) _index = example_dir.parts.index("examples") - url_name = "/".join(example_dir.parts[_index + 1:]) - url = f"{BASE_URL}/{url_name}" + rel_path = "/".join(example_dir.parts[_index:]) + _title = rel_path + url = f"{BASE_URL}/{rel_path}" return ( "..\n This file was auto-generated by the 'examples_gallery' " "script.\n Any change will be lost!\n\n" @@ -168,7 +168,7 @@ if __name__ == "__main__": DIR = Path(__file__).parent EXAMPLES_DOC = Path(f"{DIR}/../../sources/pyside6/doc/examples").resolve() EXAMPLES_DIR = Path(f"{DIR}/../../examples/").resolve() - BASE_URL = "https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples" + BASE_URL = "https://code.qt.io/cgit/pyside/pyside-setup.git/tree" columns = 5 gallery = "" |