| •1 |
import os |
| 2 |
|
| 3 |
from pallets_sphinx_themes import get_version |
| 4 |
from pallets_sphinx_themes import ProjectLink |
| 5 |
|
| 6 |
# Project -------------------------------------------------------------- |
| 7 |
|
| 8 |
project = "Click" |
| 9 |
copyright = "2014 Pallets" |
| 10 |
author = "Pallets" |
| •11 |
if "DEB_VERSION_UPSTREAM" in os.environ: |
| 12 |
version = os.environ["DEB_VERSION_UPSTREAM"] |
| 13 |
release = f"{version.split('.', 2)[:2]}.x" |
| 14 |
else: |
| 15 |
release, version = get_version("Click") |
| 16 |
|
| 17 |
# General -------------------------------------------------------------- |
| 18 |
|
| 19 |
master_doc = "index" |
| 20 |
default_role = "code" |
| 21 |
extensions = [ |
| 22 |
"sphinx.ext.autodoc", |
| 23 |
"sphinx.ext.extlinks", |
| 24 |
"sphinx.ext.intersphinx", |
| 25 |
"sphinx_tabs.tabs", |
| 26 |
"sphinxcontrib.log_cabinet", |
| 27 |
"pallets_sphinx_themes", |
| 28 |
"myst_parser", |
| 29 |
] |
| 30 |
autodoc_member_order = "bysource" |
| 31 |
autodoc_typehints = "description" |
| 32 |
autodoc_preserve_defaults = True |
| 33 |
extlinks = { |
| 34 |
"issue": ("https://github.com/pallets/click/issues/%s", "#%s"), |
| 35 |
"pr": ("https://github.com/pallets/click/pull/%s", "#%s"), |
| 36 |
} |
| 37 |
intersphinx_mapping = { |
| •38 |
"python": ("/usr/share/doc/python3-doc/html", None), |
| 39 |
} |
| 40 |
|
| 41 |
# HTML ----------------------------------------------------------------- |
| 42 |
|
| 43 |
html_theme = "click" |
| 44 |
html_theme_options = {"index_sidebar_logo": False} |
| 45 |
html_context = { |
| 46 |
"project_links": [ |
| 47 |
ProjectLink("Donate", "https://palletsprojects.com/donate"), |
| 48 |
ProjectLink("PyPI Releases", "https://pypi.org/project/click/"), |
| 49 |
ProjectLink("Source Code", "https://github.com/pallets/click/"), |
| 50 |
ProjectLink("Issue Tracker", "https://github.com/pallets/click/issues/"), |
| 51 |
ProjectLink("Chat", "https://discord.gg/pallets"), |
| 52 |
] |
| 53 |
} |
| 54 |
html_sidebars = { |
| 55 |
"index": ["project.html", "localtoc.html", "searchbox.html", "ethicalads.html"], |
| 56 |
"**": ["localtoc.html", "relations.html", "searchbox.html", "ethicalads.html"], |
| 57 |
} |
| 58 |
singlehtml_sidebars = {"index": ["project.html", "localtoc.html", "ethicalads.html"]} |
| 59 |
html_static_path = ["_static"] |
| 60 |
html_favicon = "_static/click-icon.svg" |
| 61 |
html_logo = "_static/click-logo.svg" |
| 62 |
html_title = f"Click Documentation ({version})" |
| 63 |
html_show_sourcelink = False |