summaryrefslogtreecommitdiff
path: root/Documentation/conf.py
diff options
context:
space:
mode:
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>2018-04-19 16:23:56 +0200
committerPatrick Georgi <pgeorgi@google.com>2018-04-26 12:25:03 +0000
commit5e48c75fcad523fc6602cc2e23fe4a6324e87c5b (patch)
treef6abc4eb33b227a90d41bc6b6b5e97a2591405fd /Documentation/conf.py
parente361ac9fa89d6726418d0d2b2d3d6e1fa2773ceb (diff)
Documentation: Add support for building with Sphinx
This commit adds the necessary infrastructure to convert the Markdown files in the Documentation directory to HTML using Sphinx[1] and recommonmark[2]. I selected "sphinx_rtd_theme" as the theme, because it offers a useful navigation sidebar, and because it's already used for the Linux kernel[3]. Makefile.sphinx was auto-generated by sphinx-quickstart. conf.py was auto-generated and manually adjusted. [1]: http://www.sphinx-doc.org/en/stable/ [2]: https://recommonmark.readthedocs.io/en/latest/ [3]: https://www.kernel.org/doc/html/latest/index.html Change-Id: Ie4de96978e334c598cf5890775807d3e15c29c4d Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-on: https://review.coreboot.org/25787 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'Documentation/conf.py')
-rw-r--r--Documentation/conf.py182
1 files changed, 182 insertions, 0 deletions
diff --git a/Documentation/conf.py b/Documentation/conf.py
new file mode 100644
index 0000000000..e893772e80
--- /dev/null
+++ b/Documentation/conf.py
@@ -0,0 +1,182 @@
+# -*- coding: utf-8 -*-
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+source_suffix = ['.md']
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'coreboot'
+copyright = u'the coreboot project'
+author = u'the coreboot project'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = u'4.7'
+# The full version, including alpha/beta/rc tags.
+release = u'4.7' # TODO: use 'git describe'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This patterns also effect to html_static_path and html_extra_path
+exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+# modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+# keep_warnings = False
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = False
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+#
+html_theme = 'sphinx_rtd_theme'
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+#html_static_path = ['_static']
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'corebootdoc'
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+ # The paper size ('letterpaper' or 'a4paper').
+ #
+ # 'papersize': 'letterpaper',
+
+ # The font size ('10pt', '11pt' or '12pt').
+ #
+ # 'pointsize': '10pt',
+
+ # Additional stuff for the LaTeX preamble.
+ #
+ # 'preamble': '',
+
+ # Latex figure (float) alignment
+ #
+ # 'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, documentclass [howto, manual, or own class]).
+latex_documents = [
+ (master_doc, 'coreboot.tex', u'coreboot Documentation',
+ u'the coreboot project', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#
+# latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#
+# latex_use_parts = False
+
+# If true, show page references after internal links.
+#
+# latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#
+# latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#
+# latex_appendices = []
+
+# It false, will not define \strong, \code, itleref, \crossref ... but only
+# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
+# packages.
+#
+# latex_keep_old_macro_names = True
+
+# If false, no module index is generated.
+#
+# latex_domain_indices = True
+
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ (master_doc, 'coreboot', u'coreboot Documentation',
+ [author], 1)
+]
+
+# If true, show URL addresses after external links.
+#
+# man_show_urls = False
+
+
+# -- Options for Texinfo output -------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ (master_doc, 'coreboot', u'coreboot Documentation',
+ author, 'coreboot', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+source_parsers = {
+ '.md': 'recommonmark.parser.CommonMarkParser',
+}
+
+# Documents to append as an appendix to all manuals.
+#
+# texinfo_appendices = []
+
+# If false, no module index is generated.
+#
+# texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#
+# texinfo_show_urls = 'footnote'
+
+# If true, do not generate a @detailmenu in the "Top" node's menu.
+#
+# texinfo_no_detailmenu = False
+
+enable_auto_toc_tree = True
+
+
+def setup(app):
+ from recommonmark.transform import AutoStructify
+ app.add_config_value('recommonmark_config', {
+ 'enable_auto_toc_tree': True,
+ 'enable_auto_doc_ref': True,
+ 'url_resolver': lambda url: '/' + url
+ }, True)
+ app.add_transform(AutoStructify)