Skip to content

Commit 2bbbdca

Browse files
Update Sphinx config (#898)
* Remove commented config values * Update .readthedocs.yml * Remove man, htmlhelp, latex * Remove unneeded config * Remove unused templates * Remove unused stylesheet * Remove rstlint * Reformat conf.py * Make the site logo smaller * Move logo to static * Rename to `_static` to align with the other PR * Fix path * Rename CSS overrides * Add 128px image * Also specify height * Use vector logo * Add newline at the end of `conf.py`. Co-authored-by: Ezio Melotti <[email protected]>
1 parent 355d151 commit 2bbbdca

10 files changed

+47
-569
lines changed

.readthedocs.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
# .readthedocs.yml
21
# Read the Docs configuration file
32
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
# Project page: https://readthedocs.org/projects/cpython-devguide/
44

55
version: 2
66

77
sphinx:
88
builder: dirhtml
99
configuration: conf.py
1010

11-
formats: all
12-
1311
build:
14-
os: ubuntu-20.04
12+
os: ubuntu-22.04
1513
tools:
1614
python: "3.10"
1715

_static/devguide_overrides.css

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* Style overrides for the devguide */
2+
3+
/* Make the site logo smaller */
4+
.sidebar-logo {
5+
width: 111px;
6+
height: 110px;
7+
}

_static/python-logo.svg

+18
Loading

conf.py

+19-209
Original file line numberDiff line numberDiff line change
@@ -1,228 +1,39 @@
1-
# -*- coding: utf-8 -*-
2-
#
3-
# Python Developer's Guide documentation build configuration file, created by
4-
# sphinx-quickstart on Tue Jan 4 10:34:03 2011.
5-
#
6-
# This file is execfile()d with the current directory set to its containing dir.
7-
#
8-
# Note that not all possible configuration values are present in this
9-
# autogenerated file.
10-
#
11-
# All configuration values have a default; values that are commented out
12-
# serve to show the default.
13-
14-
import os
15-
import sys
161
import time
172

18-
# If extensions (or modules to document with autodoc) are in another directory,
19-
# add these directories to sys.path here. If the directory is relative to the
20-
# documentation root, use os.path.abspath to make it absolute, like shown here.
21-
#sys.path.insert(0, os.path.abspath('.'))
22-
23-
sys.path.append(os.path.abspath('tools'))
24-
25-
# -- General configuration -----------------------------------------------------
26-
27-
# If your documentation needs a minimal Sphinx version, state it here.
28-
#needs_sphinx = '1.0'
29-
30-
# Add any Sphinx extension module names here, as strings. They can be extensions
31-
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
323
extensions = [
334
'sphinx.ext.intersphinx',
345
'sphinx.ext.todo',
356
'sphinx_copybutton',
367
'sphinxext.rediraffe',
378
]
38-
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
39-
todo_include_todos = True
40-
41-
# The suffix of source filenames.
42-
source_suffix = '.rst'
43-
44-
# The encoding of source files.
45-
#source_encoding = 'utf-8-sig'
469

4710
# The master toctree document.
4811
master_doc = 'index'
4912

5013
# General information about the project.
51-
project = 'Python Developer\'s Guide'
52-
copyright = '2011-%s, Python Software Foundation' % time.strftime('%Y')
53-
54-
# The version info for the project you're documenting, acts as replacement for
55-
# |version| and |release|, also used in various other places throughout the
56-
# built documents.
57-
#
58-
# The short X.Y version.
59-
version = ''
60-
# The full version, including alpha/beta/rc tags.
61-
release = ''
62-
63-
# The language for content autogenerated by Sphinx. Refer to documentation
64-
# for a list of supported languages.
65-
#language = None
66-
67-
# There are two options for replacing |today|: either, you set today to some
68-
# non-false value, then it is used:
69-
#today = ''
70-
# Else, today_fmt is used as the format for a strftime call.
71-
#today_fmt = '%B %d, %Y'
14+
project = "Python Developer's Guide"
15+
copyright = f'2011-{time.strftime("%Y")}, Python Software Foundation'
7216

7317
# List of patterns, relative to source directory, that match files and
7418
# directories to ignore when looking for source files.
75-
exclude_patterns = ['_build', 'venv*', 'env*', 'README.rst', '.github']
76-
77-
# The reST default role (used for this markup: `text`) to use for all documents.
78-
#default_role = None
79-
80-
# If true, '()' will be appended to :func: etc. cross-reference text.
81-
#add_function_parentheses = True
82-
83-
# If true, the current module name will be prepended to all description
84-
# unit titles (such as .. function::).
85-
#add_module_names = True
86-
87-
# If true, sectionauthor and moduleauthor directives will be shown in the
88-
# output. They are ignored by default.
89-
#show_authors = False
90-
91-
# The name of the Pygments (syntax highlighting) style to use.
92-
pygments_style = 'sphinx'
93-
94-
# A list of ignored prefixes for module index sorting.
95-
#modindex_common_prefix = []
96-
97-
98-
# -- Options for HTML output ---------------------------------------------------
19+
exclude_patterns = [
20+
'_build',
21+
'venv*',
22+
'env*',
23+
'README.rst',
24+
'.github',
25+
]
9926

100-
# Use the upstream python-docs-theme
10127
html_theme = 'furo'
10228
html_theme_options = {}
103-
104-
105-
# The name for this set of Sphinx documents. If None, it defaults to
106-
# "<project> v<release> documentation".
107-
html_title = "%s %s" % (project, release)
108-
109-
# Path to find HTML templates.
110-
templates_path = ['tools/templates']
111-
112-
# Additional static files.
113-
html_static_path = ['tools/static']
114-
115-
# A shorter title for the navigation bar. Default is the same as html_title.
116-
#html_short_title = None
117-
118-
# The name of an image file (relative to this directory) to place at the top
119-
# of the sidebar.
120-
html_logo = "python-logo.png"
121-
122-
# The name of an image file (within the static path) to use as favicon of the
123-
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
124-
# pixels large.
125-
#html_favicon = None
126-
127-
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
128-
# using the given strftime format.
129-
html_last_updated_fmt = '%b %d, %Y'
130-
131-
# If true, SmartyPants will be used to convert quotes and dashes to
132-
# typographically correct entities.
133-
#html_use_smartypants = True
134-
135-
# Additional templates that should be rendered to pages, maps page names to
136-
# template names.
137-
#html_additional_pages = {}
138-
139-
# If false, no module index is generated.
140-
#html_domain_indices = True
141-
142-
# If false, no index is generated.
143-
#html_use_index = True
144-
145-
# If true, the index is split into individual pages for each letter.
146-
#html_split_index = False
147-
148-
# If true, links to the reST sources are added to the pages.
149-
#html_show_sourcelink = True
150-
151-
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
152-
#html_show_sphinx = True
153-
154-
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
155-
#html_show_copyright = True
156-
157-
# If true, an OpenSearch description file will be output, and all pages will
158-
# contain a <link> tag referring to it. The value of this option must be the
159-
# base URL from which the finished HTML is served.
160-
#html_use_opensearch = ''
161-
162-
# This is the file name suffix for HTML files (e.g. ".xhtml").
163-
#html_file_suffix = None
164-
165-
# Output file base name for HTML help builder.
166-
htmlhelp_basename = 'PythonDevelopersGuidedoc'
167-
168-
169-
# -- Options for LaTeX output --------------------------------------------------
170-
171-
# The paper size ('letter' or 'a4').
172-
#latex_paper_size = 'letter'
173-
174-
# The font size ('10pt', '11pt' or '12pt').
175-
#latex_font_size = '10pt'
176-
177-
# Grouping the document tree into LaTeX files. List of tuples
178-
# (source start file, target name, title, author, documentclass [howto/manual]).
179-
latex_documents = [
180-
(
181-
'index',
182-
'PythonDevelopersGuide.tex',
183-
'Python Developer\'s Guide Documentation',
184-
'Brett Cannon',
185-
'manual',
186-
),
29+
html_static_path = ['_static']
30+
html_css_files = [
31+
'devguide_overrides.css',
18732
]
33+
html_logo = "_static/python-logo.svg"
18834

189-
# The name of an image file (relative to this directory) to place at the top of
190-
# the title page.
191-
#latex_logo = None
192-
193-
# For "manual" documents, if this is true, then toplevel headings are parts,
194-
# not chapters.
195-
#latex_use_parts = False
196-
197-
# If true, show page references after internal links.
198-
#latex_show_pagerefs = False
199-
200-
# If true, show URL addresses after external links.
201-
#latex_show_urls = False
202-
203-
# Additional stuff for the LaTeX preamble.
204-
#latex_preamble = ''
205-
206-
# Documents to append as an appendix to all manuals.
207-
#latex_appendices = []
208-
209-
# If false, no module index is generated.
210-
#latex_domain_indices = True
211-
212-
213-
# -- Options for manual page output --------------------------------------------
214-
215-
# One entry per manual page. List of tuples
216-
# (source start file, name, description, authors, manual section).
217-
man_pages = [
218-
(
219-
'index',
220-
'pythondevelopersguide',
221-
"Python Developer's Guide Documentation",
222-
['Brett Cannon'],
223-
1,
224-
),
225-
]
35+
# Set to '' to prevent appending "documentation" to the site title
36+
html_title = ""
22637

22738
# ignore linkcheck anchors for /#/$ANCHOR since it is used for
22839
# dynamic pages such as http://buildbot.python.org/all/#/console
@@ -281,9 +92,8 @@
28192
'https://discuss.python.org/groups/admins',
28293
]
28394

95+
intersphinx_mapping = {
96+
'python': ('https://docs.python.org/3', None),
97+
}
28498

285-
286-
# Use our custom CSS stylesheet to differentiate us from the official python
287-
# docs.
288-
def setup(app):
289-
app.add_css_file('custom.css')
99+
todo_include_todos = True

make.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if "%1" == "help" (
4949
echo. changes to make an overview over all changed/added/deprecated items
5050
echo. linkcheck to check all external links for integrity
5151
echo. doctest to run all doctests embedded in the documentation if enabled
52-
echo. check to check for stylistic and formal issues using rstlint
52+
echo. check to check for stylistic and formal issues using sphinx-lint
5353
goto end
5454
)
5555

python-logo.png

-9.72 KB
Binary file not shown.

0 commit comments

Comments
 (0)