Wenzel Jakob | 28f98aa | 2015-10-13 02:57:16 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
| 2 | # -*- coding: utf-8 -*- |
| 3 | # |
| 4 | # pybind11 documentation build configuration file, created by |
| 5 | # sphinx-quickstart on Sun Oct 11 19:23:48 2015. |
| 6 | # |
| 7 | # This file is execfile()d with the current directory set to its |
| 8 | # containing dir. |
| 9 | # |
| 10 | # Note that not all possible configuration values are present in this |
| 11 | # autogenerated file. |
| 12 | # |
| 13 | # All configuration values have a default; values that are commented out |
| 14 | # serve to show the default. |
| 15 | |
| 16 | import sys |
| 17 | import os |
| 18 | import shlex |
Dean Moldovan | 57a9bbc | 2017-01-31 16:54:08 +0100 | [diff] [blame] | 19 | import subprocess |
Wenzel Jakob | 28f98aa | 2015-10-13 02:57:16 +0200 | [diff] [blame] | 20 | |
| 21 | # If extensions (or modules to document with autodoc) are in another directory, |
| 22 | # add these directories to sys.path here. If the directory is relative to the |
| 23 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
| 24 | #sys.path.insert(0, os.path.abspath('.')) |
| 25 | |
| 26 | # -- General configuration ------------------------------------------------ |
| 27 | |
| 28 | # If your documentation needs a minimal Sphinx version, state it here. |
| 29 | #needs_sphinx = '1.0' |
| 30 | |
| 31 | # Add any Sphinx extension module names here, as strings. They can be |
| 32 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 33 | # ones. |
Dean Moldovan | 57a9bbc | 2017-01-31 16:54:08 +0100 | [diff] [blame] | 34 | extensions = ['breathe'] |
| 35 | |
| 36 | breathe_projects = {'pybind11': '.build/doxygenxml/'} |
| 37 | breathe_default_project = 'pybind11' |
| 38 | breathe_domain_by_extension = {'h': 'cpp'} |
Wenzel Jakob | 28f98aa | 2015-10-13 02:57:16 +0200 | [diff] [blame] | 39 | |
| 40 | # Add any paths that contain templates here, relative to this directory. |
| 41 | templates_path = ['.templates'] |
| 42 | |
| 43 | # The suffix(es) of source filenames. |
| 44 | # You can specify multiple suffix as a list of string: |
| 45 | # source_suffix = ['.rst', '.md'] |
| 46 | source_suffix = '.rst' |
| 47 | |
| 48 | # The encoding of source files. |
| 49 | #source_encoding = 'utf-8-sig' |
| 50 | |
| 51 | # The master toctree document. |
| 52 | master_doc = 'index' |
| 53 | |
| 54 | # General information about the project. |
| 55 | project = 'pybind11' |
Wenzel Jakob | d405b1b | 2017-03-22 22:20:07 +0100 | [diff] [blame^] | 56 | copyright = '2017, Wenzel Jakob' |
Wenzel Jakob | 28f98aa | 2015-10-13 02:57:16 +0200 | [diff] [blame] | 57 | author = 'Wenzel Jakob' |
| 58 | |
| 59 | # The version info for the project you're documenting, acts as replacement for |
| 60 | # |version| and |release|, also used in various other places throughout the |
| 61 | # built documents. |
| 62 | # |
| 63 | # The short X.Y version. |
Wenzel Jakob | d405b1b | 2017-03-22 22:20:07 +0100 | [diff] [blame^] | 64 | version = '2.2' |
Wenzel Jakob | 28f98aa | 2015-10-13 02:57:16 +0200 | [diff] [blame] | 65 | # The full version, including alpha/beta/rc tags. |
Wenzel Jakob | d405b1b | 2017-03-22 22:20:07 +0100 | [diff] [blame^] | 66 | release = '2.2.dev0' |
Wenzel Jakob | 28f98aa | 2015-10-13 02:57:16 +0200 | [diff] [blame] | 67 | |
| 68 | # The language for content autogenerated by Sphinx. Refer to documentation |
| 69 | # for a list of supported languages. |
| 70 | # |
| 71 | # This is also used if you do content translation via gettext catalogs. |
| 72 | # Usually you set "language" from the command line for these cases. |
| 73 | language = None |
| 74 | |
| 75 | # There are two options for replacing |today|: either, you set today to some |
| 76 | # non-false value, then it is used: |
| 77 | #today = '' |
| 78 | # Else, today_fmt is used as the format for a strftime call. |
| 79 | #today_fmt = '%B %d, %Y' |
| 80 | |
| 81 | # List of patterns, relative to source directory, that match files and |
| 82 | # directories to ignore when looking for source files. |
Dean Moldovan | aebca12 | 2016-08-16 01:26:02 +0200 | [diff] [blame] | 83 | exclude_patterns = ['.build', 'release.rst'] |
Wenzel Jakob | 28f98aa | 2015-10-13 02:57:16 +0200 | [diff] [blame] | 84 | |
| 85 | # The reST default role (used for this markup: `text`) to use for all |
| 86 | # documents. |
Dean Moldovan | 57a9bbc | 2017-01-31 16:54:08 +0100 | [diff] [blame] | 87 | default_role = 'any' |
Wenzel Jakob | 28f98aa | 2015-10-13 02:57:16 +0200 | [diff] [blame] | 88 | |
| 89 | # If true, '()' will be appended to :func: etc. cross-reference text. |
| 90 | #add_function_parentheses = True |
| 91 | |
| 92 | # If true, the current module name will be prepended to all description |
| 93 | # unit titles (such as .. function::). |
| 94 | #add_module_names = True |
| 95 | |
| 96 | # If true, sectionauthor and moduleauthor directives will be shown in the |
| 97 | # output. They are ignored by default. |
| 98 | #show_authors = False |
| 99 | |
| 100 | # The name of the Pygments (syntax highlighting) style to use. |
| 101 | #pygments_style = 'monokai' |
| 102 | |
| 103 | # A list of ignored prefixes for module index sorting. |
| 104 | #modindex_common_prefix = [] |
| 105 | |
| 106 | # If true, keep warnings as "system message" paragraphs in the built documents. |
| 107 | #keep_warnings = False |
| 108 | |
| 109 | # If true, `todo` and `todoList` produce output, else they produce nothing. |
| 110 | todo_include_todos = False |
| 111 | |
| 112 | |
| 113 | # -- Options for HTML output ---------------------------------------------- |
| 114 | |
| 115 | # The theme to use for HTML and HTML Help pages. See the documentation for |
| 116 | # a list of builtin themes. |
| 117 | |
| 118 | on_rtd = os.environ.get('READTHEDOCS', None) == 'True' |
| 119 | |
| 120 | if not on_rtd: # only import and set the theme if we're building docs locally |
| 121 | import sphinx_rtd_theme |
| 122 | html_theme = 'sphinx_rtd_theme' |
| 123 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] |
Wenzel Jakob | bda3b67 | 2015-12-07 18:25:38 +0100 | [diff] [blame] | 124 | |
Wenzel Jakob | 9329669 | 2015-10-13 23:21:54 +0200 | [diff] [blame] | 125 | html_context = { |
| 126 | 'css_files': [ |
Wenzel Jakob | bda3b67 | 2015-12-07 18:25:38 +0100 | [diff] [blame] | 127 | '_static/theme_overrides.css' |
Wenzel Jakob | 9329669 | 2015-10-13 23:21:54 +0200 | [diff] [blame] | 128 | ] |
| 129 | } |
Wenzel Jakob | bda3b67 | 2015-12-07 18:25:38 +0100 | [diff] [blame] | 130 | else: |
| 131 | html_context = { |
| 132 | 'css_files': [ |
| 133 | '//media.readthedocs.org/css/sphinx_rtd_theme.css', |
| 134 | '//media.readthedocs.org/css/readthedocs-doc-embed.css', |
| 135 | '_static/theme_overrides.css' |
| 136 | ] |
| 137 | } |
Wenzel Jakob | 28f98aa | 2015-10-13 02:57:16 +0200 | [diff] [blame] | 138 | |
| 139 | # Theme options are theme-specific and customize the look and feel of a theme |
| 140 | # further. For a list of options available for each theme, see the |
| 141 | # documentation. |
| 142 | #html_theme_options = {} |
| 143 | |
| 144 | # Add any paths that contain custom themes here, relative to this directory. |
| 145 | #html_theme_path = [] |
| 146 | |
| 147 | # The name for this set of Sphinx documents. If None, it defaults to |
| 148 | # "<project> v<release> documentation". |
| 149 | #html_title = None |
| 150 | |
| 151 | # A shorter title for the navigation bar. Default is the same as html_title. |
| 152 | #html_short_title = None |
| 153 | |
| 154 | # The name of an image file (relative to this directory) to place at the top |
| 155 | # of the sidebar. |
| 156 | #html_logo = None |
| 157 | |
| 158 | # The name of an image file (within the static path) to use as favicon of the |
| 159 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
| 160 | # pixels large. |
| 161 | #html_favicon = None |
| 162 | |
| 163 | # Add any paths that contain custom static files (such as style sheets) here, |
| 164 | # relative to this directory. They are copied after the builtin static files, |
| 165 | # so a file named "default.css" will overwrite the builtin "default.css". |
Wenzel Jakob | e84f557 | 2016-04-26 23:19:19 +0200 | [diff] [blame] | 166 | html_static_path = ['_static'] |
Wenzel Jakob | 28f98aa | 2015-10-13 02:57:16 +0200 | [diff] [blame] | 167 | |
| 168 | # Add any extra paths that contain custom files (such as robots.txt or |
| 169 | # .htaccess) here, relative to this directory. These files are copied |
| 170 | # directly to the root of the documentation. |
| 171 | #html_extra_path = [] |
| 172 | |
| 173 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
| 174 | # using the given strftime format. |
| 175 | #html_last_updated_fmt = '%b %d, %Y' |
| 176 | |
| 177 | # If true, SmartyPants will be used to convert quotes and dashes to |
| 178 | # typographically correct entities. |
| 179 | #html_use_smartypants = True |
| 180 | |
| 181 | # Custom sidebar templates, maps document names to template names. |
| 182 | #html_sidebars = {} |
| 183 | |
| 184 | # Additional templates that should be rendered to pages, maps page names to |
| 185 | # template names. |
| 186 | #html_additional_pages = {} |
| 187 | |
| 188 | # If false, no module index is generated. |
| 189 | #html_domain_indices = True |
| 190 | |
| 191 | # If false, no index is generated. |
| 192 | #html_use_index = True |
| 193 | |
| 194 | # If true, the index is split into individual pages for each letter. |
| 195 | #html_split_index = False |
| 196 | |
| 197 | # If true, links to the reST sources are added to the pages. |
| 198 | #html_show_sourcelink = True |
| 199 | |
| 200 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. |
| 201 | #html_show_sphinx = True |
| 202 | |
| 203 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. |
| 204 | #html_show_copyright = True |
| 205 | |
| 206 | # If true, an OpenSearch description file will be output, and all pages will |
| 207 | # contain a <link> tag referring to it. The value of this option must be the |
| 208 | # base URL from which the finished HTML is served. |
| 209 | #html_use_opensearch = '' |
| 210 | |
| 211 | # This is the file name suffix for HTML files (e.g. ".xhtml"). |
| 212 | #html_file_suffix = None |
| 213 | |
| 214 | # Language to be used for generating the HTML full-text search index. |
| 215 | # Sphinx supports the following languages: |
| 216 | # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' |
| 217 | # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' |
| 218 | #html_search_language = 'en' |
| 219 | |
| 220 | # A dictionary with options for the search language support, empty by default. |
| 221 | # Now only 'ja' uses this config value |
| 222 | #html_search_options = {'type': 'default'} |
| 223 | |
| 224 | # The name of a javascript file (relative to the configuration directory) that |
| 225 | # implements a search results scorer. If empty, the default will be used. |
| 226 | #html_search_scorer = 'scorer.js' |
| 227 | |
| 228 | # Output file base name for HTML help builder. |
| 229 | htmlhelp_basename = 'pybind11doc' |
| 230 | |
| 231 | # -- Options for LaTeX output --------------------------------------------- |
| 232 | |
| 233 | latex_elements = { |
| 234 | # The paper size ('letterpaper' or 'a4paper'). |
| 235 | #'papersize': 'letterpaper', |
| 236 | |
| 237 | # The font size ('10pt', '11pt' or '12pt'). |
| 238 | #'pointsize': '10pt', |
| 239 | |
| 240 | # Additional stuff for the LaTeX preamble. |
Wenzel Jakob | f64feaf | 2016-04-28 14:33:45 +0200 | [diff] [blame] | 241 | 'preamble': '\DeclareUnicodeCharacter{00A0}{}', |
Wenzel Jakob | 28f98aa | 2015-10-13 02:57:16 +0200 | [diff] [blame] | 242 | |
| 243 | # Latex figure (float) alignment |
| 244 | #'figure_align': 'htbp', |
| 245 | } |
| 246 | |
| 247 | # Grouping the document tree into LaTeX files. List of tuples |
| 248 | # (source start file, target name, title, |
| 249 | # author, documentclass [howto, manual, or own class]). |
| 250 | latex_documents = [ |
| 251 | (master_doc, 'pybind11.tex', 'pybind11 Documentation', |
| 252 | 'Wenzel Jakob', 'manual'), |
| 253 | ] |
| 254 | |
| 255 | # The name of an image file (relative to this directory) to place at the top of |
| 256 | # the title page. |
Wenzel Jakob | f64feaf | 2016-04-28 14:33:45 +0200 | [diff] [blame] | 257 | # latex_logo = 'pybind11-logo.png' |
Wenzel Jakob | 28f98aa | 2015-10-13 02:57:16 +0200 | [diff] [blame] | 258 | |
| 259 | # For "manual" documents, if this is true, then toplevel headings are parts, |
| 260 | # not chapters. |
| 261 | #latex_use_parts = False |
| 262 | |
| 263 | # If true, show page references after internal links. |
| 264 | #latex_show_pagerefs = False |
| 265 | |
| 266 | # If true, show URL addresses after external links. |
| 267 | #latex_show_urls = False |
| 268 | |
| 269 | # Documents to append as an appendix to all manuals. |
| 270 | #latex_appendices = [] |
| 271 | |
| 272 | # If false, no module index is generated. |
| 273 | #latex_domain_indices = True |
| 274 | |
| 275 | |
| 276 | # -- Options for manual page output --------------------------------------- |
| 277 | |
| 278 | # One entry per manual page. List of tuples |
| 279 | # (source start file, name, description, authors, manual section). |
| 280 | man_pages = [ |
| 281 | (master_doc, 'pybind11', 'pybind11 Documentation', |
| 282 | [author], 1) |
| 283 | ] |
| 284 | |
| 285 | # If true, show URL addresses after external links. |
| 286 | #man_show_urls = False |
| 287 | |
| 288 | |
| 289 | # -- Options for Texinfo output ------------------------------------------- |
| 290 | |
| 291 | # Grouping the document tree into Texinfo files. List of tuples |
| 292 | # (source start file, target name, title, author, |
| 293 | # dir menu entry, description, category) |
| 294 | texinfo_documents = [ |
| 295 | (master_doc, 'pybind11', 'pybind11 Documentation', |
| 296 | author, 'pybind11', 'One line description of project.', |
| 297 | 'Miscellaneous'), |
| 298 | ] |
| 299 | |
| 300 | # Documents to append as an appendix to all manuals. |
| 301 | #texinfo_appendices = [] |
| 302 | |
| 303 | # If false, no module index is generated. |
| 304 | #texinfo_domain_indices = True |
| 305 | |
| 306 | # How to display URL addresses: 'footnote', 'no', or 'inline'. |
| 307 | #texinfo_show_urls = 'footnote' |
| 308 | |
| 309 | # If true, do not generate a @detailmenu in the "Top" node's menu. |
| 310 | #texinfo_no_detailmenu = False |
| 311 | |
| 312 | primary_domain = 'cpp' |
| 313 | highlight_language = 'cpp' |
Dean Moldovan | 57a9bbc | 2017-01-31 16:54:08 +0100 | [diff] [blame] | 314 | |
| 315 | |
| 316 | def generate_doxygen_xml(app): |
| 317 | build_dir = '.build' |
| 318 | if not os.path.exists(build_dir): |
| 319 | os.mkdir(build_dir) |
| 320 | |
| 321 | try: |
| 322 | subprocess.call(['doxygen', '--version']) |
| 323 | retcode = subprocess.call(['doxygen']) |
| 324 | if retcode < 0: |
| 325 | sys.stderr.write("doxygen error code: {}\n".format(-retcode)) |
| 326 | except OSError as e: |
| 327 | sys.stderr.write("doxygen execution failed: {}\n".format(e)) |
| 328 | |
| 329 | |
| 330 | def setup(app): |
| 331 | """Add hook for building doxygen xml when needed""" |
| 332 | app.connect("builder-inited", generate_doxygen_xml) |