diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-09-12 08:50:52 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-09-12 11:52:55 +0000 |
commit | eb951ce06dd0e9268d47c5d6b462a842765aa013 (patch) | |
tree | 628d956025e383cc37c2e943382d39adf61d307c | |
parent | 1dd083b961a57f3e688b9b6bedc995e3f52ca921 (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
Change-Id: Idbd301d4e2050517185d67c21ed2befb9e2b8506
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
(cherry picked from commit 5cf22dbc36d31a52775ebd15ea061e3fce6d30ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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 291514ab0..3dab597f2 100644 --- a/tools/example_gallery/main.py +++ b/tools/example_gallery/main.py @@ -180,10 +180,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" @@ -198,7 +198,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 = "" |