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,45 +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
8790intersphinx_mapping = {
88- "python" : (' https://docs.python.org/3' , None ),
89- "outcome" : (' https://outcome.readthedocs.io/en/latest/' , None ),
90- "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 ),
9194}
9295
9396autodoc_member_order = "bysource"
9497
9598# Add any paths that contain templates here, relative to this directory.
96- templates_path = [' _templates' ]
99+ templates_path = [" _templates" ]
97100
98101# The suffix(es) of source filenames.
99102# You can specify multiple suffix as a list of string:
100103#
101104# source_suffix = ['.rst', '.md']
102- source_suffix = ' .rst'
105+ source_suffix = " .rst"
103106
104107# The master toctree document.
105- master_doc = ' index'
108+ master_doc = " index"
106109
107110# General information about the project.
108- project = ' Trio'
109- copyright = ' 2017, Nathaniel J. Smith'
110- author = ' Nathaniel J. Smith'
111+ project = " Trio"
112+ copyright = " 2017, Nathaniel J. Smith"
113+ author = " Nathaniel J. Smith"
111114
112115# The version info for the project you're documenting, acts as replacement for
113116# |version| and |release|, also used in various other places throughout the
114117# built documents.
115118#
116119# The short X.Y version.
117120import trio
121+
118122version = trio .__version__
119123# The full version, including alpha/beta/rc tags.
120124release = version
@@ -136,9 +140,9 @@ def setup(app):
136140exclude_patterns = []
137141
138142# The name of the Pygments (syntax highlighting) style to use.
139- pygments_style = ' default'
143+ pygments_style = " default"
140144
141- highlight_language = ' python3'
145+ highlight_language = " python3"
142146
143147# If true, `todo` and `todoList` produce output, else they produce nothing.
144148todo_include_todos = False
@@ -153,13 +157,14 @@ def setup(app):
153157# The theme to use for HTML and HTML Help pages. See the documentation for
154158# a list of builtin themes.
155159#
156- #html_theme = 'alabaster'
160+ # html_theme = 'alabaster'
157161
158162# We have to set this ourselves, not only because it's useful for local
159163# testing, but also because if we don't then RTD will throw away our
160164# html_theme_options.
161165import sphinx_rtd_theme
162- html_theme = 'sphinx_rtd_theme'
166+
167+ html_theme = "sphinx_rtd_theme"
163168html_theme_path = [sphinx_rtd_theme .get_html_theme_path ()]
164169
165170# Theme options are theme-specific and customize the look and feel of a theme
@@ -174,19 +179,19 @@ def setup(app):
174179 # versions/settings...
175180 "navigation_depth" : 4 ,
176181 "logo_only" : True ,
177- ' prev_next_buttons_location' : ' both'
182+ " prev_next_buttons_location" : " both" ,
178183}
179184
180185# Add any paths that contain custom static files (such as style sheets) here,
181186# relative to this directory. They are copied after the builtin static files,
182187# so a file named "default.css" will overwrite the builtin "default.css".
183- html_static_path = [' _static' ]
188+ html_static_path = [" _static" ]
184189
185190
186191# -- Options for HTMLHelp output ------------------------------------------
187192
188193# Output file base name for HTML help builder.
189- htmlhelp_basename = ' Triodoc'
194+ htmlhelp_basename = " Triodoc"
190195
191196
192197# -- Options for LaTeX output ---------------------------------------------
@@ -195,15 +200,12 @@ def setup(app):
195200 # The paper size ('letterpaper' or 'a4paper').
196201 #
197202 # 'papersize': 'letterpaper',
198-
199203 # The font size ('10pt', '11pt' or '12pt').
200204 #
201205 # 'pointsize': '10pt',
202-
203206 # Additional stuff for the LaTeX preamble.
204207 #
205208 # 'preamble': '',
206-
207209 # Latex figure (float) alignment
208210 #
209211 # 'figure_align': 'htbp',
@@ -213,19 +215,15 @@ def setup(app):
213215# (source start file, target name, title,
214216# author, documentclass [howto, manual, or own class]).
215217latex_documents = [
216- (master_doc , 'Trio.tex' , 'Trio Documentation' ,
217- 'Nathaniel J. Smith' , 'manual' ),
218+ (master_doc , "Trio.tex" , "Trio Documentation" , "Nathaniel J. Smith" , "manual" ),
218219]
219220
220221
221222# -- Options for manual page output ---------------------------------------
222223
223224# One entry per manual page. List of tuples
224225# (source start file, name, description, authors, manual section).
225- man_pages = [
226- (master_doc , 'trio' , 'Trio Documentation' ,
227- [author ], 1 )
228- ]
226+ man_pages = [(master_doc , "trio" , "Trio Documentation" , [author ], 1 )]
229227
230228
231229# -- Options for Texinfo output -------------------------------------------
@@ -234,7 +232,13 @@ def setup(app):
234232# (source start file, target name, title, author,
235233# dir menu entry, description, category)
236234texinfo_documents = [
237- (master_doc , 'Trio' , 'Trio Documentation' ,
238- author , 'Trio' , 'One line description of project.' ,
239- 'Miscellaneous' ),
235+ (
236+ master_doc ,
237+ "Trio" ,
238+ "Trio Documentation" ,
239+ author ,
240+ "Trio" ,
241+ "One line description of project." ,
242+ "Miscellaneous" ,
243+ ),
240244]
0 commit comments