1# -*- coding: utf-8 -*-
2# SPDX-License-Identifier: CC-BY-4.0
3#
4# Configuration file for the Sphinx documentation builder.
5#
6# For the full list of built-in configuration values, see the documentation:
7# https://www.sphinx-doc.org/en/master/usage/configuration.html
8
9import sys
10
11# -- Path setup --------------------------------------------------------------
12
13# If extensions (or modules to document with autodoc) are in another directory,
14# add these directories to sys.path here. If the directory is relative to the
15# documentation root, use os.path.abspath to make it absolute, like shown here.
16#
17# import os
18# sys.path.insert(0, os.path.abspath('.'))
19
20
21# -- Project information -----------------------------------------------------
22# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
23
24import sphinx
25
26project = u'Xen'
27copyright = u'2019-%Y, The Xen development community'
28author = u'The Xen development community'
29
30if sphinx.version_info < (8, 1):
31    from datetime import datetime
32    copyright = datetime.today().strftime(copyright)
33
34# Pull the Xen version straight out of the Makefile
35try:
36    xen_ver = xen_subver = xen_extra = None
37
38    for line in open(u"../xen/Makefile"):
39        if line.startswith(u"export XEN_VERSION"):
40            xen_ver = line.split(u"=")[1].strip()
41        elif line.startswith(u"export XEN_SUBVERSION"):
42            xen_subver = line.split(u"=")[1].strip()
43        elif line.startswith(u"export XEN_EXTRAVERSION"):
44            xen_extra = line.split(u"=")[1].split(u"$", 1)[0].strip()
45except:
46    pass
47finally:
48    if xen_ver and xen_subver and xen_extra:
49        version = xen_ver + u"." + xen_subver
50        release = version + xen_extra
51    else:
52        version = release = u"unknown version"
53
54# -- General configuration ---------------------------------------------------
55# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
56
57# If your documentation needs a minimal Sphinx version, state it here.
58#
59needs_sphinx = '1.4'
60
61# Add any Sphinx extension module names here, as strings. They can be
62# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
63# ones.
64extensions = []
65
66# Add any paths that contain templates here, relative to this directory.
67templates_path = ['_templates']
68
69# The suffix(es) of source filenames.
70# You can specify multiple suffix as a list of string:
71#
72# source_suffix = ['.rst', '.md']
73source_suffix = '.rst'
74
75# The master toctree document.
76master_doc = 'index'
77
78# The language for content autogenerated by Sphinx. Refer to documentation
79# for a list of supported languages.
80language = 'en'
81
82# List of patterns, relative to source directory, that match files and
83# directories to ignore when looking for source files.
84# This pattern also affects html_static_path and html_extra_path.
85exclude_patterns = [u'sphinx/output', 'Thumbs.db', '.DS_Store']
86
87# The name of the Pygments (syntax highlighting) style to use.
88pygments_style = None
89
90primary_domain = 'c'
91highlight_language = 'none'
92
93# -- Options for HTML output -------------------------------------------------
94# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
95
96# The theme to use for HTML and HTML Help pages.  See the documentation for
97# a list of builtin themes.
98#
99try:
100    import sphinx_rtd_theme
101    html_theme = 'sphinx_rtd_theme'
102    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
103except ImportError:
104    sys.stderr.write('Warning: The Sphinx \'sphinx_rtd_theme\' HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme.\n')
105
106# Theme options are theme-specific and customize the look and feel of a theme
107# further.  For a list of options available for each theme, see the
108# documentation.
109#
110# html_theme_options = {}
111
112# Add any paths that contain custom static files (such as style sheets) here,
113# relative to this directory. They are copied after the builtin static files,
114# so a file named "default.css" will overwrite the builtin "default.css".
115html_static_path = []
116
117# Custom sidebar templates, must be a dictionary that maps document names
118# to template names.
119#
120# The default sidebars (for documents that don't match any pattern) are
121# defined by theme itself.  Builtin themes are using these templates by
122# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
123# 'searchbox.html']``.
124#
125# html_sidebars = {}
126
127
128# -- Options for HTMLHelp output ---------------------------------------------
129
130# Output file base name for HTML help builder.
131htmlhelp_basename = 'Xendoc'
132
133
134# -- Options for LaTeX output ------------------------------------------------
135
136latex_elements = {
137    # The paper size ('letterpaper' or 'a4paper').
138    #
139    # 'papersize': 'letterpaper',
140
141    # The font size ('10pt', '11pt' or '12pt').
142    #
143    # 'pointsize': '10pt',
144
145    # Additional stuff for the LaTeX preamble.
146    #
147    # 'preamble': '',
148
149    # Latex figure (float) alignment
150    #
151    # 'figure_align': 'htbp',
152}
153
154# Grouping the document tree into LaTeX files. List of tuples
155# (source start file, target name, title,
156#  author, documentclass [howto, manual, or own class]).
157latex_documents = [
158    (master_doc, 'Xen.tex', u'Xen Documentation',
159     u'The Xen development community', 'manual'),
160]
161
162
163# -- Options for manual page output ------------------------------------------
164
165# One entry per manual page. List of tuples
166# (source start file, name, description, authors, manual section).
167man_pages = [
168    (master_doc, 'xen', u'Xen Documentation',
169     [author], 1)
170]
171
172
173# -- Options for Texinfo output ----------------------------------------------
174
175# Grouping the document tree into Texinfo files. List of tuples
176# (source start file, target name, title, author,
177#  dir menu entry, description, category)
178texinfo_documents = [
179    (master_doc, 'Xen', u'Xen Documentation',
180     author, 'Xen', 'One line description of project.',
181     'Miscellaneous'),
182]
183
184
185# -- Options for Epub output -------------------------------------------------
186
187# Bibliographic Dublin Core info.
188epub_title = project
189
190# The unique identifier of the text. This can be a ISBN number
191# or the project homepage.
192#
193# epub_identifier = ''
194
195# A unique identification for the text.
196#
197# epub_uid = ''
198
199# A list of files that should not be packed into the epub file.
200epub_exclude_files = ['search.html']
201