device: Tidy up add_more_links()
[coreboot.git] / Documentation / conf.py
blob85df9ea51ed0006ed55a90d48a157700396a5daa
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 # The language for content autogenerated by Sphinx. Refer to documentation
29 # for a list of supported languages.
31 # This is also used if you do content translation via gettext catalogs.
32 # Usually you set "language" from the command line for these cases.
33 language = None
35 # List of patterns, relative to source directory, that match files and
36 # directories to ignore when looking for source files.
37 # This patterns also effect to html_static_path and html_extra_path
38 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
40 # The name of the Pygments (syntax highlighting) style to use.
41 pygments_style = 'sphinx'
43 # A list of ignored prefixes for module index sorting.
44 # modindex_common_prefix = []
46 # If true, keep warnings as "system message" paragraphs in the built documents.
47 # keep_warnings = False
49 # If true, `todo` and `todoList` produce output, else they produce nothing.
50 todo_include_todos = False
53 # -- Options for HTML output ----------------------------------------------
55 # The theme to use for HTML and HTML Help pages. See the documentation for
56 # a list of builtin themes.
58 html_theme = 'sphinx_rtd_theme'
60 # Add any paths that contain custom static files (such as style sheets) here,
61 # relative to this directory. They are copied after the builtin static files,
62 # so a file named "default.css" will overwrite the builtin "default.css".
63 html_static_path = ['_static']
65 html_context = {
66 'css_files': [
67 '_static/theme_overrides.css', # override wide tables in RTD theme
71 # Output file base name for HTML help builder.
72 htmlhelp_basename = 'corebootdoc'
74 # -- Options for LaTeX output ---------------------------------------------
76 latex_elements = {
77 # The paper size ('letterpaper' or 'a4paper').
79 # 'papersize': 'letterpaper',
81 # The font size ('10pt', '11pt' or '12pt').
83 # 'pointsize': '10pt',
85 # Additional stuff for the LaTeX preamble.
87 # 'preamble': '',
89 # Latex figure (float) alignment
91 # 'figure_align': 'htbp',
94 # Grouping the document tree into LaTeX files. List of tuples
95 # (source start file, target name, title,
96 # author, documentclass [howto, manual, or own class]).
97 latex_documents = [
98 (master_doc, 'coreboot.tex', u'coreboot Documentation',
99 u'the coreboot project', 'manual'),
102 # The name of an image file (relative to this directory) to place at the top of
103 # the title page.
105 # latex_logo = None
107 # For "manual" documents, if this is true, then toplevel headings are parts,
108 # not chapters.
110 # latex_use_parts = False
112 # If true, show page references after internal links.
114 # latex_show_pagerefs = False
116 # If true, show URL addresses after external links.
118 # latex_show_urls = False
120 # Documents to append as an appendix to all manuals.
122 # latex_appendices = []
124 # If false, will not define \strong, \code, itleref, \crossref ... but only
125 # \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
126 # packages.
128 # latex_keep_old_macro_names = True
130 # If false, no module index is generated.
132 # latex_domain_indices = True
135 # -- Options for manual page output ---------------------------------------
137 # One entry per manual page. List of tuples
138 # (source start file, name, description, authors, manual section).
139 man_pages = [
140 (master_doc, 'coreboot', u'coreboot Documentation',
141 [author], 1)
144 # If true, show URL addresses after external links.
146 # man_show_urls = False
149 # -- Options for Texinfo output -------------------------------------------
151 # Grouping the document tree into Texinfo files. List of tuples
152 # (source start file, target name, title, author,
153 # dir menu entry, description, category)
154 texinfo_documents = [
155 (master_doc, 'coreboot', u'coreboot Documentation',
156 author, 'coreboot', 'One line description of project.',
157 'Miscellaneous'),
160 enable_auto_toc_tree = True
162 class MyCommonMarkParser(CommonMarkParser):
163 # remove this hack once upsteam RecommonMark supports inline code
164 def visit_code(self, mdnode):
165 from docutils import nodes
166 n = nodes.literal(mdnode.literal, mdnode.literal)
167 self.current_node.append(n)
169 # Documents to append as an appendix to all manuals.
171 # texinfo_appendices = []
173 # If false, no module index is generated.
175 # texinfo_domain_indices = True
177 # How to display URL addresses: 'footnote', 'no', or 'inline'.
179 # texinfo_show_urls = 'footnote'
181 # If true, do not generate a @detailmenu in the "Top" node's menu.
183 # texinfo_no_detailmenu = False
186 def setup(app):
187 from recommonmark.transform import AutoStructify
188 app.add_source_parser('.md', MyCommonMarkParser)
190 app.add_config_value('recommonmark_config', {
191 'enable_auto_toc_tree': True,
192 'enable_auto_doc_ref': False, # broken in Sphinx 1.6+
193 'enable_eval_rst': True,
194 'url_resolver': lambda url: '/' + url
195 }, True)
196 app.add_transform(AutoStructify)