]>
Commit | Line | Data |
---|---|---|
5329da6a PM |
1 | # -*- coding: utf-8 -*- |
2 | # | |
3 | # QEMU documentation build configuration file, created by | |
4 | # sphinx-quickstart on Thu Jan 31 16:40:14 2019. | |
5 | # | |
f8cf7147 PM |
6 | # This config file can be used in one of two ways: |
7 | # (1) as a common config file which is included by the conf.py | |
8 | # for each of QEMU's manuals: in this case sphinx-build is run multiple | |
9 | # times, once per subdirectory. | |
10 | # (2) as a top level conf file which will result in building all | |
11 | # the manuals into a single document: in this case sphinx-build is | |
12 | # run once, on the top-level docs directory. | |
13 | # | |
14 | # QEMU's makefiles take option (1), which allows us to install | |
15 | # only the ones the user cares about (in particular we don't want | |
16 | # to ship the 'devel' manual to end-users). | |
17 | # Third-party sites such as readthedocs.org will take option (2). | |
18 | # | |
19 | # | |
5329da6a PM |
20 | # This file is execfile()d with the current directory set to its |
21 | # containing dir. | |
22 | # | |
23 | # Note that not all possible configuration values are present in this | |
24 | # autogenerated file. | |
25 | # | |
26 | # All configuration values have a default; values that are commented out | |
27 | # serve to show the default. | |
28 | ||
f8cf7147 PM |
29 | import os |
30 | import sys | |
758b617a | 31 | import sphinx |
e22684e3 | 32 | from sphinx.errors import ConfigError |
758b617a PM |
33 | |
34 | # Make Sphinx fail cleanly if using an old Python, rather than obscurely | |
35 | # failing because some code in one of our extensions doesn't work there. | |
e22684e3 PM |
36 | # In newer versions of Sphinx this will display nicely; in older versions |
37 | # Sphinx will also produce a Python backtrace but at least the information | |
38 | # gets printed... | |
758b617a | 39 | if sys.version_info < (3,5): |
e22684e3 | 40 | raise ConfigError( |
758b617a | 41 | "QEMU requires a Sphinx that uses Python 3.5 or better\n") |
f8cf7147 PM |
42 | |
43 | # The per-manual conf.py will set qemu_docdir for a single-manual build; | |
44 | # otherwise set it here if this is an entire-manual-set build. | |
45 | # This is always the absolute path of the docs/ directory in the source tree. | |
46 | try: | |
47 | qemu_docdir | |
48 | except NameError: | |
49 | qemu_docdir = os.path.abspath(".") | |
50 | ||
5329da6a PM |
51 | # If extensions (or modules to document with autodoc) are in another directory, |
52 | # add these directories to sys.path here. If the directory is relative to the | |
f8cf7147 | 53 | # documentation root, use an absolute path starting from qemu_docdir. |
5329da6a | 54 | # |
cd231e13 | 55 | sys.path.insert(0, os.path.join(qemu_docdir, "sphinx")) |
5329da6a PM |
56 | |
57 | ||
58 | # -- General configuration ------------------------------------------------ | |
59 | ||
60 | # If your documentation needs a minimal Sphinx version, state it here. | |
61 | # | |
4fad3864 PM |
62 | # 1.3 is where the 'alabaster' theme was shipped with Sphinx. |
63 | needs_sphinx = '1.3' | |
5329da6a PM |
64 | |
65 | # Add any Sphinx extension module names here, as strings. They can be | |
66 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | |
67 | # ones. | |
6803d6e9 | 68 | extensions = ['kerneldoc', 'qmp_lexer', 'hxtool'] |
5329da6a PM |
69 | |
70 | # Add any paths that contain templates here, relative to this directory. | |
71 | templates_path = ['_templates'] | |
72 | ||
73 | # The suffix(es) of source filenames. | |
74 | # You can specify multiple suffix as a list of string: | |
75 | # | |
76 | # source_suffix = ['.rst', '.md'] | |
77 | source_suffix = '.rst' | |
78 | ||
79 | # The master toctree document. | |
80 | master_doc = 'index' | |
81 | ||
82 | # General information about the project. | |
83 | project = u'QEMU' | |
9b26a610 | 84 | copyright = u'2020, The QEMU Project Developers' |
5329da6a PM |
85 | author = u'The QEMU Project Developers' |
86 | ||
87 | # The version info for the project you're documenting, acts as replacement for | |
88 | # |version| and |release|, also used in various other places throughout the | |
89 | # built documents. | |
6038f5fc PM |
90 | |
91 | # Extract this information from the VERSION file, for the benefit of | |
92 | # standalone Sphinx runs as used by readthedocs.org. Builds run from | |
93 | # the Makefile will pass version and release on the sphinx-build | |
94 | # command line, which override this. | |
95 | try: | |
96 | extracted_version = None | |
97 | with open(os.path.join(qemu_docdir, '../VERSION')) as f: | |
98 | extracted_version = f.readline().strip() | |
99 | except: | |
100 | pass | |
101 | finally: | |
102 | if extracted_version: | |
103 | version = release = extracted_version | |
104 | else: | |
105 | version = release = "unknown version" | |
5329da6a PM |
106 | |
107 | # The language for content autogenerated by Sphinx. Refer to documentation | |
108 | # for a list of supported languages. | |
109 | # | |
110 | # This is also used if you do content translation via gettext catalogs. | |
111 | # Usually you set "language" from the command line for these cases. | |
112 | language = None | |
113 | ||
114 | # List of patterns, relative to source directory, that match files and | |
115 | # directories to ignore when looking for source files. | |
116 | # This patterns also effect to html_static_path and html_extra_path | |
117 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | |
118 | ||
119 | # The name of the Pygments (syntax highlighting) style to use. | |
120 | pygments_style = 'sphinx' | |
121 | ||
122 | # If true, `todo` and `todoList` produce output, else they produce nothing. | |
123 | todo_include_todos = False | |
124 | ||
e250e867 PM |
125 | # Sphinx defaults to warning about use of :option: for options not defined |
126 | # with "option::" in the document being processed. Turn that off. | |
127 | suppress_warnings = ["ref.option"] | |
5329da6a | 128 | |
27a296fc PM |
129 | # The rst_epilog fragment is effectively included in every rST file. |
130 | # We use it to define substitutions based on build config that | |
131 | # can then be used in the documentation. The fallback if the | |
132 | # environment variable is not set is for the benefit of readthedocs | |
133 | # style document building; our Makefile always sets the variable. | |
134 | confdir = os.getenv('CONFDIR', "/etc/qemu") | |
135 | rst_epilog = ".. |CONFDIR| replace:: ``" + confdir + "``\n" | |
de1572ca PM |
136 | # We slurp in the defs.rst.inc and literally include it into rst_epilog, |
137 | # because Sphinx's include:: directive doesn't work with absolute paths | |
138 | # and there isn't any one single relative path that will work for all | |
139 | # documents and for both via-make and direct sphinx-build invocation. | |
140 | with open(os.path.join(qemu_docdir, 'defs.rst.inc')) as f: | |
141 | rst_epilog += f.read() | |
27a296fc | 142 | |
5329da6a PM |
143 | # -- Options for HTML output ---------------------------------------------- |
144 | ||
145 | # The theme to use for HTML and HTML Help pages. See the documentation for | |
146 | # a list of builtin themes. | |
147 | # | |
148 | html_theme = 'alabaster' | |
149 | ||
150 | # Theme options are theme-specific and customize the look and feel of a theme | |
151 | # further. For a list of options available for each theme, see the | |
152 | # documentation. | |
f8cf7147 PM |
153 | # We initialize this to empty here, so the per-manual conf.py can just |
154 | # add individual key/value entries. | |
155 | html_theme_options = { | |
156 | } | |
5329da6a PM |
157 | |
158 | # Add any paths that contain custom static files (such as style sheets) here, | |
159 | # relative to this directory. They are copied after the builtin static files, | |
160 | # so a file named "default.css" will overwrite the builtin "default.css". | |
07fd6563 PM |
161 | # QEMU doesn't yet have any static files, so comment this out so we don't |
162 | # get a warning about a missing directory. | |
163 | # If we do ever add this then it would probably be better to call the | |
164 | # subdirectory sphinx_static, as the Linux kernel does. | |
165 | # html_static_path = ['_static'] | |
5329da6a PM |
166 | |
167 | # Custom sidebar templates, must be a dictionary that maps document names | |
168 | # to template names. | |
169 | # | |
170 | # This is required for the alabaster theme | |
171 | # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars | |
172 | html_sidebars = { | |
173 | '**': [ | |
4fad3864 PM |
174 | 'about.html', |
175 | 'navigation.html', | |
5329da6a PM |
176 | 'searchbox.html', |
177 | ] | |
178 | } | |
179 | ||
479fb8a5 PM |
180 | # Don't copy the rST source files to the HTML output directory, |
181 | # and don't put links to the sources into the output HTML. | |
182 | html_copy_source = False | |
5329da6a PM |
183 | |
184 | # -- Options for HTMLHelp output ------------------------------------------ | |
185 | ||
186 | # Output file base name for HTML help builder. | |
187 | htmlhelp_basename = 'QEMUdoc' | |
188 | ||
189 | ||
190 | # -- Options for LaTeX output --------------------------------------------- | |
191 | ||
192 | latex_elements = { | |
193 | # The paper size ('letterpaper' or 'a4paper'). | |
194 | # | |
195 | # 'papersize': 'letterpaper', | |
196 | ||
197 | # The font size ('10pt', '11pt' or '12pt'). | |
198 | # | |
199 | # 'pointsize': '10pt', | |
200 | ||
201 | # Additional stuff for the LaTeX preamble. | |
202 | # | |
203 | # 'preamble': '', | |
204 | ||
205 | # Latex figure (float) alignment | |
206 | # | |
207 | # 'figure_align': 'htbp', | |
208 | } | |
209 | ||
210 | # Grouping the document tree into LaTeX files. List of tuples | |
211 | # (source start file, target name, title, | |
212 | # author, documentclass [howto, manual, or own class]). | |
213 | latex_documents = [ | |
214 | (master_doc, 'QEMU.tex', u'QEMU Documentation', | |
215 | u'The QEMU Project Developers', 'manual'), | |
216 | ] | |
217 | ||
218 | ||
219 | # -- Options for manual page output --------------------------------------- | |
27a296fc PM |
220 | # Individual manual/conf.py can override this to create man pages |
221 | man_pages = [] | |
5329da6a PM |
222 | |
223 | # -- Options for Texinfo output ------------------------------------------- | |
224 | ||
225 | # Grouping the document tree into Texinfo files. List of tuples | |
226 | # (source start file, target name, title, author, | |
227 | # dir menu entry, description, category) | |
228 | texinfo_documents = [ | |
229 | (master_doc, 'QEMU', u'QEMU Documentation', | |
230 | author, 'QEMU', 'One line description of project.', | |
231 | 'Miscellaneous'), | |
232 | ] | |
233 | ||
234 | ||
235 | ||
22b5ea75 PM |
236 | # We use paths starting from qemu_docdir here so that you can run |
237 | # sphinx-build from anywhere and the kerneldoc extension can still | |
238 | # find everything. | |
239 | kerneldoc_bin = os.path.join(qemu_docdir, '../scripts/kernel-doc') | |
240 | kerneldoc_srctree = os.path.join(qemu_docdir, '..') | |
6803d6e9 | 241 | hxtool_srctree = os.path.join(qemu_docdir, '..') |