1# -*- coding: utf-8 -*-
2#
3# pyftpdlib documentation build configuration file, created by
4# sphinx-quickstart on Wed Oct 19 21:54:30 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# If extensions (or modules to document with autodoc) are in another directory,
16# add these directories to sys.path here. If the directory is relative to the
17# documentation root, use os.path.abspath to make it absolute, like shown here.
18#
19# import os
20# import sys
21# sys.path.insert(0, os.path.abspath('.'))
22
23# -- General configuration ------------------------------------------------
24
25import datetime
26import os
27
28
29PROJECT_NAME = "pyftpdlib"
30AUTHOR = u"Giampaolo Rodola"
31THIS_YEAR = str(datetime.datetime.now().year)
32HERE = os.path.abspath(os.path.dirname(__file__))
33
34
35def get_version():
36    INIT = os.path.abspath(os.path.join(HERE, '..', 'pyftpdlib',
37                                        '__init__.py'))
38    with open(INIT, 'r') as f:
39        for line in f:
40            if line.startswith('__ver__'):
41                ret = eval(line.strip().split(' = ')[1])
42                assert ret.count('.') == 2, ret
43                for num in ret.split('.'):
44                    assert num.isdigit(), ret
45                return ret
46        else:
47            raise ValueError("couldn't find version string")
48
49
50VERSION = get_version()
51
52# If your documentation needs a minimal Sphinx version, state it here.
53#
54# needs_sphinx = '1.0'
55
56# Add any Sphinx extension module names here, as strings. They can be
57# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
58# ones.
59extensions = ['sphinx.ext.autodoc',
60              'sphinx.ext.coverage',
61              'sphinx.ext.imgmath',
62              'sphinx.ext.viewcode',
63              'sphinx.ext.intersphinx']
64
65# Add any paths that contain templates here, relative to this directory.
66templates_path = ['_templates']
67
68# The suffix(es) of source filenames.
69# You can specify multiple suffix as a list of string:
70#
71# source_suffix = ['.rst', '.md']
72source_suffix = '.rst'
73
74# The encoding of source files.
75#
76# source_encoding = 'utf-8-sig'
77
78# The master toctree document.
79master_doc = 'index'
80
81# General information about the project.
82project = PROJECT_NAME
83copyright = '2009-%s, %s' % (THIS_YEAR, AUTHOR)
84author = AUTHOR
85
86# The version info for the project you're documenting, acts as replacement for
87# |version| and |release|, also used in various other places throughout the
88# built documents.
89#
90# The short X.Y version.
91version = VERSION
92# The full version, including alpha/beta/rc tags.
93release = VERSION
94
95# The language for content autogenerated by Sphinx. Refer to documentation
96# for a list of supported languages.
97#
98# This is also used if you do content translation via gettext catalogs.
99# Usually you set "language" from the command line for these cases.
100language = None
101
102# There are two options for replacing |today|: either, you set today to some
103# non-false value, then it is used:
104#
105# today = ''
106#
107# Else, today_fmt is used as the format for a strftime call.
108#
109# today_fmt = '%B %d, %Y'
110
111# List of patterns, relative to source directory, that match files and
112# directories to ignore when looking for source files.
113# This patterns also effect to html_static_path and html_extra_path
114exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
115
116# The reST default role (used for this markup: `text`) to use for all
117# documents.
118#
119# default_role = None
120
121# If true, '()' will be appended to :func: etc. cross-reference text.
122#
123# add_function_parentheses = True
124
125# If true, the current module name will be prepended to all description
126# unit titles (such as .. function::).
127#
128# add_module_names = True
129
130# If true, sectionauthor and moduleauthor directives will be shown in the
131# output. They are ignored by default.
132#
133# show_authors = False
134
135# The name of the Pygments (syntax highlighting) style to use.
136pygments_style = 'sphinx'
137
138# A list of ignored prefixes for module index sorting.
139# modindex_common_prefix = []
140
141# If true, keep warnings as "system message" paragraphs in the built documents.
142# keep_warnings = False
143
144# If true, `todo` and `todoList` produce output, else they produce nothing.
145todo_include_todos = False
146
147
148# -- Options for HTML output ----------------------------------------------
149
150# The theme to use for HTML and HTML Help pages.  See the documentation for
151# a list of builtin themes.
152#
153html_theme = 'sphinx_rtd_theme'
154
155# Theme options are theme-specific and customize the look and feel of a theme
156# further.  For a list of options available for each theme, see the
157# documentation.
158#
159# html_theme_options = {}
160
161# Add any paths that contain custom themes here, relative to this directory.
162# html_theme_path = []
163
164# The name for this set of Sphinx documents.
165# "<project> v<release> documentation" by default.
166#
167# html_title = u'pyftpdlib v1.0'
168
169# A shorter title for the navigation bar.  Default is the same as html_title.
170#
171# html_short_title = None
172
173# The name of an image file (relative to this directory) to place at the top
174# of the sidebar.
175#
176# html_logo = None
177
178# The name of an image file (relative to this directory) to use as a favicon of
179# the docs.  This file should be a Windows icon file (.ico) being 16x16 or
180# 32x32 pixels large.
181
182
183# Add any paths that contain custom static files (such as style sheets) here,
184# relative to this directory. They are copied after the builtin static files,
185# so a file named "default.css" will overwrite the builtin "default.css".
186# html_static_path = ['_static']
187
188# Add any extra paths that contain custom files (such as robots.txt or
189# .htaccess) here, relative to this directory. These files are copied
190# directly to the root of the documentation.
191#
192# html_extra_path = []
193
194# If not None, a 'Last updated on:' timestamp is inserted at every page
195# bottom, using the given strftime format.
196# The empty string is equivalent to '%b %d, %Y'.
197#
198# html_last_updated_fmt = None
199
200# If true, SmartyPants will be used to convert quotes and dashes to
201# typographically correct entities.
202#
203# html_use_smartypants = True
204
205# Custom sidebar templates, maps document names to template names.
206#
207# html_sidebars = {}
208
209# Additional templates that should be rendered to pages, maps page names to
210# template names.
211#
212# html_additional_pages = {}
213
214# If false, no module index is generated.
215#
216# html_domain_indices = True
217
218# If false, no index is generated.
219#
220# html_use_index = True
221
222# If true, the index is split into individual pages for each letter.
223#
224# html_split_index = False
225
226# If true, links to the reST sources are added to the pages.
227#
228# html_show_sourcelink = True
229
230# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
231#
232# html_show_sphinx = True
233
234# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
235#
236# html_show_copyright = True
237
238# If true, an OpenSearch description file will be output, and all pages will
239# contain a <link> tag referring to it.  The value of this option must be the
240# base URL from which the finished HTML is served.
241#
242# html_use_opensearch = ''
243
244# This is the file name suffix for HTML files (e.g. ".xhtml").
245# html_file_suffix = None
246
247# Language to be used for generating the HTML full-text search index.
248# Sphinx supports the following languages:
249#   'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
250#   'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'
251#
252# html_search_language = 'en'
253
254# A dictionary with options for the search language support, empty by default.
255# 'ja' uses this config value.
256# 'zh' user can custom change `jieba` dictionary path.
257#
258# html_search_options = {'type': 'default'}
259
260# The name of a javascript file (relative to the configuration directory) that
261# implements a search results scorer. If empty, the default will be used.
262#
263# html_search_scorer = 'scorer.js'
264
265# Output file base name for HTML help builder.
266htmlhelp_basename = '%s-doc' % PROJECT_NAME
267
268# -- Options for LaTeX output ---------------------------------------------
269
270latex_elements = {
271     # The paper size ('letterpaper' or 'a4paper').
272     #
273     # 'papersize': 'letterpaper',
274
275     # The font size ('10pt', '11pt' or '12pt').
276     #
277     # 'pointsize': '10pt',
278
279     # Additional stuff for the LaTeX preamble.
280     #
281     # 'preamble': '',
282
283     # Latex figure (float) alignment
284     #
285     # 'figure_align': 'htbp',
286}
287
288# Grouping the document tree into LaTeX files. List of tuples
289# (source start file, target name, title,
290#  author, documentclass [howto, manual, or own class]).
291latex_documents = [
292    (master_doc, 'pyftpdlib.tex', u'pyftpdlib Documentation',
293     AUTHOR, 'manual'),
294]
295
296# The name of an image file (relative to this directory) to place at the top of
297# the title page.
298#
299# latex_logo = None
300
301# For "manual" documents, if this is true, then toplevel headings are parts,
302# not chapters.
303#
304# latex_use_parts = False
305
306# If true, show page references after internal links.
307#
308# latex_show_pagerefs = False
309
310# If true, show URL addresses after external links.
311#
312# latex_show_urls = False
313
314# Documents to append as an appendix to all manuals.
315#
316# latex_appendices = []
317
318# It false, will not define \strong, \code, 	itleref, \crossref ... but only
319# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
320# packages.
321#
322# latex_keep_old_macro_names = True
323
324# If false, no module index is generated.
325#
326# latex_domain_indices = True
327
328
329# -- Options for manual page output ---------------------------------------
330
331# One entry per manual page. List of tuples
332# (source start file, name, description, authors, manual section).
333man_pages = [
334    (master_doc, 'pyftpdlib', u'pyftpdlib Documentation',
335     [author], 1)
336]
337
338# If true, show URL addresses after external links.
339#
340# man_show_urls = False
341
342
343# -- Options for Texinfo output -------------------------------------------
344
345# Grouping the document tree into Texinfo files. List of tuples
346# (source start file, target name, title, author,
347#  dir menu entry, description, category)
348texinfo_documents = [
349    (master_doc, 'pyftpdlib', u'pyftpdlib Documentation',
350     author, 'pyftpdlib', 'One line description of project.',
351     'Miscellaneous'),
352]
353
354# Documents to append as an appendix to all manuals.
355#
356# texinfo_appendices = []
357
358# If false, no module index is generated.
359#
360# texinfo_domain_indices = True
361
362# How to display URL addresses: 'footnote', 'no', or 'inline'.
363#
364# texinfo_show_urls = 'footnote'
365
366# If true, do not generate a @detailmenu in the "Top" node's menu.
367#
368# texinfo_no_detailmenu = False
369
370
371html_context = {
372    'css_files': [
373        'https://media.readthedocs.org/css/sphinx_rtd_theme.css',
374        'https://media.readthedocs.org/css/readthedocs-doc-embed.css',
375        # '_static/css/custom.css',
376    ],
377}
378