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
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
)
23 'sphinx.ext.graphviz',
28 templates_path
= ['_templates']
29 source_suffix
= '.rst'
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
:
40 if not line
or line
.startswith('#'):
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'
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'