Skip to content

Commit 26e123b

Browse files
committed
Refresh docs config: add intersphinx, formatting cleanup
- Add sphinx.ext.intersphinx extension for cross-references - Clean up string quoting (single -> double quotes) - Modernize Sphinx configuration formatting
1 parent 46ede3b commit 26e123b

File tree

1 file changed

+77
-72
lines changed

1 file changed

+77
-72
lines changed

docs/conf.py

Lines changed: 77 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,38 @@
1414

1515
import sys
1616
import os
17-
import sphinx_rtd_theme
1817

1918
import rawpy
2019

2120
# -- General configuration ------------------------------------------------
2221

2322
# If your documentation needs a minimal Sphinx version, state it here.
24-
#needs_sphinx = '1.0'
23+
# needs_sphinx = '1.0'
2524

2625
# Add any Sphinx extension module names here, as strings. They can be
2726
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2827
# ones.
2928
extensions = [
30-
'sphinx.ext.autodoc',
31-
'sphinx.ext.todo',
29+
"sphinx.ext.autodoc",
30+
"sphinx.ext.intersphinx",
31+
"sphinx.ext.todo",
3232
]
3333

3434
# Add any paths that contain templates here, relative to this directory.
35-
templates_path = ['_templates']
35+
templates_path = ["_templates"]
3636

3737
# The suffix of source filenames.
38-
source_suffix = '.rst'
38+
source_suffix = ".rst"
3939

4040
# The encoding of source files.
41-
#source_encoding = 'utf-8-sig'
41+
# source_encoding = 'utf-8-sig'
4242

4343
# The master toctree document.
44-
master_doc = 'index'
44+
master_doc = "index"
4545

4646
# General information about the project.
47-
project = u'rawpy'
48-
copyright = u'2014, Maik Riechert'
47+
project = "rawpy"
48+
copyright = "2014, Maik Riechert"
4949

5050
# The version info for the project you're documenting, acts as replacement for
5151
# |version| and |release|, also used in various other places throughout the
@@ -58,66 +58,66 @@
5858

5959
# The language for content autogenerated by Sphinx. Refer to documentation
6060
# for a list of supported languages.
61-
#language = None
61+
# language = None
6262

6363
# There are two options for replacing |today|: either, you set today to some
6464
# non-false value, then it is used:
65-
#today = ''
65+
# today = ''
6666
# Else, today_fmt is used as the format for a strftime call.
67-
#today_fmt = '%B %d, %Y'
67+
# today_fmt = '%B %d, %Y'
6868

6969
# List of patterns, relative to source directory, that match files and
7070
# directories to ignore when looking for source files.
71-
exclude_patterns = ['_build']
71+
exclude_patterns = ["_build"]
7272

7373
# The reST default role (used for this markup: `text`) to use for all
7474
# documents.
75-
#default_role = None
75+
# default_role = None
7676

7777
# If true, '()' will be appended to :func: etc. cross-reference text.
78-
#add_function_parentheses = True
78+
# add_function_parentheses = True
7979

8080
# If true, the current module name will be prepended to all description
8181
# unit titles (such as .. function::).
82-
#add_module_names = True
82+
# add_module_names = True
8383

8484
# If true, sectionauthor and moduleauthor directives will be shown in the
8585
# output. They are ignored by default.
86-
#show_authors = False
86+
# show_authors = False
8787

8888
# The name of the Pygments (syntax highlighting) style to use.
89-
pygments_style = 'sphinx'
89+
pygments_style = "sphinx"
9090

9191
# A list of ignored prefixes for module index sorting.
92-
#modindex_common_prefix = []
92+
# modindex_common_prefix = []
9393

9494
# If true, keep warnings as "system message" paragraphs in the built documents.
95-
#keep_warnings = False
95+
# keep_warnings = False
9696

9797

9898
# -- Options for HTML output ----------------------------------------------
9999

100100
# The theme to use for HTML and HTML Help pages. See the documentation for
101101
# a list of builtin themes.
102-
html_theme = 'sphinx_rtd_theme'
102+
html_theme = "sphinx_rtd_theme"
103103

104104
# Theme options are theme-specific and customize the look and feel of a theme
105105
# further. For a list of options available for each theme, see the
106106
# documentation.
107107
html_theme_options = {
108-
'logo_only': True,
109-
'display_version': True,
108+
"logo_only": True,
109+
"display_version": True,
110110
}
111111

112112
# Add any paths that contain custom themes here, relative to this directory.
113-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
113+
# html_theme_path = [] # Not needed for sphinx_rtd_theme >= 1.0
114114

115115
# The name for this set of Sphinx documents. If None, it defaults to
116116
# "<project> v<release> documentation".
117-
#html_title = None
117+
# html_title = None
118118

119119
# A shorter title for the navigation bar. Default is the same as html_title.
120-
#html_short_title = None
120+
# html_short_title = None
121121

122122
# The name of an image file (relative to this directory) to place at the top
123123
# of the sidebar.
@@ -126,116 +126,110 @@
126126
# The name of an image file (within the static path) to use as favicon of the
127127
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
128128
# pixels large.
129-
#html_favicon = None
129+
# html_favicon = None
130130

131131
# Add any paths that contain custom static files (such as style sheets) here,
132132
# relative to this directory. They are copied after the builtin static files,
133133
# so a file named "default.css" will overwrite the builtin "default.css".
134-
html_static_path = ['_static']
134+
html_static_path = ["_static"]
135135

136136
# Add any extra paths that contain custom files (such as robots.txt or
137137
# .htaccess) here, relative to this directory. These files are copied
138138
# directly to the root of the documentation.
139-
html_extra_path = ['gh-pages']
139+
html_extra_path = ["gh-pages"]
140140

141141
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
142142
# using the given strftime format.
143-
#html_last_updated_fmt = '%b %d, %Y'
143+
# html_last_updated_fmt = '%b %d, %Y'
144144

145145
# If true, SmartyPants will be used to convert quotes and dashes to
146146
# typographically correct entities.
147-
#html_use_smartypants = True
147+
# html_use_smartypants = True
148148

149149
# Custom sidebar templates, maps document names to template names.
150-
#html_sidebars = {}
150+
# html_sidebars = {}
151151

152152
# Additional templates that should be rendered to pages, maps page names to
153153
# template names.
154-
#html_additional_pages = {}
154+
# html_additional_pages = {}
155155

156156
# If false, no module index is generated.
157-
#html_domain_indices = True
157+
# html_domain_indices = True
158158

159159
# If false, no index is generated.
160-
#html_use_index = True
160+
# html_use_index = True
161161

162162
# If true, the index is split into individual pages for each letter.
163-
#html_split_index = False
163+
# html_split_index = False
164164

165165
# If true, links to the reST sources are added to the pages.
166-
#html_show_sourcelink = True
166+
# html_show_sourcelink = True
167167

168168
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
169-
#html_show_sphinx = True
169+
# html_show_sphinx = True
170170

171171
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
172-
#html_show_copyright = True
172+
# html_show_copyright = True
173173

174174
# If true, an OpenSearch description file will be output, and all pages will
175175
# contain a <link> tag referring to it. The value of this option must be the
176176
# base URL from which the finished HTML is served.
177-
#html_use_opensearch = ''
177+
# html_use_opensearch = ''
178178

179179
# This is the file name suffix for HTML files (e.g. ".xhtml").
180-
#html_file_suffix = None
180+
# html_file_suffix = None
181181

182182
# Output file base name for HTML help builder.
183-
htmlhelp_basename = 'rawpydoc'
183+
htmlhelp_basename = "rawpydoc"
184184

185185

186186
# -- Options for LaTeX output ---------------------------------------------
187187

188188
latex_elements = {
189-
# The paper size ('letterpaper' or 'a4paper').
190-
#'papersize': 'letterpaper',
191-
192-
# The font size ('10pt', '11pt' or '12pt').
193-
#'pointsize': '10pt',
194-
195-
# Additional stuff for the LaTeX preamble.
196-
#'preamble': '',
189+
# The paper size ('letterpaper' or 'a4paper').
190+
#'papersize': 'letterpaper',
191+
# The font size ('10pt', '11pt' or '12pt').
192+
#'pointsize': '10pt',
193+
# Additional stuff for the LaTeX preamble.
194+
#'preamble': '',
197195
}
198196

199197
# Grouping the document tree into LaTeX files. List of tuples
200198
# (source start file, target name, title,
201199
# author, documentclass [howto, manual, or own class]).
202200
latex_documents = [
203-
('index', 'rawpy.tex', u'rawpy Documentation',
204-
u'Maik Riechert', 'manual'),
201+
("index", "rawpy.tex", "rawpy Documentation", "Maik Riechert", "manual"),
205202
]
206203

207204
# The name of an image file (relative to this directory) to place at the top of
208205
# the title page.
209-
#latex_logo = None
206+
# latex_logo = None
210207

211208
# For "manual" documents, if this is true, then toplevel headings are parts,
212209
# not chapters.
213-
#latex_use_parts = False
210+
# latex_use_parts = False
214211

215212
# If true, show page references after internal links.
216-
#latex_show_pagerefs = False
213+
# latex_show_pagerefs = False
217214

218215
# If true, show URL addresses after external links.
219-
#latex_show_urls = False
216+
# latex_show_urls = False
220217

221218
# Documents to append as an appendix to all manuals.
222-
#latex_appendices = []
219+
# latex_appendices = []
223220

224221
# If false, no module index is generated.
225-
#latex_domain_indices = True
222+
# latex_domain_indices = True
226223

227224

228225
# -- Options for manual page output ---------------------------------------
229226

230227
# One entry per manual page. List of tuples
231228
# (source start file, name, description, authors, manual section).
232-
man_pages = [
233-
('index', 'rawpy', u'rawpy Documentation',
234-
[u'Maik Riechert'], 1)
235-
]
229+
man_pages = [("index", "rawpy", "rawpy Documentation", ["Maik Riechert"], 1)]
236230

237231
# If true, show URL addresses after external links.
238-
#man_show_urls = False
232+
# man_show_urls = False
239233

240234

241235
# -- Options for Texinfo output -------------------------------------------
@@ -244,21 +238,32 @@
244238
# (source start file, target name, title, author,
245239
# dir menu entry, description, category)
246240
texinfo_documents = [
247-
('index', 'rawpy', u'rawpy Documentation',
248-
u'Maik Riechert', 'rawpy', 'One line description of project.',
249-
'Miscellaneous'),
241+
(
242+
"index",
243+
"rawpy",
244+
"rawpy Documentation",
245+
"Maik Riechert",
246+
"rawpy",
247+
"One line description of project.",
248+
"Miscellaneous",
249+
),
250250
]
251251

252252
# Documents to append as an appendix to all manuals.
253-
#texinfo_appendices = []
253+
# texinfo_appendices = []
254254

255255
# If false, no module index is generated.
256-
#texinfo_domain_indices = True
256+
# texinfo_domain_indices = True
257257

258258
# How to display URL addresses: 'footnote', 'no', or 'inline'.
259-
#texinfo_show_urls = 'footnote'
259+
# texinfo_show_urls = 'footnote'
260260

261261
# If true, do not generate a @detailmenu in the "Top" node's menu.
262-
#texinfo_no_detailmenu = False
262+
# texinfo_no_detailmenu = False
263263

264-
autoclass_content = 'both'
264+
autoclass_content = "both"
265+
266+
intersphinx_mapping = {
267+
"python": ("https://docs.python.org/3", None),
268+
"numpy": ("https://numpy.org/doc/stable", None),
269+
}

0 commit comments

Comments
 (0)