xref: /libuv/docs/src/conf.py (revision 1b4bd920)
1# -*- coding: utf-8 -*-
2#
3# libuv documentation documentation build configuration file, created by
4# sphinx-quickstart on Sun Jul 27 11:47:51 2014.
5#
6# This file is execfile()d with the current directory set to its
7# containing dir.
8#
9# Note that not all possible configuration values are present in this
10# autogenerated file.
11#
12# All configuration values have a default; values that are commented out
13# serve to show the default.
14
15import os
16import re
17import sys
18
19
20def get_libuv_version():
21    with open('../../include/uv/version.h') as f:
22        data = f.read()
23    try:
24        m = re.search(r"""^#define UV_VERSION_MAJOR (\d+)$""", data, re.MULTILINE)
25        major = int(m.group(1))
26        m = re.search(r"""^#define UV_VERSION_MINOR (\d+)$""", data, re.MULTILINE)
27        minor = int(m.group(1))
28        m = re.search(r"""^#define UV_VERSION_PATCH (\d+)$""", data, re.MULTILINE)
29        patch = int(m.group(1))
30        m = re.search(r"""^#define UV_VERSION_IS_RELEASE (\d)$""", data, re.MULTILINE)
31        is_release = int(m.group(1))
32        m = re.search(r"""^#define UV_VERSION_SUFFIX \"(\w*)\"$""", data, re.MULTILINE)
33        suffix = m.group(1)
34        return '%d.%d.%d%s' % (major, minor, patch, '-%s' % suffix if not is_release else '')
35    except Exception:
36        return 'unknown'
37
38# If extensions (or modules to document with autodoc) are in another directory,
39# add these directories to sys.path here. If the directory is relative to the
40# documentation root, use os.path.abspath to make it absolute, like shown here.
41sys.path.insert(0, os.path.abspath('sphinx-plugins'))
42
43# -- General configuration ------------------------------------------------
44
45# If your documentation needs a minimal Sphinx version, state it here.
46#needs_sphinx = '1.0'
47
48# Add any Sphinx extension module names here, as strings. They can be
49# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
50# ones.
51extensions = ['manpage']
52
53# Add any paths that contain templates here, relative to this directory.
54templates_path = ['templates']
55
56# The suffix of source filenames.
57source_suffix = '.rst'
58
59# The encoding of source files.
60#source_encoding = 'utf-8-sig'
61
62# The master toctree document.
63master_doc = 'index'
64
65# General information about the project.
66project = u'libuv API documentation'
67copyright = u'2014-present, libuv contributors'
68
69# The version info for the project you're documenting, acts as replacement for
70# |version| and |release|, also used in various other places throughout the
71# built documents.
72#
73# The short X.Y version.
74version = get_libuv_version()
75# The full version, including alpha/beta/rc tags.
76release = version
77
78# The language for content autogenerated by Sphinx. Refer to documentation
79# for a list of supported languages.
80#language = None
81
82# There are two options for replacing |today|: either, you set today to some
83# non-false value, then it is used:
84#today = ''
85# Else, today_fmt is used as the format for a strftime call.
86#today_fmt = '%B %d, %Y'
87
88# List of patterns, relative to source directory, that match files and
89# directories to ignore when looking for source files.
90exclude_patterns = []
91
92# The reST default role (used for this markup: `text`) to use for all
93# documents.
94#default_role = None
95
96# If true, '()' will be appended to :func: etc. cross-reference text.
97#add_function_parentheses = True
98
99# If true, the current module name will be prepended to all description
100# unit titles (such as .. function::).
101#add_module_names = True
102
103# If true, sectionauthor and moduleauthor directives will be shown in the
104# output. They are ignored by default.
105#show_authors = False
106
107# The name of the Pygments (syntax highlighting) style to use.
108pygments_style = 'sphinx'
109
110# A list of ignored prefixes for module index sorting.
111#modindex_common_prefix = []
112
113# If true, keep warnings as "system message" paragraphs in the built documents.
114#keep_warnings = False
115
116
117# -- Options for HTML output ----------------------------------------------
118
119# The theme to use for HTML and HTML Help pages.  See the documentation for
120# a list of builtin themes.
121html_theme = 'furo'
122
123# Theme options are theme-specific and customize the look and feel of a theme
124# further.  For a list of options available for each theme, see the
125# documentation.
126#html_theme_options = {}
127
128# Add any paths that contain custom themes here, relative to this directory.
129#html_theme_path = []
130
131# The name for this set of Sphinx documents.  If None, it defaults to
132# "<project> v<release> documentation".
133html_title = 'libuv documentation'
134
135# A shorter title for the navigation bar.  Default is the same as html_title.
136html_short_title = 'libuv %s documentation' % version
137
138# The name of an image file (relative to this directory) to place at the top
139# of the sidebar.
140html_logo = 'static/logo.png'
141
142# The name of an image file (within the static path) to use as favicon of the
143# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
144# pixels large.
145html_favicon = 'static/favicon.ico'
146
147# Add any paths that contain custom static files (such as style sheets) here,
148# relative to this directory. They are copied after the builtin static files,
149# so a file named "default.css" will overwrite the builtin "default.css".
150html_static_path = ['static']
151
152# Add any extra paths that contain custom files (such as robots.txt or
153# .htaccess) here, relative to this directory. These files are copied
154# directly to the root of the documentation.
155#html_extra_path = []
156
157# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
158# using the given strftime format.
159#html_last_updated_fmt = '%b %d, %Y'
160
161# If true, SmartyPants will be used to convert quotes and dashes to
162# typographically correct entities.
163#html_use_smartypants = True
164
165# Custom sidebar templates, maps document names to template names.
166#html_sidebars = {}
167
168# Additional templates that should be rendered to pages, maps page names to
169# template names.
170#html_additional_pages = {}
171
172# If false, no module index is generated.
173#html_domain_indices = True
174
175# If false, no index is generated.
176#html_use_index = True
177
178# If true, the index is split into individual pages for each letter.
179#html_split_index = False
180
181# If true, links to the reST sources are added to the pages.
182#html_show_sourcelink = True
183
184# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
185#html_show_sphinx = True
186
187# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
188#html_show_copyright = True
189
190# If true, an OpenSearch description file will be output, and all pages will
191# contain a <link> tag referring to it.  The value of this option must be the
192# base URL from which the finished HTML is served.
193#html_use_opensearch = ''
194
195# This is the file name suffix for HTML files (e.g. ".xhtml").
196#html_file_suffix = None
197
198# Output file base name for HTML help builder.
199htmlhelp_basename = 'libuv'
200
201
202# -- Options for LaTeX output ---------------------------------------------
203
204latex_elements = {
205# The paper size ('letterpaper' or 'a4paper').
206#'papersize': 'letterpaper',
207
208# The font size ('10pt', '11pt' or '12pt').
209#'pointsize': '10pt',
210
211# Additional stuff for the LaTeX preamble.
212#'preamble': '',
213}
214
215# Grouping the document tree into LaTeX files. List of tuples
216# (source start file, target name, title,
217#  author, documentclass [howto, manual, or own class]).
218latex_documents = [
219  ('index', 'libuv.tex', u'libuv documentation',
220   u'libuv contributors', 'manual'),
221]
222
223# The name of an image file (relative to this directory) to place at the top of
224# the title page.
225#latex_logo = None
226
227# For "manual" documents, if this is true, then toplevel headings are parts,
228# not chapters.
229#latex_use_parts = False
230
231# If true, show page references after internal links.
232#latex_show_pagerefs = False
233
234# If true, show URL addresses after external links.
235#latex_show_urls = False
236
237# Documents to append as an appendix to all manuals.
238#latex_appendices = []
239
240# If false, no module index is generated.
241#latex_domain_indices = True
242
243
244# -- Options for manual page output ---------------------------------------
245
246# One entry per manual page. List of tuples
247# (source start file, name, description, authors, manual section).
248man_pages = [
249    ('index', 'libuv', u'libuv documentation',
250     [u'libuv contributors'], 1)
251]
252
253# If true, show URL addresses after external links.
254#man_show_urls = False
255
256
257# -- Options for Texinfo output -------------------------------------------
258
259# Grouping the document tree into Texinfo files. List of tuples
260# (source start file, target name, title, author,
261#  dir menu entry, description, category)
262texinfo_documents = [
263  ('index', 'libuv', u'libuv documentation',
264   u'libuv contributors', 'libuv', 'Cross-platform asynchronous I/O',
265   'Miscellaneous'),
266]
267
268# Documents to append as an appendix to all manuals.
269#texinfo_appendices = []
270
271# If false, no module index is generated.
272#texinfo_domain_indices = True
273
274# How to display URL addresses: 'footnote', 'no', or 'inline'.
275#texinfo_show_urls = 'footnote'
276
277# If true, do not generate a @detailmenu in the "Top" node's menu.
278#texinfo_no_detailmenu = False
279
280
281# -- Options for Epub output ----------------------------------------------
282
283# Bibliographic Dublin Core info.
284epub_title = u'libuv documentation'
285epub_author = u'libuv contributors'
286epub_publisher = u'libuv contributors'
287epub_copyright = u'2014-present, libuv contributors'
288
289# The basename for the epub file. It defaults to the project name.
290epub_basename = u'libuv'
291
292# The HTML theme for the epub output. Since the default themes are not optimized
293# for small screen space, using the same theme for HTML and epub output is
294# usually not wise. This defaults to 'epub', a theme designed to save visual
295# space.
296#epub_theme = 'epub'
297
298# The language of the text. It defaults to the language option
299# or en if the language is not set.
300#epub_language = ''
301
302# The scheme of the identifier. Typical schemes are ISBN or URL.
303#epub_scheme = ''
304
305# The unique identifier of the text. This can be a ISBN number
306# or the project homepage.
307#epub_identifier = ''
308
309# A unique identification for the text.
310#epub_uid = ''
311
312# A tuple containing the cover image and cover page html template filenames.
313#epub_cover = ()
314
315# A sequence of (type, uri, title) tuples for the guide element of content.opf.
316#epub_guide = ()
317
318# HTML files that should be inserted before the pages created by sphinx.
319# The format is a list of tuples containing the path and title.
320#epub_pre_files = []
321
322# HTML files shat should be inserted after the pages created by sphinx.
323# The format is a list of tuples containing the path and title.
324#epub_post_files = []
325
326# A list of files that should not be packed into the epub file.
327epub_exclude_files = ['search.html']
328
329# The depth of the table of contents in toc.ncx.
330#epub_tocdepth = 3
331
332# Allow duplicate toc entries.
333#epub_tocdup = True
334
335# Choose between 'default' and 'includehidden'.
336#epub_tocscope = 'default'
337
338# Fix unsupported image types using the PIL.
339#epub_fix_images = False
340
341# Scale large images.
342#epub_max_image_width = 0
343
344# How to display URL addresses: 'footnote', 'no', or 'inline'.
345#epub_show_urls = 'inline'
346
347# If false, no index is generated.
348#epub_use_index = True
349