]> git.proxmox.com Git - mirror_ovs.git/blob - Documentation/conf.py
docs: Refer to correct package name for sphinx theme.
[mirror_ovs.git] / Documentation / conf.py
1 # -*- coding: utf-8 -*-
2 #
3 # Open vSwitch documentation build configuration file, created by
4 # sphinx-quickstart on Fri Sep 30 09:57:36 2016.
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
15 import string
16 import sys
17
18 try:
19 import ovs_sphinx_theme
20 use_ovs_theme = True
21 except ImportError:
22 print("Cannot find 'ovs-sphinx-theme' package. Falling back to default theme.")
23 use_ovs_theme = False
24
25 # -- General configuration ------------------------------------------------
26
27 # If your documentation needs a minimal Sphinx version, state it here.
28 #
29 needs_sphinx = '1.1'
30
31 # Add any Sphinx extension module names here, as strings. They can be
32 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33 # ones.
34 extensions = []
35
36 # Add any paths that contain templates here, relative to this directory.
37 templates_path = ['_templates']
38
39 # The suffix(es) of source filenames.
40 # You can specify multiple suffix as a list of string:
41 #
42 # source_suffix = ['.rst', '.md']
43 source_suffix = '.rst'
44
45 # The master toctree document.
46 master_doc = 'contents'
47
48 # General information about the project.
49 project = u'Open vSwitch'
50 copyright = u'2016, The Open vSwitch Development Community'
51 author = u'The Open vSwitch Development Community'
52
53 # The version info for the project you're documenting, acts as replacement for
54 # |version| and |release|, also used in various other places throughout the
55 # built documents.
56 #
57 # The full version, including alpha/beta/rc tags.
58 release = None
59 filename = "../configure.ac"
60 with open(filename, 'rU') as f:
61 for line in f:
62 if 'AC_INIT' in line:
63 # Parse "AC_INIT(openvswitch, 2.7.90, bugs@openvswitch.org)":
64 release = line.split(',')[1].strip(string.whitespace + '[]')
65 break
66 if release is None:
67 sys.stderr.write('%s: failed to determine Open vSwitch version\n'
68 % filename)
69 sys.exit(1)
70
71 # The short X.Y version.
72 #
73 # However, it's important to know the difference between, e.g., 2.7
74 # and 2.7.90, which can be very different versions (2.7.90 may be much
75 # closer to 2.8 than to 2.7), so check for that.
76 version = release if '.90' in release else '.'.join(release.split('.')[0:2])
77
78 # List of patterns, relative to source directory, that match files and
79 # directories to ignore when looking for source files.
80 # This patterns also effect to html_static_path and html_extra_path
81 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
82
83 # If true, check the validity of #anchors in links.
84 linkcheck_anchors = False
85
86 # -- Options for HTML output ----------------------------------------------
87
88 # The theme to use for HTML and HTML Help pages. See the documentation for
89 # a list of builtin themes.
90 #
91 if use_ovs_theme:
92 html_theme = 'ovs'
93
94 # Add any paths that contain custom themes here, relative to this directory.
95 if use_ovs_theme:
96 html_theme_path = [ovs_sphinx_theme.get_theme_dir()]
97 else:
98 html_theme_path = []
99
100 # The name of an image file (relative to this directory) to place at the top
101 # of the sidebar.
102 #
103 html_logo = '_static/logo.png'
104
105 # Add any paths that contain custom static files (such as style sheets) here,
106 # relative to this directory. They are copied after the builtin static files,
107 # so a file named "default.css" will overwrite the builtin "default.css".
108 html_static_path = ['_static']
109
110
111 # -- Options for manual page output ---------------------------------------
112
113 # One entry per manual page. List of tuples
114 # (source start file, name, description, authors, manual section).
115 _man_pages = [
116 ('ovs-test.8',
117 u'Check Linux drivers for performance, vlan and L3 tunneling problems'),
118 ('ovs-vlan-test.8',
119 u'Check Linux drivers for problems with vlan traffic'),
120 ]
121
122 # Generate list of (path, name, description, [author, ...], section)
123 man_pages = [
124 ('ref/%s' % file_name, file_name.split('.', 1)[0],
125 description, [author], file_name.split('.', 1)[1])
126 for file_name, description in _man_pages]