From 04bb3e6962fc67f186397f2c9205bdcc7aecac1a Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 31 Mar 2023 15:04:29 +0200 Subject: [PATCH] DOC: improve documentation sidebar (#483) * DOC: add sidebar icons * DOC: merge ComPWA project links * DOC: remove API from main page (only sidebar) * FIX: add back package title to sidebar --- docs/conf.py | 41 ++++++++++++++++++++++++++++++++++++++++- docs/index.md | 24 +++++++++--------------- 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 39d7024b..89f4fff3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -161,6 +161,45 @@ def fetch_logo(url: str, output_path: str) -> None: html_static_path = ["_static"] html_theme = "sphinx_book_theme" html_theme_options = { + "icon_links": [ + { + "name": "Common Partial Wave Analysis", + "url": "https://compwa-org.rtfd.io", + "icon": "_static/favicon.ico", + "type": "local", + }, + { + "name": "GitHub", + "url": f"https://github.com/ComPWA/{REPO_NAME}", + "icon": "fa-brands fa-github", + }, + { + "name": "PyPI", + "url": f"https://pypi.org/project/{PACKAGE}", + "icon": "fa-brands fa-python", + }, + { + "name": "Conda", + "url": f"https://anaconda.org/conda-forge/{PACKAGE}", + "icon": "https://avatars.githubusercontent.com/u/22454001?s=100", + "type": "url", + }, + { + "name": "Launch on Binder", + "url": ( + f"https://mybinder.org/v2/gh/ComPWA/{REPO_NAME}/{BRANCH}?filepath=docs" + ), + "icon": "https://mybinder.readthedocs.io/en/latest/_static/favicon.png", + "type": "url", + }, + { + "name": "Launch on Colaboratory", + "url": f"https://colab.research.google.com/github/ComPWA/{REPO_NAME}/blob/{BRANCH}", + "icon": "https://avatars.githubusercontent.com/u/33467679?s=100", + "type": "url", + }, + ], + "logo": {"text": project}, "repository_url": f"https://github.com/ComPWA/{REPO_NAME}", "repository_branch": BRANCH, "path_to_docs": "docs", @@ -179,7 +218,7 @@ def fetch_logo(url: str, output_path: str) -> None: "show_navbar_depth": 2, "show_toc_level": 2, } -html_title = "TensorWaves" +html_title = project pygments_style = "sphinx" todo_include_todos = False viewcode_follow_imported_members = True diff --git a/docs/index.md b/docs/index.md index 1a965058..9beac160 100644 --- a/docs/index.md +++ b/docs/index.md @@ -66,10 +66,6 @@ computational backend functions can in principle be used independently. :::: -```{rubric} Table of contents - -``` - ```{toctree} --- maxdepth: 3 @@ -77,6 +73,13 @@ maxdepth: 3 install usage amplitude-analysis +``` + +```{toctree} +--- +hidden: +maxdepth: 2 +--- API Continuous benchmarks Changelog @@ -89,17 +92,8 @@ Help developing caption: Related projects hidden: --- -AmpForm QRules +AmpForm PWA Pages -``` - -```{toctree} ---- -caption: ComPWA Organization -hidden: ---- -Website -GitHub Repositories -About +ComPWA project ```