Skip to content

Commit

Permalink
DOC: link to source code on GitHub with linkcode (#371)
Browse files Browse the repository at this point in the history
* DX: ignore bookfinder.com in linkcheck
  • Loading branch information
redeboer authored Dec 7, 2023
1 parent 9c807a1 commit 4d66d74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
22 changes: 10 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@
extend_docstrings()

BRANCH = get_branch_name()
ORGANIZATION = "ComPWA"
PACKAGE = "ampform"
REPO_NAME = "ampform"
REPO_TITLE = "AmpForm"

BINDER_LINK = (
f"https://mybinder.org/v2/gh/ComPWA/{REPO_NAME}/{BRANCH}?filepath=docs/usage"
)
BINDER_LINK = f"https://mybinder.org/v2/gh/{ORGANIZATION}/{REPO_NAME}/{BRANCH}?filepath=docs/usage"
EXECUTE_NB = get_execution_mode() != "off"


Expand All @@ -52,6 +51,7 @@
})

add_module_names = False
api_github_repo = f"{ORGANIZATION}/{REPO_NAME}"
api_target_substitutions: dict[str, str | tuple[str, str]] = {
"BuilderReturnType": ("obj", "ampform.dynamics.builder.BuilderReturnType"),
"DecoratedClass": ("obj", "ampform.sympy.DecoratedClass"),
Expand Down Expand Up @@ -128,14 +128,14 @@
comments_config = {
"hypothesis": True,
"utterances": {
"repo": f"ComPWA/{REPO_NAME}",
"repo": f"{ORGANIZATION}/{REPO_NAME}",
"issue-term": "pathname",
"label": "📝 Docs",
},
}
copybutton_prompt_is_regexp = True
copybutton_prompt_text = r">>> |\.\.\. " # doctest
copyright = "2020, ComPWA"
copyright = f"2020, {ORGANIZATION}"
default_role = "py:obj"
exclude_patterns = [
"**.ipynb_checkpoints",
Expand All @@ -151,7 +151,6 @@
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_api_relink",
"sphinx_codeautolink",
"sphinx_comments",
Expand Down Expand Up @@ -188,7 +187,7 @@
},
{
"name": "GitHub",
"url": f"https://github.com/ComPWA/{REPO_NAME}",
"url": f"https://github.com/{ORGANIZATION}/{REPO_NAME}",
"icon": "fa-brands fa-github",
},
{
Expand All @@ -204,21 +203,19 @@
},
{
"name": "Launch on Binder",
"url": (
f"https://mybinder.org/v2/gh/ComPWA/{REPO_NAME}/{BRANCH}?filepath=docs"
),
"url": f"https://mybinder.org/v2/gh/{ORGANIZATION}/{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}",
"url": f"https://colab.research.google.com/github/{ORGANIZATION}/{REPO_NAME}/blob/{BRANCH}",
"icon": "https://avatars.githubusercontent.com/u/33467679?s=100",
"type": "url",
},
],
"logo": {"text": REPO_TITLE},
"repository_url": f"https://github.com/ComPWA/{REPO_NAME}",
"repository_url": f"https://github.com/{ORGANIZATION}/{REPO_NAME}",
"repository_branch": BRANCH,
"path_to_docs": "docs",
"use_download_button": True,
Expand Down Expand Up @@ -263,6 +260,7 @@
"https://hss-opus.ub.ruhr-uni-bochum.de",
"https://physique.cuso.ch",
"https://suchung.web.cern.ch",
"https://www.bookfinder.com",
]
project = REPO_TITLE
master_doc = "index"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ doc = [
"nbclient >=0.5.5", # https://github.com/executablebooks/jupyter-book/issues/833
"numpy",
"rich",
"sphinx-api-relink >=0.0.3",
"sphinx-api-relink >=0.0.4",
"sphinx-book-theme",
"sphinx-codeautolink[ipython]",
"sphinx-comments",
Expand Down

0 comments on commit 4d66d74

Please sign in to comment.