~allenap/maas/repackage

« back to all changes in this revision

Viewing changes to docs/conf.py

  • Committer: Gavin Panella
  • Date: 2014-07-15 16:48:47 UTC
  • mfrom: (1745.2.493 maas)
  • Revision ID: gavin.panella@canonical.com-20140715164847-zhtbjs009jclcppy
Merge trunk r2238, resolving 1 minor conflict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
# If extensions (or modules to document with autodoc) are in another directory,
21
21
# add these directories to sys.path here. If the directory is relative to the
22
22
# documentation root, use os.path.abspath to make it absolute, like shown here.
23
 
#sys.path.insert(0, os.path.abspath('.'))
 
23
 
 
24
import sys, os
 
25
# Include '.' in the path so that our custom extension, 'versions', can
 
26
# be found.
 
27
sys.path.insert(0, os.path.abspath('.'))
 
28
 
 
29
# -- Multiple documentation options.
 
30
 
 
31
# Add a widget to switch between different versions of the documentation to
 
32
# each generated page.
 
33
add_version_switcher = False
 
34
 
 
35
# In order for the version widget to be able to redirect correctly to the
 
36
# other versions of the documentation, each version of the documentation
 
37
# has to be accessible at the following addresses:
 
38
# /<doc_prefix>/ -> documentation for trunk.
 
39
# /<doc_prefix>1.4/ ->  documentation for 1.4.
 
40
# etc.
 
41
doc_prefix = 'docs'
 
42
 
 
43
# Path of the JSON document, relative to homepage of the documentation for trunk
 
44
# (i.e. '/<doc_prefix>/'), with the list of the versions to include in the
 
45
# version switcher widget.
 
46
versions_path = '_static/versions.js'
 
47
 
 
48
# Versions to include in the version switcher.
 
49
# Note that the version switcher fetches the list of the documentation versions
 
50
# from the list published by the trunk documentation (i.e. in '/<doc_prefix>/').
 
51
# This means the following list is meaningful only for trunk.   
 
52
# The first item should be the development version.
 
53
from collections import OrderedDict
 
54
doc_versions = OrderedDict([
 
55
    ('1.6', 'Development trunk'),
 
56
    ('1.5', 'MAAS 1.5'),
 
57
    ('1.4', 'MAAS 1.4'),
 
58
])
24
59
 
25
60
# -- General configuration -----------------------------------------------------
26
61
 
36
71
    'sphinx.ext.intersphinx',
37
72
    'sphinx.ext.pngmath',
38
73
    'sphinx.ext.viewcode',
 
74
    'versions',
39
75
    ]
40
76
 
41
77
# Add any paths that contain templates here, relative to this directory.
242
278
 
243
279
# Example configuration for intersphinx: refer to the Python standard library.
244
280
intersphinx_mapping = {'http://docs.python.org/': None}
 
281
 
 
282
# Populate html_context with the variables used in the templates.
 
283
html_context = {
 
284
    'add_version_switcher': 'true' if add_version_switcher else 'false',
 
285
    'versions_json_path': '/'.join(['', doc_prefix, versions_path]),
 
286
    'doc_prefix': doc_prefix,
 
287
}