|
2 | 2 |
|
3 | 3 | import os
|
4 | 4 | import sys
|
5 |
| -sys.path.insert(0, os.path.abspath('..')) |
| 5 | + |
| 6 | +sys.path.insert(0, os.path.abspath("..")) |
6 | 7 |
|
7 | 8 | # -- General configuration ------------------------------------------------
|
8 | 9 |
|
9 | 10 | # Add any Sphinx extension module names here, as strings. They can be
|
10 | 11 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
11 | 12 | # ones.
|
12 | 13 | extensions = [
|
13 |
| - 'sphinx.ext.autodoc', |
14 |
| - 'sphinx.ext.intersphinx', |
15 |
| - 'sphinx.ext.napoleon', |
16 |
| - 'sphinx.ext.todo', |
| 14 | + "sphinx.ext.autodoc", |
| 15 | + "sphinx.ext.intersphinx", |
| 16 | + "sphinx.ext.napoleon", |
| 17 | + "sphinx.ext.todo", |
17 | 18 | ]
|
18 | 19 |
|
19 | 20 | # TODO: Please Read!
|
|
23 | 24 | # autodoc_mock_imports = ["digitalio", "busio"]
|
24 | 25 |
|
25 | 26 |
|
26 |
| -intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None), |
27 |
| - {%- if cookiecutter.requires_bus_device in ["y", "yes"] -%} |
28 |
| - 'BusDevice': ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None), |
29 |
| - {%- endif -%} |
30 |
| - {%- if cookiecutter.requires_register in ["y", "yes"] -%} |
31 |
| - 'Register': ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None), |
32 |
| - {%- endif -%} |
33 |
| - 'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)} |
| 27 | +intersphinx_mapping = { |
| 28 | + "python": ("https://docs.python.org/3.4", None), |
| 29 | + {%- if cookiecutter.requires_bus_device in ["y", "yes"] -%} |
| 30 | + "BusDevice": ("https://circuitpython.readthedocs.io/projects/busdevice/en/latest/", None), |
| 31 | + {% endif %} |
| 32 | + {%- if cookiecutter.requires_register in ["y", "yes"] -%} |
| 33 | + "Register": ("https://circuitpython.readthedocs.io/projects/register/en/latest/", None), |
| 34 | + {%- endif %} |
| 35 | + "CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None), |
| 36 | +} |
34 | 37 |
|
35 | 38 | # Add any paths that contain templates here, relative to this directory.
|
36 |
| -templates_path = ['_templates'] |
| 39 | +templates_path = ["_templates"] |
37 | 40 |
|
38 |
| -source_suffix = '.rst' |
| 41 | +source_suffix = ".rst" |
39 | 42 |
|
40 | 43 | # The master toctree document.
|
41 |
| -master_doc = 'index' |
| 44 | +master_doc = "index" |
42 | 45 |
|
43 | 46 | # General information about the project.
|
44 |
| -project = u'{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }} {% endif %}{{ cookiecutter.library_name }} Library' |
45 |
| -copyright = u'{% now 'utc', '%Y' %} {{ cookiecutter.author }}' |
46 |
| -author = u'{{ cookiecutter.author }}' |
| 47 | +project = "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }} {% endif %}{{ cookiecutter.library_name }} Library" |
| 48 | +copyright = "{% now 'utc', '%Y' %} {{ cookiecutter.author }}" |
| 49 | +author = "{{ cookiecutter.author }}" |
47 | 50 |
|
48 | 51 | # The version info for the project you're documenting, acts as replacement for
|
49 | 52 | # |version| and |release|, also used in various other places throughout the
|
50 | 53 | # built documents.
|
51 | 54 | #
|
52 | 55 | # The short X.Y version.
|
53 |
| -version = u'1.0' |
| 56 | +version = "1.0" |
54 | 57 | # The full version, including alpha/beta/rc tags.
|
55 |
| -release = u'1.0' |
| 58 | +release = "1.0" |
56 | 59 |
|
57 | 60 | # The language for content autogenerated by Sphinx. Refer to documentation
|
58 | 61 | # for a list of supported languages.
|
|
64 | 67 | # List of patterns, relative to source directory, that match files and
|
65 | 68 | # directories to ignore when looking for source files.
|
66 | 69 | # This patterns also effect to html_static_path and html_extra_path
|
67 |
| -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md'] |
| 70 | +exclude_patterns = [ |
| 71 | + "_build", |
| 72 | + "Thumbs.db", |
| 73 | + ".DS_Store", |
| 74 | + ".env", |
| 75 | + "CODE_OF_CONDUCT.md", |
| 76 | +] |
68 | 77 |
|
69 | 78 | # The reST default role (used for this markup: `text`) to use for all
|
70 | 79 | # documents.
|
|
76 | 85 | add_function_parentheses = True
|
77 | 86 |
|
78 | 87 | # The name of the Pygments (syntax highlighting) style to use.
|
79 |
| -pygments_style = 'sphinx' |
| 88 | +pygments_style = "sphinx" |
80 | 89 |
|
81 | 90 | # If true, `todo` and `todoList` produce output, else they produce nothing.
|
82 | 91 | todo_include_todos = False
|
|
91 | 100 | # The theme to use for HTML and HTML Help pages. See the documentation for
|
92 | 101 | # a list of builtin themes.
|
93 | 102 | #
|
94 |
| -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' |
| 103 | +on_rtd = os.environ.get("READTHEDOCS", None) == "True" |
95 | 104 |
|
96 | 105 | if not on_rtd: # only import and set the theme if we're building docs locally
|
97 | 106 | try:
|
98 | 107 | import sphinx_rtd_theme
|
99 |
| - html_theme = 'sphinx_rtd_theme' |
100 |
| - html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.'] |
| 108 | + |
| 109 | + html_theme = "sphinx_rtd_theme" |
| 110 | + html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."] |
101 | 111 | except:
|
102 |
| - html_theme = 'default' |
103 |
| - html_theme_path = ['.'] |
| 112 | + html_theme = "default" |
| 113 | + html_theme_path = ["."] |
104 | 114 | else:
|
105 |
| - html_theme_path = ['.'] |
| 115 | + html_theme_path = ["."] |
106 | 116 |
|
107 | 117 | # Add any paths that contain custom static files (such as style sheets) here,
|
108 | 118 | # relative to this directory. They are copied after the builtin static files,
|
109 | 119 | # so a file named "default.css" will overwrite the builtin "default.css".
|
110 |
| -html_static_path = ['_static'] |
| 120 | +html_static_path = ["_static"] |
111 | 121 |
|
112 | 122 | # The name of an image file (relative to this directory) to use as a favicon of
|
113 | 123 | # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
114 | 124 | # pixels large.
|
115 | 125 | #
|
116 |
| -html_favicon = '_static/favicon.ico' |
| 126 | +html_favicon = "_static/favicon.ico" |
117 | 127 |
|
118 | 128 | # Output file base name for HTML help builder.
|
119 |
| -htmlhelp_basename = '{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %}{{ cookiecutter.library_name | capitalize }}Librarydoc' |
| 129 | +htmlhelp_basename = "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %}{{ cookiecutter.library_name | capitalize }}Librarydoc" |
120 | 130 |
|
121 | 131 | # -- Options for LaTeX output ---------------------------------------------
|
122 | 132 |
|
123 | 133 | latex_elements = {
|
124 |
| - # The paper size ('letterpaper' or 'a4paper'). |
125 |
| - # |
126 |
| - # 'papersize': 'letterpaper', |
127 |
| - |
128 |
| - # The font size ('10pt', '11pt' or '12pt'). |
129 |
| - # |
130 |
| - # 'pointsize': '10pt', |
131 |
| - |
132 |
| - # Additional stuff for the LaTeX preamble. |
133 |
| - # |
134 |
| - # 'preamble': '', |
135 |
| - |
136 |
| - # Latex figure (float) alignment |
137 |
| - # |
138 |
| - # 'figure_align': 'htbp', |
| 134 | + # The paper size ('letterpaper' or 'a4paper'). |
| 135 | + # 'papersize': 'letterpaper', |
| 136 | + # The font size ('10pt', '11pt' or '12pt'). |
| 137 | + # 'pointsize': '10pt', |
| 138 | + # Additional stuff for the LaTeX preamble. |
| 139 | + # 'preamble': '', |
| 140 | + # Latex figure (float) alignment |
| 141 | + # 'figure_align': 'htbp', |
139 | 142 | }
|
140 | 143 |
|
141 | 144 | # Grouping the document tree into LaTeX files. List of tuples
|
142 | 145 | # (source start file, target name, title,
|
143 | 146 | # author, documentclass [howto, manual, or own class]).
|
144 | 147 | latex_documents = [
|
145 |
| - (master_doc, '{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %}{{ cookiecutter.library_name }}Library.tex', u'{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %}{{ cookiecutter.library_name }} Library Documentation', |
146 |
| - author, 'manual'), |
| 148 | + ( |
| 149 | + master_doc, |
| 150 | + "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %}{{ cookiecutter.library_name }}Library.tex", |
| 151 | + "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %}{{ cookiecutter.library_name }} Library Documentation", |
| 152 | + author, |
| 153 | + "manual", |
| 154 | + ), |
147 | 155 | ]
|
148 | 156 |
|
149 | 157 | # -- Options for manual page output ---------------------------------------
|
150 | 158 |
|
151 | 159 | # One entry per manual page. List of tuples
|
152 | 160 | # (source start file, name, description, authors, manual section).
|
153 | 161 | man_pages = [
|
154 |
| - (master_doc, '{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %}{{ cookiecutter.library_name }}library', u'{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }} {% endif %}{{ cookiecutter.library_name }} Library Documentation', |
155 |
| - [author], 1) |
| 162 | + ( |
| 163 | + master_doc, |
| 164 | + "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %}{{ cookiecutter.library_name }}library", |
| 165 | + "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }} {% endif %}{{ cookiecutter.library_name }} Library Documentation", |
| 166 | + [author], |
| 167 | + 1, |
| 168 | + ), |
156 | 169 | ]
|
157 | 170 |
|
158 | 171 | # -- Options for Texinfo output -------------------------------------------
|
|
161 | 174 | # (source start file, target name, title, author,
|
162 | 175 | # dir menu entry, description, category)
|
163 | 176 | texinfo_documents = [
|
164 |
| - (master_doc, '{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %}{{ cookiecutter.library_name }}Library', u'{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %} {{ cookiecutter.library_name }} Library Documentation', |
165 |
| - author, '{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %}{{ cookiecutter.library_name }}Library', 'One line description of project.', |
166 |
| - 'Miscellaneous'), |
| 177 | + ( |
| 178 | + master_doc, |
| 179 | + "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %}{{ cookiecutter.library_name }}Library", |
| 180 | + "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %} {{ cookiecutter.library_name }} Library Documentation", |
| 181 | + author, |
| 182 | + "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}{% endif %}{{ cookiecutter.library_name }}Library", |
| 183 | + "One line description of project.", |
| 184 | + "Miscellaneous", |
| 185 | + ), |
167 | 186 | ]
|
0 commit comments