Bumping manifests a=b2g-bump
[gecko.git] / tools / docs / conf.py
blobdf6a808747aef53c477aa5d4c800d65c27e19fe9
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 from __future__ import unicode_literals
7 import os
8 import re
9 import sys
11 from datetime import datetime
13 # Set up Python environment to load build system packages.
14 OUR_DIR = os.path.dirname(__file__)
15 topsrcdir = os.path.normpath(os.path.join(OUR_DIR, '..', '..'))
17 sys.path.insert(0, os.path.join(topsrcdir, 'python', 'jsmin'))
18 sys.path.insert(0, os.path.join(topsrcdir, 'python', 'mozbuild'))
19 sys.path.insert(0, OUR_DIR)
21 extensions = [
22 'sphinx.ext.autodoc',
23 'sphinx.ext.graphviz',
24 'sphinx.ext.todo',
25 'mozbuild.sphinx',
28 templates_path = ['_templates']
29 source_suffix = '.rst'
30 master_doc = 'index'
31 project = u'Mozilla Source Tree Docs'
32 year = datetime.now().year
34 # Grab the version from the source tree's milestone.
35 # FUTURE Use Python API from bug 941299.
36 with open(os.path.join(topsrcdir, 'config', 'milestone.txt'), 'rt') as fh:
37 for line in fh:
38 line = line.strip()
40 if not line or line.startswith('#'):
41 continue
43 release = line
44 break
46 version = re.sub(r'[ab]\d+$', '', release)
48 exclude_patterns = ['_build', '_staging', '_venv']
49 pygments_style = 'sphinx'
51 # Read The Docs can't import sphinx_rtd_theme, so don't import it there.
52 on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
54 if not on_rtd:
55 import sphinx_rtd_theme
56 html_theme = 'sphinx_rtd_theme'
57 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
60 html_static_path = ['_static']
61 htmlhelp_basename = 'MozillaTreeDocs'