|
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/. |
|
4 |
|
5 from __future__ import unicode_literals |
|
6 |
|
7 import os |
|
8 import re |
|
9 |
|
10 from datetime import datetime |
|
11 |
|
12 |
|
13 mozilla_dir = os.environ['MOZILLA_DIR'] |
|
14 |
|
15 import mdn_theme |
|
16 |
|
17 extensions = [ |
|
18 'sphinx.ext.autodoc', |
|
19 'sphinx.ext.graphviz', |
|
20 'sphinx.ext.todo', |
|
21 'mozbuild.sphinx', |
|
22 ] |
|
23 |
|
24 templates_path = ['_templates'] |
|
25 source_suffix = '.rst' |
|
26 master_doc = 'index' |
|
27 project = u'Mozilla Source Tree Docs' |
|
28 year = datetime.now().year |
|
29 |
|
30 # Grab the version from the source tree's milestone. |
|
31 # FUTURE Use Python API from bug 941299. |
|
32 with open(os.path.join(mozilla_dir, 'config', 'milestone.txt'), 'rt') as fh: |
|
33 for line in fh: |
|
34 line = line.strip() |
|
35 |
|
36 if not line or line.startswith('#'): |
|
37 continue |
|
38 |
|
39 release = line |
|
40 break |
|
41 |
|
42 version = re.sub(r'[ab]\d+$', '', release) |
|
43 |
|
44 exclude_patterns = ['_build'] |
|
45 pygments_style = 'sphinx' |
|
46 |
|
47 html_theme_path = [mdn_theme.get_theme_dir()] |
|
48 html_theme = 'mdn' |
|
49 |
|
50 html_static_path = ['_static'] |
|
51 htmlhelp_basename = 'MozillaTreeDocs' |