]> granicus.if.org Git - esp-idf/blob - docs/conf.py
Add SPI Master driver, example, test and docs
[esp-idf] / docs / conf.py
1 # -*- coding: utf-8 -*-
2 #
3 # Read the Docs Template documentation build configuration file, created by
4 # sphinx-quickstart on Tue Aug 26 14:19:49 2014.
5 #
6 # This file is execfile()d with the current directory set to its
7 # containing dir.
8 #
9 # Note that not all possible configuration values are present in this
10 # autogenerated file.
11 #
12 # All configuration values have a default; values that are commented out
13 # serve to show the default.
14
15 import sys
16 import os
17
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 # -- Run DoxyGen to prepare XML for Sphinx---------------------------------
24 # ref. https://github.com/rtfd/readthedocs.org/issues/388
25
26 from subprocess import call, Popen, PIPE
27 import shlex
28
29 call('doxygen')
30
31 # -- Function to get output of a command ----------------------------------
32 def run_cmd_get_output(cmd):
33     process = Popen(shlex.split(cmd), stdout=PIPE)
34     (output, err) = process.communicate()
35     exit_code = process.wait()
36     if exit_code != 0:
37         raise RuntimeError('command line program has failed')
38     return output
39
40
41 # -- General configuration ------------------------------------------------
42
43 # If your documentation needs a minimal Sphinx version, state it here.
44 #needs_sphinx = '1.0'
45
46 # Add any Sphinx extension module names here, as strings. They can be
47 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
48 # ones.
49 extensions = ['breathe']
50
51 # Breathe extension variables
52 breathe_projects = { "esp32-idf": "xml/" }
53 breathe_default_project = "esp32-idf"
54
55 # Add any paths that contain templates here, relative to this directory.
56 templates_path = ['_templates']
57
58 # The suffix of source filenames.
59 source_suffix = '.rst'
60
61 # The encoding of source files.
62 #source_encoding = 'utf-8-sig'
63
64 # The master toctree document.
65 master_doc = 'index'
66
67 # General information about the project.
68 project = u'ESP32 Programming Guide'
69 copyright = u'2016, Espressif'
70
71 # The version info for the project you're documenting, acts as replacement for
72 # |version| and |release|, also used in various other places throughout the
73 # built documents.
74 #
75
76 # Different setup depending if script is running on ReadTheDocs or elsewhere
77 on_rtd = os.environ.get('READTHEDOCS') == 'True'
78 if on_rtd:
79     # The short X.Y version.
80     # Apparently ReadTheDocs is getting confused by other version / release 
81     # ReadTheDocs is building specific or the latest release from GitHub.
82     version = '1.0'
83     release = '1.0'
84 else:
85    # This is supposed to be "the short X.Y version", but it's the only version
86    # visible when you open index.html.
87    # Display full version to make things less confusing.
88    # If needed, nearest tag is returned by 'git describe --abbrev=0'.
89    version = run_cmd_get_output('git describe')
90    # The full version, including alpha/beta/rc tags.
91    release = run_cmd_get_output('git describe')
92
93 # The language for content autogenerated by Sphinx. Refer to documentation
94 # for a list of supported languages.
95 #language = None
96
97 # There are two options for replacing |today|: either, you set today to some
98 # non-false value, then it is used:
99 #today = ''
100 # Else, today_fmt is used as the format for a strftime call.
101 #today_fmt = '%B %d, %Y'
102
103 # List of patterns, relative to source directory, that match files and
104 # directories to ignore when looking for source files.
105 exclude_patterns = ['_build']
106
107 # The reST default role (used for this markup: `text`) to use for all
108 # documents.
109 #default_role = None
110
111 # If true, '()' will be appended to :func: etc. cross-reference text.
112 #add_function_parentheses = True
113
114 # If true, the current module name will be prepended to all description
115 # unit titles (such as .. function::).
116 #add_module_names = True
117
118 # If true, sectionauthor and moduleauthor directives will be shown in the
119 # output. They are ignored by default.
120 #show_authors = False
121
122 # The name of the Pygments (syntax highlighting) style to use.
123 pygments_style = 'sphinx'
124
125 # A list of ignored prefixes for module index sorting.
126 #modindex_common_prefix = []
127
128 # If true, keep warnings as "system message" paragraphs in the built documents.
129 #keep_warnings = False
130
131
132 # -- Options for HTML output ----------------------------------------------
133
134 # The theme to use for HTML and HTML Help pages.  See the documentation for
135 # a list of builtin themes.
136 html_theme = 'default'
137
138 # Theme options are theme-specific and customize the look and feel of a theme
139 # further.  For a list of options available for each theme, see the
140 # documentation.
141 #html_theme_options = {}
142
143 # Add any paths that contain custom themes here, relative to this directory.
144 #html_theme_path = []
145
146 # The name for this set of Sphinx documents.  If None, it defaults to
147 # "<project> v<release> documentation".
148 #html_title = None
149
150 # A shorter title for the navigation bar.  Default is the same as html_title.
151 #html_short_title = None
152
153 # The name of an image file (relative to this directory) to place at the top
154 # of the sidebar.
155 #html_logo = None
156
157 # The name of an image file (within the static path) to use as favicon of the
158 # docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
159 # pixels large.
160 #html_favicon = None
161
162 # Add any paths that contain custom static files (such as style sheets) here,
163 # relative to this directory. They are copied after the builtin static files,
164 # so a file named "default.css" will overwrite the builtin "default.css".
165 html_static_path = ['_static']
166
167 # Add any extra paths that contain custom files (such as robots.txt or
168 # .htaccess) here, relative to this directory. These files are copied
169 # directly to the root of the documentation.
170 #html_extra_path = []
171
172 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
173 # using the given strftime format.
174 #html_last_updated_fmt = '%b %d, %Y'
175
176 # If true, SmartyPants will be used to convert quotes and dashes to
177 # typographically correct entities.
178 #html_use_smartypants = True
179
180 # Custom sidebar templates, maps document names to template names.
181 #html_sidebars = {}
182
183 # Additional templates that should be rendered to pages, maps page names to
184 # template names.
185 #html_additional_pages = {}
186
187 # If false, no module index is generated.
188 #html_domain_indices = True
189
190 # If false, no index is generated.
191 #html_use_index = True
192
193 # If true, the index is split into individual pages for each letter.
194 #html_split_index = False
195
196 # If true, links to the reST sources are added to the pages.
197 #html_show_sourcelink = True
198
199 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
200 #html_show_sphinx = True
201
202 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
203 #html_show_copyright = True
204
205 # If true, an OpenSearch description file will be output, and all pages will
206 # contain a <link> tag referring to it.  The value of this option must be the
207 # base URL from which the finished HTML is served.
208 #html_use_opensearch = ''
209
210 # This is the file name suffix for HTML files (e.g. ".xhtml").
211 #html_file_suffix = None
212
213 # Output file base name for HTML help builder.
214 htmlhelp_basename = 'ReadtheDocsTemplatedoc'
215
216
217 # -- Options for LaTeX output ---------------------------------------------
218
219 latex_elements = {
220 # The paper size ('letterpaper' or 'a4paper').
221 #'papersize': 'letterpaper',
222
223 # The font size ('10pt', '11pt' or '12pt').
224 #'pointsize': '10pt',
225
226 # Additional stuff for the LaTeX preamble.
227 #'preamble': '',
228 }
229
230 # Grouping the document tree into LaTeX files. List of tuples
231 # (source start file, target name, title,
232 #  author, documentclass [howto, manual, or own class]).
233 latex_documents = [
234   ('index', 'ReadtheDocsTemplate.tex', u'Read the Docs Template Documentation',
235    u'Read the Docs', 'manual'),
236 ]
237
238 # The name of an image file (relative to this directory) to place at the top of
239 # the title page.
240 #latex_logo = None
241
242 # For "manual" documents, if this is true, then toplevel headings are parts,
243 # not chapters.
244 #latex_use_parts = False
245
246 # If true, show page references after internal links.
247 #latex_show_pagerefs = False
248
249 # If true, show URL addresses after external links.
250 #latex_show_urls = False
251
252 # Documents to append as an appendix to all manuals.
253 #latex_appendices = []
254
255 # If false, no module index is generated.
256 #latex_domain_indices = True
257
258
259 # -- Options for manual page output ---------------------------------------
260
261 # One entry per manual page. List of tuples
262 # (source start file, name, description, authors, manual section).
263 man_pages = [
264     ('index', 'readthedocstemplate', u'Read the Docs Template Documentation',
265      [u'Read the Docs'], 1)
266 ]
267
268 # If true, show URL addresses after external links.
269 #man_show_urls = False
270
271
272 # -- Options for Texinfo output -------------------------------------------
273
274 # Grouping the document tree into Texinfo files. List of tuples
275 # (source start file, target name, title, author,
276 #  dir menu entry, description, category)
277 texinfo_documents = [
278   ('index', 'ReadtheDocsTemplate', u'Read the Docs Template Documentation',
279    u'Read the Docs', 'ReadtheDocsTemplate', 'One line description of project.',
280    'Miscellaneous'),
281 ]
282
283 # Documents to append as an appendix to all manuals.
284 #texinfo_appendices = []
285
286 # If false, no module index is generated.
287 #texinfo_domain_indices = True
288
289 # How to display URL addresses: 'footnote', 'no', or 'inline'.
290 #texinfo_show_urls = 'footnote'
291
292 # If true, do not generate a @detailmenu in the "Top" node's menu.
293 #texinfo_no_detailmenu = False
294
295 # -- Use sphinx_rtd_theme for local builds --------------------------------
296 # ref. https://github.com/snide/sphinx_rtd_theme#using-this-theme-locally-then-building-on-read-the-docs
297 #
298 # on_rtd is whether we are on readthedocs.org
299 on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
300
301 if not on_rtd:  # only import and set the theme if we're building docs locally
302     import sphinx_rtd_theme
303     html_theme = 'sphinx_rtd_theme'
304     html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
305
306 # otherwise, readthedocs.org uses their theme by default, so no need to specify it