]> git.ipfire.org Git - people/ms/suricata.git/blob - doc/devguide/conf.py
devguide: include sources in EXTRA_DIST
[people/ms/suricata.git] / doc / devguide / conf.py
1 # -*- coding: utf-8 -*-
2 #
3 # This file is execfile()d with the current directory set to its
4 # containing dir.
5 #
6 # Note that not all possible configuration values are present in this
7 # autogenerated file.
8 #
9 # All configuration values have a default; values that are commented out
10 # serve to show the default.
11
12 import sys
13 import os
14 import shlex
15 import re
16
17 on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
18
19 # If extensions (or modules to document with autodoc) are in another directory,
20 # add these directories to sys.path here. If the directory is relative to the
21 # documentation root, use os.path.abspath to make it absolute, like shown here.
22 #sys.path.insert(0, os.path.abspath('.'))
23
24 # -- General configuration ------------------------------------------------
25
26 # If your documentation needs a minimal Sphinx version, state it here.
27 #needs_sphinx = '1.0'
28
29 # Add any Sphinx extension module names here, as strings. They can be
30 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
31 # ones.
32 extensions = []
33
34 # Add any paths that contain templates here, relative to this directory.
35 templates_path = ['_templates']
36
37 # The suffix(es) of source filenames.
38 # You can specify multiple suffix as a list of string:
39 # source_suffix = ['.rst', '.md']
40 source_suffix = '.rst'
41
42 # The encoding of source files.
43 #source_encoding = 'utf-8-sig'
44
45 # The master toctree document.
46 master_doc = 'index'
47
48 # General information about the project.
49 project = u'Suricata'
50 copyright = u'2020, OISF'
51 author = u'OISF'
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 short X.Y version.
58
59 # Attempt to extract the version configure.ac.
60 try:
61 version = os.environ.get('version', None)
62 if not version:
63 version = re.search(
64 "AC_INIT\(\[suricata\],\s*\[(.*)?\]\)",
65 open("../../configure.ac").read()).groups()[0]
66 if not version:
67 version = "unknown"
68 except:
69 version = "unknown"
70 release = version
71
72 # The language for content autogenerated by Sphinx. Refer to documentation
73 # for a list of supported languages.
74 #
75 # This is also used if you do content translation via gettext catalogs.
76 # Usually you set "language" from the command line for these cases.
77 language = None
78
79 # There are two options for replacing |today|: either, you set today to some
80 # non-false value, then it is used:
81 #today = ''
82 # Else, today_fmt is used as the format for a strftime call.
83 #today_fmt = '%B %d, %Y'
84
85 # List of patterns, relative to source directory, that match files and
86 # directories to ignore when looking for source files.
87 exclude_patterns = [
88 '_build',
89 ]
90
91 # The reST default role (used for this markup: `text`) to use for all
92 # documents.
93 #default_role = None
94
95 # If true, '()' will be appended to :func: etc. cross-reference text.
96 #add_function_parentheses = True
97
98 # If true, the current module name will be prepended to all description
99 # unit titles (such as .. function::).
100 #add_module_names = True
101
102 # If true, sectionauthor and moduleauthor directives will be shown in the
103 # output. They are ignored by default.
104 #show_authors = False
105
106 # The name of the Pygments (syntax highlighting) style to use.
107 pygments_style = 'sphinx'
108
109 # A list of ignored prefixes for module index sorting.
110 #modindex_common_prefix = []
111
112 # If true, keep warnings as "system message" paragraphs in the built documents.
113 #keep_warnings = False
114
115 # If true, `todo` and `todoList` produce output, else they produce nothing.
116 todo_include_todos = False
117
118
119 # -- Options for HTML output ----------------------------------------------
120
121 # The theme to use for HTML and HTML Help pages. See the documentation for
122 # a list of builtin themes.
123 if not on_rtd:
124 # Attempt to use the read the docs theme.
125 try:
126 import sphinx_rtd_theme
127 html_theme = 'sphinx_rtd_theme'
128 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
129 except:
130 html_theme = 'default'
131 def setup(app):
132 app.add_stylesheet('css/suricata.css')
133 else:
134 html_context = {
135 'css_files': [
136 'https://media.readthedocs.org/css/sphinx_rtd_theme.css',
137 'https://media.readthedocs.org/css/readthedocs-doc-embed.css',
138 '_static/css/suricata.css',
139 ],
140 }
141
142 # Theme options are theme-specific and customize the look and feel of a theme
143 # further. For a list of options available for each theme, see the
144 # documentation.
145 #html_theme_options = {}
146
147 # Add any paths that contain custom themes here, relative to this directory.
148 #html_theme_path = []
149
150 # The name for this set of Sphinx documents. If None, it defaults to
151 # "<project> v<release> documentation".
152 #html_title = None
153
154 # A shorter title for the navigation bar. Default is the same as html_title.
155 #html_short_title = None
156
157 # The name of an image file (relative to this directory) to place at the top
158 # of the sidebar.
159 #html_logo = None
160
161 # The name of an image file (within the static path) to use as favicon of the
162 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
163 # pixels large.
164 #html_favicon = None
165
166 # Add any paths that contain custom static files (such as style sheets) here,
167 # relative to this directory. They are copied after the builtin static files,
168 # so a file named "default.css" will overwrite the builtin "default.css".
169 html_static_path = ['_static']
170
171 # Add any extra paths that contain custom files (such as robots.txt or
172 # .htaccess) here, relative to this directory. These files are copied
173 # directly to the root of the documentation.
174 #html_extra_path = []
175
176 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
177 # using the given strftime format.
178 #html_last_updated_fmt = '%b %d, %Y'
179
180 # If true, SmartyPants will be used to convert quotes and dashes to
181 # typographically correct entities.
182 #html_use_smartypants = True
183
184 # Custom sidebar templates, maps document names to template names.
185 #html_sidebars = {}
186
187 # Additional templates that should be rendered to pages, maps page names to
188 # template names.
189 #html_additional_pages = {}
190
191 # If false, no module index is generated.
192 #html_domain_indices = True
193
194 # If false, no index is generated.
195 #html_use_index = True
196
197 # If true, the index is split into individual pages for each letter.
198 #html_split_index = False
199
200 # If true, links to the reST sources are added to the pages.
201 #html_show_sourcelink = True
202
203 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
204 #html_show_sphinx = True
205
206 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
207 #html_show_copyright = True
208
209 # If true, an OpenSearch description file will be output, and all pages will
210 # contain a <link> tag referring to it. The value of this option must be the
211 # base URL from which the finished HTML is served.
212 #html_use_opensearch = ''
213
214 # This is the file name suffix for HTML files (e.g. ".xhtml").
215 #html_file_suffix = None
216
217 # Language to be used for generating the HTML full-text search index.
218 # Sphinx supports the following languages:
219 # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
220 # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
221 #html_search_language = 'en'
222
223 # A dictionary with options for the search language support, empty by default.
224 # Now only 'ja' uses this config value
225 #html_search_options = {'type': 'default'}
226
227 # The name of a javascript file (relative to the configuration directory) that
228 # implements a search results scorer. If empty, the default will be used.
229 #html_search_scorer = 'scorer.js'
230
231 # Output file base name for HTML help builder.
232 htmlhelp_basename = 'suricatadevdoc'
233
234 # -- Options for LaTeX output ---------------------------------------------
235
236 latex_elements = {
237 # The paper size ('letterpaper' or 'a4paper').
238 #'papersize': 'letterpaper',
239
240 # The font size ('10pt', '11pt' or '12pt').
241 #'pointsize': '10pt',
242
243 # Additional stuff for the LaTeX preamble.
244 #'preamble': '',
245
246 # Latex figure (float) alignment
247 #'figure_align': 'htbp',
248 }
249
250 # Grouping the document tree into LaTeX files. List of tuples
251 # (source start file, target name, title,
252 # author, documentclass [howto, manual, or own class]).
253 latex_documents = [
254 (master_doc, 'Suricata.tex', u'Suricata Developer Guide',
255 u'OISF', 'manual'),
256 ]
257
258 # The name of an image file (relative to this directory) to place at the top of
259 # the title page.
260 #latex_logo = None
261
262 # For "manual" documents, if this is true, then toplevel headings are parts,
263 # not chapters.
264 #latex_use_parts = False
265
266 # If true, show page references after internal links.
267 #latex_show_pagerefs = False
268
269 # If true, show URL addresses after external links.
270 #latex_show_urls = False
271
272 # Documents to append as an appendix to all manuals.
273 #latex_appendices = []
274
275 # If false, no module index is generated.
276 #latex_domain_indices = True
277
278 # -- Options for Texinfo output -------------------------------------------
279
280 # Grouping the document tree into Texinfo files. List of tuples
281 # (source start file, target name, title, author,
282 # dir menu entry, description, category)
283 texinfo_documents = [
284 (master_doc, 'Suricata', u'Suricata Developer Guide',
285 author, 'Suricata', 'High performance NSM tool',
286 'Miscellaneous'),
287 ]
288
289 # Documents to append as an appendix to all manuals.
290 #texinfo_appendices = []
291
292 # If false, no module index is generated.
293 #texinfo_domain_indices = True
294
295 # How to display URL addresses: 'footnote', 'no', or 'inline'.
296 #texinfo_show_urls = 'footnote'
297
298 # If true, do not generate a @detailmenu in the "Top" node's menu.
299 #texinfo_no_detailmenu = False
300
301 rst_epilog = """
302 .. |sysconfdir| replace:: %(sysconfdir)s
303 .. |localstatedir| replace:: %(localstatedir)s
304 """ % {
305 "sysconfdir": os.getenv("sysconfdir", "/etc"),
306 "localstatedir": os.getenv("localstatedir", "/var"),
307 }