11#!/usr/bin/env python3
2- # -*- coding: utf-8 -*-
32#
43# Trio documentation build configuration file, created by
54# sphinx-quickstart on Sat Jan 21 19:11:14 2017.
1918#
2019import os
2120import sys
21+
2222# For our local_customization module
23- sys .path .insert (0 , os .path .abspath ('.' ))
23+ sys .path .insert (0 , os .path .abspath ("." ))
2424# For trio itself
25- sys .path .insert (0 , os .path .abspath (' ../..' ))
25+ sys .path .insert (0 , os .path .abspath (" ../.." ))
2626
2727# https://docs.readthedocs.io/en/stable/builds.html#build-environment
2828if "READTHEDOCS" in os .environ :
2929 import glob
30+
3031 if glob .glob ("../../newsfragments/*.*.rst" ):
3132 print ("-- Found newsfragments; running towncrier --" , flush = True )
3233 import subprocess
34+
3335 subprocess .run (
3436 ["towncrier" , "--yes" , "--date" , "not released yet" ],
3537 cwd = "../.." ,
6668def setup (app ):
6769 app .add_css_file ("hackrtd.css" )
6870
71+
6972# -- General configuration ------------------------------------------------
7073
7174# If your documentation needs a minimal Sphinx version, state it here.
@@ -76,46 +79,46 @@ def setup(app):
7679# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
7780# ones.
7881extensions = [
79- ' sphinx.ext.autodoc' ,
80- ' sphinx.ext.intersphinx' ,
81- ' sphinx.ext.coverage' ,
82- ' sphinx.ext.napoleon' ,
83- ' sphinxcontrib_trio' ,
84- ' local_customization' ,
82+ " sphinx.ext.autodoc" ,
83+ " sphinx.ext.intersphinx" ,
84+ " sphinx.ext.coverage" ,
85+ " sphinx.ext.napoleon" ,
86+ " sphinxcontrib_trio" ,
87+ " local_customization" ,
8588]
8689
87- # FIXME: change the "python" link back to /3 when Python 3.11 is released
8890intersphinx_mapping = {
89- "python" : (' https://docs.python.org/3.11' , None ),
90- "outcome" : (' https://outcome.readthedocs.io/en/latest/' , None ),
91- "pyopenssl" : (' https://www.pyopenssl.org/en/stable/' , None ),
91+ "python" : (" https://docs.python.org/3" , None ),
92+ "outcome" : (" https://outcome.readthedocs.io/en/latest/" , None ),
93+ "pyopenssl" : (" https://www.pyopenssl.org/en/stable/" , None ),
9294}
9395
9496autodoc_member_order = "bysource"
9597
9698# Add any paths that contain templates here, relative to this directory.
97- templates_path = [' _templates' ]
99+ templates_path = [" _templates" ]
98100
99101# The suffix(es) of source filenames.
100102# You can specify multiple suffix as a list of string:
101103#
102104# source_suffix = ['.rst', '.md']
103- source_suffix = ' .rst'
105+ source_suffix = " .rst"
104106
105107# The master toctree document.
106- master_doc = ' index'
108+ master_doc = " index"
107109
108110# General information about the project.
109- project = ' Trio'
110- copyright = ' 2017, Nathaniel J. Smith'
111- author = ' Nathaniel J. Smith'
111+ project = " Trio"
112+ copyright = " 2017, Nathaniel J. Smith"
113+ author = " Nathaniel J. Smith"
112114
113115# The version info for the project you're documenting, acts as replacement for
114116# |version| and |release|, also used in various other places throughout the
115117# built documents.
116118#
117119# The short X.Y version.
118120import trio
121+
119122version = trio .__version__
120123# The full version, including alpha/beta/rc tags.
121124release = version
@@ -137,9 +140,9 @@ def setup(app):
137140exclude_patterns = []
138141
139142# The name of the Pygments (syntax highlighting) style to use.
140- pygments_style = ' default'
143+ pygments_style = " default"
141144
142- highlight_language = ' python3'
145+ highlight_language = " python3"
143146
144147# If true, `todo` and `todoList` produce output, else they produce nothing.
145148todo_include_todos = False
@@ -154,13 +157,14 @@ def setup(app):
154157# The theme to use for HTML and HTML Help pages. See the documentation for
155158# a list of builtin themes.
156159#
157- #html_theme = 'alabaster'
160+ # html_theme = 'alabaster'
158161
159162# We have to set this ourselves, not only because it's useful for local
160163# testing, but also because if we don't then RTD will throw away our
161164# html_theme_options.
162165import sphinx_rtd_theme
163- html_theme = 'sphinx_rtd_theme'
166+
167+ html_theme = "sphinx_rtd_theme"
164168html_theme_path = [sphinx_rtd_theme .get_html_theme_path ()]
165169
166170# Theme options are theme-specific and customize the look and feel of a theme
@@ -175,19 +179,19 @@ def setup(app):
175179 # versions/settings...
176180 "navigation_depth" : 4 ,
177181 "logo_only" : True ,
178- ' prev_next_buttons_location' : ' both'
182+ " prev_next_buttons_location" : " both" ,
179183}
180184
181185# Add any paths that contain custom static files (such as style sheets) here,
182186# relative to this directory. They are copied after the builtin static files,
183187# so a file named "default.css" will overwrite the builtin "default.css".
184- html_static_path = [' _static' ]
188+ html_static_path = [" _static" ]
185189
186190
187191# -- Options for HTMLHelp output ------------------------------------------
188192
189193# Output file base name for HTML help builder.
190- htmlhelp_basename = ' Triodoc'
194+ htmlhelp_basename = " Triodoc"
191195
192196
193197# -- Options for LaTeX output ---------------------------------------------
@@ -196,15 +200,12 @@ def setup(app):
196200 # The paper size ('letterpaper' or 'a4paper').
197201 #
198202 # 'papersize': 'letterpaper',
199-
200203 # The font size ('10pt', '11pt' or '12pt').
201204 #
202205 # 'pointsize': '10pt',
203-
204206 # Additional stuff for the LaTeX preamble.
205207 #
206208 # 'preamble': '',
207-
208209 # Latex figure (float) alignment
209210 #
210211 # 'figure_align': 'htbp',
@@ -214,19 +215,15 @@ def setup(app):
214215# (source start file, target name, title,
215216# author, documentclass [howto, manual, or own class]).
216217latex_documents = [
217- (master_doc , 'Trio.tex' , 'Trio Documentation' ,
218- 'Nathaniel J. Smith' , 'manual' ),
218+ (master_doc , "Trio.tex" , "Trio Documentation" , "Nathaniel J. Smith" , "manual" ),
219219]
220220
221221
222222# -- Options for manual page output ---------------------------------------
223223
224224# One entry per manual page. List of tuples
225225# (source start file, name, description, authors, manual section).
226- man_pages = [
227- (master_doc , 'trio' , 'Trio Documentation' ,
228- [author ], 1 )
229- ]
226+ man_pages = [(master_doc , "trio" , "Trio Documentation" , [author ], 1 )]
230227
231228
232229# -- Options for Texinfo output -------------------------------------------
@@ -235,7 +232,13 @@ def setup(app):
235232# (source start file, target name, title, author,
236233# dir menu entry, description, category)
237234texinfo_documents = [
238- (master_doc , 'Trio' , 'Trio Documentation' ,
239- author , 'Trio' , 'One line description of project.' ,
240- 'Miscellaneous' ),
235+ (
236+ master_doc ,
237+ "Trio" ,
238+ "Trio Documentation" ,
239+ author ,
240+ "Trio" ,
241+ "One line description of project." ,
242+ "Miscellaneous" ,
243+ ),
241244]
0 commit comments