blob: 85df9ea51ed0006ed55a90d48a157700396a5daa [file] [log] [blame]
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +02001# -*- coding: utf-8 -*-
Patrick Georgi5ce40012018-06-06 17:03:21 +02002import subprocess
Patrick Rudolph39315982018-10-22 10:52:40 +02003from recommonmark.parser import CommonMarkParser
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +02004
5# Add any paths that contain templates here, relative to this directory.
6templates_path = ['_templates']
7
8# The suffix(es) of source filenames.
9source_suffix = ['.md']
10
11# The master toctree document.
12master_doc = 'index'
13
14# General information about the project.
15project = u'coreboot'
Patrick Rudolph93ffe832018-05-13 16:18:36 +020016copyright = u'CC-by 4.0 the coreboot project'
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +020017author = u'the coreboot project'
18
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.
22#
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +020023# The full version, including alpha/beta/rc tags.
Arthur Heymans5eb21152018-07-25 11:45:52 +020024release = subprocess.check_output(('git', 'describe')).decode("utf-8")
Patrick Georgi5ce40012018-06-06 17:03:21 +020025# The short X.Y version.
26version = release.split("-")[0]
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +020027
28# The language for content autogenerated by Sphinx. Refer to documentation
29# for a list of supported languages.
30#
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.
33language = None
34
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
38exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
39
40# The name of the Pygments (syntax highlighting) style to use.
41pygments_style = 'sphinx'
42
43# A list of ignored prefixes for module index sorting.
44# modindex_common_prefix = []
45
46# If true, keep warnings as "system message" paragraphs in the built documents.
47# keep_warnings = False
48
49# If true, `todo` and `todoList` produce output, else they produce nothing.
50todo_include_todos = False
51
52
53# -- Options for HTML output ----------------------------------------------
54
55# The theme to use for HTML and HTML Help pages. See the documentation for
56# a list of builtin themes.
57#
58html_theme = 'sphinx_rtd_theme'
59
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".
Patrick Rudolpha78e66e52018-05-13 16:06:51 +020063html_static_path = ['_static']
64
65html_context = {
66 'css_files': [
67 '_static/theme_overrides.css', # override wide tables in RTD theme
68 ],
69}
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +020070
71# Output file base name for HTML help builder.
72htmlhelp_basename = 'corebootdoc'
73
74# -- Options for LaTeX output ---------------------------------------------
75
76latex_elements = {
77 # The paper size ('letterpaper' or 'a4paper').
78 #
79 # 'papersize': 'letterpaper',
80
81 # The font size ('10pt', '11pt' or '12pt').
82 #
83 # 'pointsize': '10pt',
84
85 # Additional stuff for the LaTeX preamble.
86 #
87 # 'preamble': '',
88
89 # Latex figure (float) alignment
90 #
91 # 'figure_align': 'htbp',
92}
93
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]).
97latex_documents = [
98 (master_doc, 'coreboot.tex', u'coreboot Documentation',
99 u'the coreboot project', 'manual'),
100]
101
102# The name of an image file (relative to this directory) to place at the top of
103# the title page.
104#
105# latex_logo = None
106
107# For "manual" documents, if this is true, then toplevel headings are parts,
108# not chapters.
109#
110# latex_use_parts = False
111
112# If true, show page references after internal links.
113#
114# latex_show_pagerefs = False
115
116# If true, show URL addresses after external links.
117#
118# latex_show_urls = False
119
120# Documents to append as an appendix to all manuals.
121#
122# latex_appendices = []
123
Elyes HAOUAS89011be2018-05-29 08:31:10 +0200124# If false, will not define \strong, \code, itleref, \crossref ... but only
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +0200125# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
126# packages.
127#
128# latex_keep_old_macro_names = True
129
130# If false, no module index is generated.
131#
132# latex_domain_indices = True
133
134
135# -- Options for manual page output ---------------------------------------
136
137# One entry per manual page. List of tuples
138# (source start file, name, description, authors, manual section).
139man_pages = [
140 (master_doc, 'coreboot', u'coreboot Documentation',
141 [author], 1)
142]
143
144# If true, show URL addresses after external links.
145#
146# man_show_urls = False
147
148
149# -- Options for Texinfo output -------------------------------------------
150
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)
154texinfo_documents = [
155 (master_doc, 'coreboot', u'coreboot Documentation',
156 author, 'coreboot', 'One line description of project.',
157 'Miscellaneous'),
158]
159
Patrick Rudolph39315982018-10-22 10:52:40 +0200160enable_auto_toc_tree = True
161
162class 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)
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +0200168
169# Documents to append as an appendix to all manuals.
170#
171# texinfo_appendices = []
172
173# If false, no module index is generated.
174#
175# texinfo_domain_indices = True
176
177# How to display URL addresses: 'footnote', 'no', or 'inline'.
178#
179# texinfo_show_urls = 'footnote'
180
181# If true, do not generate a @detailmenu in the "Top" node's menu.
182#
183# texinfo_no_detailmenu = False
184
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +0200185
186def setup(app):
187 from recommonmark.transform import AutoStructify
Patrick Rudolph39315982018-10-22 10:52:40 +0200188 app.add_source_parser('.md', MyCommonMarkParser)
189
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +0200190 app.add_config_value('recommonmark_config', {
191 'enable_auto_toc_tree': True,
Tom Hillerffe6d542018-07-28 17:38:54 -0400192 'enable_auto_doc_ref': False, # broken in Sphinx 1.6+
Philipp Deppenwiese57df0882018-05-09 12:07:38 +0200193 'enable_eval_rst': True,
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +0200194 'url_resolver': lambda url: '/' + url
195 }, True)
196 app.add_transform(AutoStructify)