Debian Codegraph @

docs/conf.py

raw symbols SCIP
1 # icalendar documentation build configuration file
2 import importlib.metadata
3 import datetime
4 import os
5 from pathlib import Path
6 import sys
7
8 extensions = [
9 "sphinx.ext.autodoc",
10 "sphinx.ext.coverage",
11 "sphinx.ext.viewcode",
12 "sphinx_copybutton",
13 "sphinx.ext.intersphinx",
14 "sphinx.ext.autosectionlabel",
15 "sphinx.ext.napoleon",
16 "sphinx_autodoc_typehints",
17 # from pydata-sphix-theme
18 "myst_parser",
19 # from https://sphinx-toolbox.readthedocs.io/
20 "sphinx_tabs.tabs",
21 "sphinx-prompt",
22 # "sphinx_toolbox",
23 # "sphinx_toolbox.more_autodoc"
24 ]
25 source_suffix = {".rst": "restructuredtext"}
26 master_doc = "index"
27
28 project = "recurring-ical-events"
29 this_year = datetime.date.today().year
30 copyright = f"{this_year}, Nicco Kunzmann & recurring-ical-events contributors"
31 release = version = importlib.metadata.version("recurring-ical-events")
32
33
34 # -- Options for HTML output -------------------------------------------------
35
36 # The theme to use for HTML and HTML Help pages. See the documentation for
37 # a list of builtin themes.
38 html_theme = "pydata_sphinx_theme"
39 html_theme_options = {
40 "icon_links": [
41 {
42 "name": "GitHub",
43 "url": "https://github.com/niccokunzmann/python-recurring-ical-events",
44 "icon": "fa-brands fa-square-github",
45 "type": "fontawesome",
46 "attributes": {
47 "target": "_blank",
48 "rel": "noopener me",
49 "class": "nav-link custom-fancy-css"
50 }
51 },
52 {
53 "name": "PyPI",
54 "url": "https://pypi.org/project/recurring-ical-events",
55 "icon": "fa-solid fa-download",
56 "type": "fontawesome",
57 "attributes": {
58 "target": "_blank",
59 "rel": "noopener me",
60 "class": "nav-link custom-fancy-css"
61 }
62 },
63 {
64 "name": "Mastodon",
65 "url": "https://toot.wales/tags/RecurringIcalEvents",
66 "icon": "fa-brands fa-mastodon",
67 "type": "fontawesome",
68 "attributes": {
69 "target": "_blank",
70 "rel": "noopener me",
71 "class": "nav-link custom-fancy-css"
72 }
73 },
74 {
75 "name": "Youtube",
76 "url": "https://www.youtube.com/watch?v=nwpS2dCk_Rk&list=PLxMGFFiBKgdb3L550U5EAiCvft2IK08xK",
77 "icon": "fa-brands fa-youtube",
78 "type": "fontawesome",
79 "attributes": {
80 "target": "_blank",
81 "rel": "noopener me",
82 "class": "nav-link custom-fancy-css"
83 }
84 }
85 ],
86 "navigation_with_keys": True,
87 "search_bar_text": "Search",
88 "show_nav_level": 2,
89 "show_toc_level": 2,
90 "use_edit_page_button": True,
91 }
92 html_context = {
93 # "github_url": "https://github.com", # or your GitHub Enterprise site
94 "github_user": "niccokunzmann",
95 "github_repo": "python-recurring-ical-events",
96 "github_version": "main",
97 "doc_path": "docs",
98 }
99 htmlhelp_basename = "recurring-ical-events-doc"
100 pygments_style = "sphinx"
101
102
103 # -- Intersphinx configuration ----------------------------------
104
105 # This extension can generate automatic links to the documentation of objects
106 # in other projects. Usage is simple: whenever Sphinx encounters a
107 # cross-reference that has no matching target in the current documentation set,
108 # it looks for targets in the documentation sets configured in
109 # intersphinx_mapping. A reference like :py:class:`zipfile.ZipFile` can then
110 # linkto the Python documentation for the ZipFile class, without you having to
111 # specify where it is located exactly.
112 #
113 # https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html
114 intersphinx_mapping = {
115 "python": ("https://docs.python.org/3", None),
116 "icalendar": ("https://icalendar.readthedocs.io/en/latest", None),
117 "dateutil": ("https://dateutil.readthedocs.io/en/stable/", None),
118 }
119
120
121 man_pages = [("index", "recurring_ical_events", "recurring_ical_events Documentation", ["Nicco Kunzmann"], 1)]
122
123 exclude_patterns = [
124 "venv"
125 ]
126
127 # we have had issues with linkcheck timing and retries on www.gnu.org
128 linkcheck_retries = 1
129 linkcheck_timeout = 5
130 linkcheck_report_timeouts_as_broken = True
131
132 # autodoc
133 autodoc_typehints_format = "short"
134 autodoc_preserve_defaults = True
135 autodoc_type_aliases = {
136 "datetime": "datetime.datetime",
137 "date": "datetime.date",
138 "timedelta": "datetime.timedelta",
139 "Time": "recurring_ical_events.types.Time",
140 "DateArgument": "recurring_ical_events.types.DateArgument",
141 "UID": "recurring_ical_events.types.UID",
142 "Timestamp": "recurring_ical_events.types.Timestamp",
143 "RecurrenceID": "recurring_ical_events.types.RecurrenceID",
144 "RecurrenceIDs": "recurring_ical_events.types.RecurrenceIDs",
145 "Component": "icalendar.cal.Component",
146 "Calendar": "icalendar.cal.Calendar",
147 "T_COMPONENTS": "recurring_ical_events.query.T_COMPONENTS",
148 "OccurrenceID": "recurring_ical_events.occurrence.OccurrenceID",
149 "icalendar.Calendar": "icalendar.cal.Calendar",
150 }
151
152 # sphinx-toolbox
153 github_username = "niccokunzmann"
154 github_repository = "python-recurring-ical-events"
155
156
157 # from https://github.com/sphinx-doc/sphinx/issues/10785
158 nitpick_ignore = [
159 # ignore for now
160 ("py:class", "recurring_ical_events.types.Time"),
161 ("py:class", "recurring_ical_events.types.UID"),
162 ("py:class", "recurring_ical_events.types.RecurrenceIDs"),
163 ("py:class", "Time"),
164 ("py:class", "UID"),
165 ("py:class", "RecurrenceID"),
166 ("py:class", "TypeAliasForwardRef"),
167 # /home/nicco/recurring-ical-events/recurring_ical_events/__init__.py:docstring of recurring_ical_events.OccurrenceID.uid:1: WARNING: duplicate object description of recurring_ical_events.OccurrenceID.uid, other instance in reference/api, use :no-index: for one of them
168 ("py:obj", "recurring_ical_events.OccurrenceID.uid"),
169 ]
170
171 # make title smaller
172 # see https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_title
173 html_title = f"{project} {release}"
174 html_short_title = project
175
176 # try reloading the module
177 # see https://github.com/sphinx-doc/sphinx/issues/4317#issuecomment-353793061
178 HERE = Path(__file__).parent
179 sys.path.insert(0, str(Path(HERE).parent))
180