Debian Codegraph @

docs/conf.py

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