From 96b0eaeb158c1918e514faa99b8129fa0d7a6d46 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 31 Mar 2023 15:38:57 +0200 Subject: [PATCH] DOC: improve documentation sidebar (#209) * 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 | 22 ++++++++-------------- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 37508d90..40ca9514 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -206,6 +206,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": "Quantum number conservation rules"}, "repository_url": f"https://github.com/ComPWA/{REPO_NAME}", "repository_branch": BRANCH, "path_to_docs": "docs", @@ -224,7 +263,7 @@ def fetch_logo(url: str, output_path: str) -> None: "show_navbar_depth": 2, "show_toc_level": 2, } -html_title = "Quantum number conservation rules" +html_title = html_theme_options["logo"]["text"] # type: ignore[index] pygments_style = "sphinx" todo_include_todos = False viewcode_follow_imported_members = True diff --git a/docs/index.md b/docs/index.md index dca9173d..b66ec9e4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -119,16 +119,19 @@ maxdepth: 2 install usage references +``` + +```{toctree} +--- +hidden: +maxdepth: 2 +--- API Changelog Upcoming features Help developing ``` -- {ref}`Python API ` -- {ref}`General Index ` -- {ref}`Search ` - ```{toctree} --- caption: Related projects @@ -137,14 +140,5 @@ hidden: AmpForm TensorWaves PWA Pages -``` - -```{toctree} ---- -caption: ComPWA Organization -hidden: ---- -Website -GitHub Repositories -About +ComPWA project ```