drivers/generic/gfx: Add null pointer error check
[coreboot.git] / Documentation / conf.py
blob8848ee65124a298b9fd83d878756e117031cf9a0
1 # -*- coding: utf-8 -*-
2 import subprocess
3 from recommonmark.parser import CommonMarkParser
5 # Add any paths that contain templates here, relative to this directory.
6 templates_path = ['_templates']
8 # The suffix(es) of source filenames.
9 source_suffix = ['.md']
11 # The master toctree document.
12 master_doc = 'index'
14 # General information about the project.
15 project = u'coreboot'
16 copyright = u'CC-by 4.0 the coreboot project'
17 author = u'the coreboot project'
19 # The version info for the project you're documenting, acts as replacement for
20 # |version| and |release|, also used in various other places throughout the
21 # built documents.
23 # The full version, including alpha/beta/rc tags.
24 release = subprocess.check_output(('git', 'describe')).decode("utf-8")
25 # The short X.Y version.
26 version = release.split("-")[0]
28 extensions = ['sphinxcontrib.ditaa']
30 # The language for content autogenerated by Sphinx. Refer to documentation
31 # for a list of supported languages.
33 # This is also used if you do content translation via gettext catalogs.
34 # Usually you set "language" from the command line for these cases.
35 language = None
37 # List of patterns, relative to source directory, that match files and
38 # directories to ignore when looking for source files.
39 # This patterns also effect to html_static_path and html_extra_path
40 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
42 # The name of the Pygments (syntax highlighting) style to use.
43 pygments_style = 'sphinx'
45 # A list of ignored prefixes for module index sorting.
46 # modindex_common_prefix = []
48 # If true, keep warnings as "system message" paragraphs in the built documents.
49 # keep_warnings = False
51 # If true, `todo` and `todoList` produce output, else they produce nothing.
52 todo_include_todos = False
55 # -- Options for HTML output ----------------------------------------------
57 # The theme to use for HTML and HTML Help pages. See the documentation for
58 # a list of builtin themes.
60 html_theme = 'sphinx_rtd_theme'
62 # Add any paths that contain custom static files (such as style sheets) here,
63 # relative to this directory. They are copied after the builtin static files,
64 # so a file named "default.css" will overwrite the builtin "default.css".
65 html_static_path = ['_static']
67 html_context = {
68 'css_files': [
69 '_static/theme_overrides.css', # override wide tables in RTD theme
73 # Output file base name for HTML help builder.
74 htmlhelp_basename = 'corebootdoc'
76 # -- Options for LaTeX output ---------------------------------------------
78 latex_elements = {
79 # The paper size ('letterpaper' or 'a4paper').
81 # 'papersize': 'letterpaper',
83 # The font size ('10pt', '11pt' or '12pt').
85 # 'pointsize': '10pt',
87 # Additional stuff for the LaTeX preamble.
89 # 'preamble': '',
91 # Latex figure (float) alignment
93 # 'figure_align': 'htbp',
96 # Grouping the document tree into LaTeX files. List of tuples
97 # (source start file, target name, title,
98 # author, documentclass [howto, manual, or own class]).
99 latex_documents = [
100 (master_doc, 'coreboot.tex', u'coreboot Documentation',
101 u'the coreboot project', 'manual'),
104 # The name of an image file (relative to this directory) to place at the top of
105 # the title page.
107 # latex_logo = None
109 # For "manual" documents, if this is true, then toplevel headings are parts,
110 # not chapters.
112 # latex_use_parts = False
114 # If true, show page references after internal links.
116 # latex_show_pagerefs = False
118 # If true, show URL addresses after external links.
120 # latex_show_urls = False
122 # Documents to append as an appendix to all manuals.
124 # latex_appendices = []
126 # If false, will not define \strong, \code, itleref, \crossref ... but only
127 # \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
128 # packages.
130 # latex_keep_old_macro_names = True
132 # If false, no module index is generated.
134 # latex_domain_indices = True
137 # -- Options for manual page output ---------------------------------------
139 # One entry per manual page. List of tuples
140 # (source start file, name, description, authors, manual section).
141 man_pages = [
142 (master_doc, 'coreboot', u'coreboot Documentation',
143 [author], 1)
146 # If true, show URL addresses after external links.
148 # man_show_urls = False
151 # -- Options for Texinfo output -------------------------------------------
153 # Grouping the document tree into Texinfo files. List of tuples
154 # (source start file, target name, title, author,
155 # dir menu entry, description, category)
156 texinfo_documents = [
157 (master_doc, 'coreboot', u'coreboot Documentation',
158 author, 'coreboot', 'One line description of project.',
159 'Miscellaneous'),
162 enable_auto_toc_tree = True
164 class MyCommonMarkParser(CommonMarkParser):
165 # remove this hack once upsteam RecommonMark supports inline code
166 def visit_code(self, mdnode):
167 from docutils import nodes
168 n = nodes.literal(mdnode.literal, mdnode.literal)
169 self.current_node.append(n)
171 # Documents to append as an appendix to all manuals.
173 # texinfo_appendices = []
175 # If false, no module index is generated.
177 # texinfo_domain_indices = True
179 # How to display URL addresses: 'footnote', 'no', or 'inline'.
181 # texinfo_show_urls = 'footnote'
183 # If true, do not generate a @detailmenu in the "Top" node's menu.
185 # texinfo_no_detailmenu = False
188 def setup(app):
189 from recommonmark.transform import AutoStructify
190 app.add_source_parser('.md', MyCommonMarkParser)
192 app.add_config_value('recommonmark_config', {
193 'enable_auto_toc_tree': True,
194 'enable_auto_doc_ref': False, # broken in Sphinx 1.6+
195 'enable_eval_rst': True,
196 'url_resolver': lambda url: '/' + url
197 }, True)
198 app.add_transform(AutoStructify)