conf.py 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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. import sys, os
  15. import re
  16. from subprocess import call, Popen, PIPE
  17. import shlex
  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. from repo_util import run_cmd_get_output
  23. # Call Doxygen to get XML files from the header files
  24. print "Calling Doxygen to generate latest XML files"
  25. call('doxygen')
  26. # Generate 'api_name.inc' files using the XML files by Doxygen
  27. os.system("python gen-dxd.py")
  28. # Generate 'kconfig.inc' file from components' Kconfig files
  29. os.system("python gen-kconfig-doc.py > _build/inc/kconfig.inc")
  30. # http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format
  31. #
  32. suppress_warnings = ['image.nonlocal_uri']
  33. # -- General configuration ------------------------------------------------
  34. # If your documentation needs a minimal Sphinx version, state it here.
  35. #needs_sphinx = '1.0'
  36. # Add any Sphinx extension module names here, as strings. They can be
  37. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
  38. # ones.
  39. extensions = ['breathe',
  40. 'link-roles',
  41. 'sphinxcontrib.blockdiag',
  42. 'sphinxcontrib.seqdiag',
  43. 'sphinxcontrib.actdiag',
  44. 'sphinxcontrib.nwdiag',
  45. 'sphinxcontrib.rackdiag',
  46. 'sphinxcontrib.packetdiag'
  47. ]
  48. # Set up font for blockdiag, nwdiag, rackdiag and packetdiag
  49. blockdiag_fontpath = '_static/DejaVuSans.ttf'
  50. seqdiag_fontpath = '_static/DejaVuSans.ttf'
  51. actdiag_fontpath = '_static/DejaVuSans.ttf'
  52. nwdiag_fontpath = '_static/DejaVuSans.ttf'
  53. rackdiag_fontpath = '_static/DejaVuSans.ttf'
  54. packetdiag_fontpath = '_static/DejaVuSans.ttf'
  55. # Breathe extension variables
  56. breathe_projects = { "esp32-idf": "xml/" }
  57. breathe_default_project = "esp32-idf"
  58. # Add any paths that contain templates here, relative to this directory.
  59. templates_path = ['_templates']
  60. # The suffix of source filenames.
  61. source_suffix = ['.rst', '.md']
  62. source_parsers = {
  63. '.md': 'recommonmark.parser.CommonMarkParser',
  64. }
  65. # The encoding of source files.
  66. #source_encoding = 'utf-8-sig'
  67. # The master toctree document.
  68. master_doc = 'index'
  69. # General information about the project.
  70. project = u'ESP-IDF Programming Guide'
  71. copyright = u'2016 - 2017, Espressif'
  72. # The version info for the project you're documenting, acts as replacement for
  73. # |version| and |release|, also used in various other places throughout the
  74. # built documents.
  75. #
  76. # Readthedocs largely ignores 'version' and 'release', and displays one of
  77. # 'latest', tag name, or branch name, depending on the build type.
  78. # Still, this is useful for non-RTD builds.
  79. # This is supposed to be "the short X.Y version", but it's the only version
  80. # visible when you open index.html.
  81. # Display full version to make things less confusing.
  82. version = run_cmd_get_output('git describe')
  83. # The full version, including alpha/beta/rc tags.
  84. # If needed, nearest tag is returned by 'git describe --abbrev=0'.
  85. release = version
  86. print 'Version: {0} Release: {1}'.format(version, release)
  87. # The language for content autogenerated by Sphinx. Refer to documentation
  88. # for a list of supported languages.
  89. #language = None
  90. # There are two options for replacing |today|: either, you set today to some
  91. # non-false value, then it is used:
  92. #today = ''
  93. # Else, today_fmt is used as the format for a strftime call.
  94. #today_fmt = '%B %d, %Y'
  95. # List of patterns, relative to source directory, that match files and
  96. # directories to ignore when looking for source files.
  97. exclude_patterns = ['_build','README.md']
  98. # The reST default role (used for this markup: `text`) to use for all
  99. # documents.
  100. #default_role = None
  101. # If true, '()' will be appended to :func: etc. cross-reference text.
  102. #add_function_parentheses = True
  103. # If true, the current module name will be prepended to all description
  104. # unit titles (such as .. function::).
  105. #add_module_names = True
  106. # If true, sectionauthor and moduleauthor directives will be shown in the
  107. # output. They are ignored by default.
  108. #show_authors = False
  109. # The name of the Pygments (syntax highlighting) style to use.
  110. pygments_style = 'sphinx'
  111. # A list of ignored prefixes for module index sorting.
  112. #modindex_common_prefix = []
  113. # If true, keep warnings as "system message" paragraphs in the built documents.
  114. #keep_warnings = False
  115. # -- Options for HTML output ----------------------------------------------
  116. # The theme to use for HTML and HTML Help pages. See the documentation for
  117. # a list of builtin themes.
  118. html_theme = 'default'
  119. # Theme options are theme-specific and customize the look and feel of a theme
  120. # further. For a list of options available for each theme, see the
  121. # documentation.
  122. #html_theme_options = {}
  123. # Add any paths that contain custom themes here, relative to this directory.
  124. #html_theme_path = []
  125. # The name for this set of Sphinx documents. If None, it defaults to
  126. # "<project> v<release> documentation".
  127. #html_title = None
  128. # A shorter title for the navigation bar. Default is the same as html_title.
  129. #html_short_title = None
  130. # The name of an image file (relative to this directory) to place at the top
  131. # of the sidebar.
  132. #html_logo = None
  133. # The name of an image file (within the static path) to use as favicon of the
  134. # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
  135. # pixels large.
  136. #html_favicon = None
  137. # Add any paths that contain custom static files (such as style sheets) here,
  138. # relative to this directory. They are copied after the builtin static files,
  139. # so a file named "default.css" will overwrite the builtin "default.css".
  140. html_static_path = ['_static']
  141. # Add any extra paths that contain custom files (such as robots.txt or
  142. # .htaccess) here, relative to this directory. These files are copied
  143. # directly to the root of the documentation.
  144. #html_extra_path = []
  145. # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
  146. # using the given strftime format.
  147. #html_last_updated_fmt = '%b %d, %Y'
  148. # If true, SmartyPants will be used to convert quotes and dashes to
  149. # typographically correct entities.
  150. #html_use_smartypants = True
  151. # Custom sidebar templates, maps document names to template names.
  152. #html_sidebars = {}
  153. # Additional templates that should be rendered to pages, maps page names to
  154. # template names.
  155. #html_additional_pages = {}
  156. # If false, no module index is generated.
  157. #html_domain_indices = True
  158. # If false, no index is generated.
  159. #html_use_index = True
  160. # If true, the index is split into individual pages for each letter.
  161. #html_split_index = False
  162. # If true, links to the reST sources are added to the pages.
  163. #html_show_sourcelink = True
  164. # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
  165. #html_show_sphinx = True
  166. # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
  167. #html_show_copyright = True
  168. # If true, an OpenSearch description file will be output, and all pages will
  169. # contain a <link> tag referring to it. The value of this option must be the
  170. # base URL from which the finished HTML is served.
  171. #html_use_opensearch = ''
  172. # This is the file name suffix for HTML files (e.g. ".xhtml").
  173. #html_file_suffix = None
  174. # Output file base name for HTML help builder.
  175. htmlhelp_basename = 'ReadtheDocsTemplatedoc'
  176. # -- Options for LaTeX output ---------------------------------------------
  177. latex_elements = {
  178. # The paper size ('letterpaper' or 'a4paper').
  179. #'papersize': 'letterpaper',
  180. # The font size ('10pt', '11pt' or '12pt').
  181. #'pointsize': '10pt',
  182. # Additional stuff for the LaTeX preamble.
  183. #'preamble': '',
  184. }
  185. # Grouping the document tree into LaTeX files. List of tuples
  186. # (source start file, target name, title,
  187. # author, documentclass [howto, manual, or own class]).
  188. latex_documents = [
  189. ('index', 'ReadtheDocsTemplate.tex', u'Read the Docs Template Documentation',
  190. u'Read the Docs', 'manual'),
  191. ]
  192. # The name of an image file (relative to this directory) to place at the top of
  193. # the title page.
  194. #latex_logo = None
  195. # For "manual" documents, if this is true, then toplevel headings are parts,
  196. # not chapters.
  197. #latex_use_parts = False
  198. # If true, show page references after internal links.
  199. #latex_show_pagerefs = False
  200. # If true, show URL addresses after external links.
  201. #latex_show_urls = False
  202. # Documents to append as an appendix to all manuals.
  203. #latex_appendices = []
  204. # If false, no module index is generated.
  205. #latex_domain_indices = True
  206. # -- Options for manual page output ---------------------------------------
  207. # One entry per manual page. List of tuples
  208. # (source start file, name, description, authors, manual section).
  209. man_pages = [
  210. ('index', 'readthedocstemplate', u'Read the Docs Template Documentation',
  211. [u'Read the Docs'], 1)
  212. ]
  213. # If true, show URL addresses after external links.
  214. #man_show_urls = False
  215. # -- Options for Texinfo output -------------------------------------------
  216. # Grouping the document tree into Texinfo files. List of tuples
  217. # (source start file, target name, title, author,
  218. # dir menu entry, description, category)
  219. texinfo_documents = [
  220. ('index', 'ReadtheDocsTemplate', u'Read the Docs Template Documentation',
  221. u'Read the Docs', 'ReadtheDocsTemplate', 'One line description of project.',
  222. 'Miscellaneous'),
  223. ]
  224. # Documents to append as an appendix to all manuals.
  225. #texinfo_appendices = []
  226. # If false, no module index is generated.
  227. #texinfo_domain_indices = True
  228. # How to display URL addresses: 'footnote', 'no', or 'inline'.
  229. #texinfo_show_urls = 'footnote'
  230. # If true, do not generate a @detailmenu in the "Top" node's menu.
  231. #texinfo_no_detailmenu = False
  232. # -- Use sphinx_rtd_theme for local builds --------------------------------
  233. # ref. https://github.com/snide/sphinx_rtd_theme#using-this-theme-locally-then-building-on-read-the-docs
  234. #
  235. # on_rtd is whether we are on readthedocs.org
  236. on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
  237. if not on_rtd: # only import and set the theme if we're building docs locally
  238. import sphinx_rtd_theme
  239. html_theme = 'sphinx_rtd_theme'
  240. html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
  241. # otherwise, readthedocs.org uses their theme by default, so no need to specify it