blob: 8848ee65124a298b9fd83d878756e117031cf9a0 [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
Patrick Georgia73317e2019-12-10 20:27:38 +010028extensions = ['sphinxcontrib.ditaa']
29
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +020030# The language for content autogenerated by Sphinx. Refer to documentation
31# for a list of supported languages.
32#
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.
35language = None
36
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
40exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
41
42# The name of the Pygments (syntax highlighting) style to use.
43pygments_style = 'sphinx'
44
45# A list of ignored prefixes for module index sorting.
46# modindex_common_prefix = []
47
48# If true, keep warnings as "system message" paragraphs in the built documents.
49# keep_warnings = False
50
51# If true, `todo` and `todoList` produce output, else they produce nothing.
52todo_include_todos = False
53
54
55# -- Options for HTML output ----------------------------------------------
56
57# The theme to use for HTML and HTML Help pages. See the documentation for
58# a list of builtin themes.
59#
60html_theme = 'sphinx_rtd_theme'
61
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".
Patrick Rudolpha78e66e52018-05-13 16:06:51 +020065html_static_path = ['_static']
66
67html_context = {
68 'css_files': [
69 '_static/theme_overrides.css', # override wide tables in RTD theme
70 ],
71}
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +020072
73# Output file base name for HTML help builder.
74htmlhelp_basename = 'corebootdoc'
75
76# -- Options for LaTeX output ---------------------------------------------
77
78latex_elements = {
79 # The paper size ('letterpaper' or 'a4paper').
80 #
81 # 'papersize': 'letterpaper',
82
83 # The font size ('10pt', '11pt' or '12pt').
84 #
85 # 'pointsize': '10pt',
86
87 # Additional stuff for the LaTeX preamble.
88 #
89 # 'preamble': '',
90
91 # Latex figure (float) alignment
92 #
93 # 'figure_align': 'htbp',
94}
95
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]).
99latex_documents = [
100 (master_doc, 'coreboot.tex', u'coreboot Documentation',
101 u'the coreboot project', 'manual'),
102]
103
104# The name of an image file (relative to this directory) to place at the top of
105# the title page.
106#
107# latex_logo = None
108
109# For "manual" documents, if this is true, then toplevel headings are parts,
110# not chapters.
111#
112# latex_use_parts = False
113
114# If true, show page references after internal links.
115#
116# latex_show_pagerefs = False
117
118# If true, show URL addresses after external links.
119#
120# latex_show_urls = False
121
122# Documents to append as an appendix to all manuals.
123#
124# latex_appendices = []
125
Elyes HAOUAS89011be2018-05-29 08:31:10 +0200126# If false, will not define \strong, \code, itleref, \crossref ... but only
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +0200127# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
128# packages.
129#
130# latex_keep_old_macro_names = True
131
132# If false, no module index is generated.
133#
134# latex_domain_indices = True
135
136
137# -- Options for manual page output ---------------------------------------
138
139# One entry per manual page. List of tuples
140# (source start file, name, description, authors, manual section).
141man_pages = [
142 (master_doc, 'coreboot', u'coreboot Documentation',
143 [author], 1)
144]
145
146# If true, show URL addresses after external links.
147#
148# man_show_urls = False
149
150
151# -- Options for Texinfo output -------------------------------------------
152
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)
156texinfo_documents = [
157 (master_doc, 'coreboot', u'coreboot Documentation',
158 author, 'coreboot', 'One line description of project.',
159 'Miscellaneous'),
160]
161
Patrick Rudolph39315982018-10-22 10:52:40 +0200162enable_auto_toc_tree = True
163
164class 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)
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +0200170
171# Documents to append as an appendix to all manuals.
172#
173# texinfo_appendices = []
174
175# If false, no module index is generated.
176#
177# texinfo_domain_indices = True
178
179# How to display URL addresses: 'footnote', 'no', or 'inline'.
180#
181# texinfo_show_urls = 'footnote'
182
183# If true, do not generate a @detailmenu in the "Top" node's menu.
184#
185# texinfo_no_detailmenu = False
186
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +0200187
188def setup(app):
189 from recommonmark.transform import AutoStructify
Patrick Rudolph39315982018-10-22 10:52:40 +0200190 app.add_source_parser('.md', MyCommonMarkParser)
191
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +0200192 app.add_config_value('recommonmark_config', {
193 'enable_auto_toc_tree': True,
Tom Hillerffe6d542018-07-28 17:38:54 -0400194 'enable_auto_doc_ref': False, # broken in Sphinx 1.6+
Philipp Deppenwiese57df0882018-05-09 12:07:38 +0200195 'enable_eval_rst': True,
Jonathan Neuschäfer5e48c752018-04-19 16:23:56 +0200196 'url_resolver': lambda url: '/' + url
197 }, True)
198 app.add_transform(AutoStructify)