Debian Codegraph @

docs/conf.py

raw
1 # Configuration file for the Sphinx documentation builder.
2 #
3 # For the full list of built-in configuration values, see the documentation:
4 # https://www.sphinx-doc.org/en/master/usage/configuration.html
5
6 # -- Project information -----------------------------------------------------
7 # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8
9 import sys
10 from pathlib import Path
11
12 # Add custom extensions directory to path
13 sys.path.insert(0, str(Path(__file__).parent / "extensions"))
14
15 project = "beets"
16 AUTHOR = "Adrian Sampson"
17 copyright = "2016, Adrian Sampson" # noqa: A001
18
19 master_doc = "index"
20 language = "en"
21 version = "2.14"
22 release = "2.14.1"
23
24 # -- General configuration ---------------------------------------------------
25 # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
26
27 extensions = [
28 "sphinx.ext.autodoc",
29 "sphinx.ext.autosummary",
30 "sphinx.ext.extlinks",
31 "sphinx.ext.viewcode",
32 "sphinx_design",
33 "sphinx_copybutton",
34 "conf",
35 "sphinx_toolbox.more_autodoc.autotypeddict",
36 "sphinx_toolbox.more_autodoc.autonamedtuple",
37 ]
38
39 autosummary_generate = True
40 autosummary_context = {
41 "related_typeddicts": {
42 "MusicBrainzAPI": [
43 "beetsplug._utils.musicbrainz.LookupKwargs",
44 "beetsplug._utils.musicbrainz.SearchKwargs",
45 "beetsplug._utils.musicbrainz.BrowseKwargs",
46 "beetsplug._utils.musicbrainz.BrowseRecordingsKwargs",
47 "beetsplug._utils.musicbrainz.BrowseReleaseGroupsKwargs",
48 ]
49 }
50 }
51 autodoc_member_order = "bysource"
52 exclude_patterns = ["_build"]
53 templates_path = ["_templates"]
54 source_suffix = {".rst": "restructuredtext", ".md": "markdown"}
55
56 pygments_style = "sphinx"
57
58 # External links to the bug tracker and other sites.
59 extlinks = {
60 "bug": ("https://github.com/beetbox/beets/issues/%s", "#%s"),
61 "user": ("https://github.com/%s", "%s"),
62 "pypi": ("https://pypi.org/project/%s/", "%s"),
63 "stdlib": ("https://docs.python.org/3/library/%s.html", "%s"),
64 }
65
66 linkcheck_ignore = [
67 r"https://github.com/beetbox/beets/issues/",
68 r"https://github.com/[^/]+$", # ignore user pages
69 r".*localhost.*",
70 r"https?://127\.0\.0\.1",
71 r"https://www.musixmatch.com/", # blocks requests
72 r"https://genius.com/", # blocks requests
73 r"https://sourceforge\.net/", # blocks requests
74 r"https://[^/]*fanart\.tv/", # blocks requests
75 r"https://[^/]*fandom\.com/", # blocks requests
76 r"https://imgur\.com/", # not accessible from the UK
77 r"https://(www\.)?discogs.com.*", # blocks requests
78 r"https://essentia.upf.edu/", # times out in CI
79 r"https://flask.palletsprojects.com.*", # times out in CI
80 r"https://search.worldcat.org.*", # blocks requests
81 r"https://tidal.com.*", # blocks requests
82 r"https://www.tekstowo.pl/", # blocks requests
83 r"https://www.gnu.org.*", # sometimes unreachable
84 r"https://www.nongnu.org.*", # sometimes unreachable
85 r"https://web.archive.org.*", # sometimes unreachable
86 r"https://www.sonos.com.*", # blocks requests
87 r"https://stackoverflow.com.*", # blocks requests
88 r"https://superuser.com.*", # blocks requests
89 r"https://support.discogs.com.*", # blocks requests
90 r"https://forge\.kanis\.fr.*", # SSL cert issues
91 r"https://id3\.org.*", # intermittent server errors
92 ]
93
94 # Options for HTML output
95 htmlhelp_basename = "beetsdoc"
96
97 # Options for LaTeX output
98 latex_documents = [
99 ("index", "beets.tex", "beets Documentation", AUTHOR, "manual")
100 ]
101
102 # Options for manual page output
103 man_pages = [
104 (
105 "reference/cli",
106 "beet",
107 "music tagger and library organizer",
108 [AUTHOR],
109 1,
110 ),
111 (
112 "reference/config",
113 "beetsconfig",
114 "beets configuration file",
115 [AUTHOR],
116 5,
117 ),
118 ]
119
120 # Global substitutions that can be used anywhere in the documentation.
121 rst_epilog = r"""
122 .. |Album| replace:: :class:`~beets.library.models.Album`
123 .. |AlbumInfo| replace:: :class:`beets.autotag.hooks.AlbumInfo`
124 .. |BeetsPlugin| replace:: :class:`beets.plugins.BeetsPlugin`
125 .. |ImportSession| replace:: :class:`~beets.importer.session.ImportSession`
126 .. |ImportTask| replace:: :class:`~beets.importer.tasks.ImportTask`
127 .. |Item| replace:: :class:`~beets.library.models.Item`
128 .. |Library| replace:: :class:`~beets.library.library.Library`
129 .. |Model| replace:: :class:`~beets.dbcore.db.Model`
130 .. |TrackInfo| replace:: :class:`beets.autotag.hooks.TrackInfo`
131 .. |semicolon_space| replace:: :literal:`; \ `
132 """
133
134 # -- Options for HTML output -------------------------------------------------
135 # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
136
137
138 html_theme = "pydata_sphinx_theme"
139 html_theme_options = {
140 "collapse_navigation": False,
141 "logo": {"text": "beets"},
142 "show_nav_level": 2, # How many levels in left sidebar to show automatically
143 "navigation_depth": 4, # How many levels of navigation to expand
144 }
145 html_title = "beets"
146 html_logo = "_static/beets_logo_nobg.png"
147 html_static_path = ["_static"]
148 html_css_files = ["beets.css"]
149
150
151 def skip_member(app, what, name: str, obj, skip, options):
152 if name.startswith("_"):
153 return True
154 return skip
155
156
157 def setup(app) -> None:
158 app.connect("autodoc-skip-member", skip_member)