michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: from __future__ import unicode_literals michael@0: michael@0: import os michael@0: import re michael@0: michael@0: from datetime import datetime michael@0: michael@0: michael@0: mozilla_dir = os.environ['MOZILLA_DIR'] michael@0: michael@0: import mdn_theme michael@0: michael@0: extensions = [ michael@0: 'sphinx.ext.autodoc', michael@0: 'sphinx.ext.graphviz', michael@0: 'sphinx.ext.todo', michael@0: 'mozbuild.sphinx', michael@0: ] michael@0: michael@0: templates_path = ['_templates'] michael@0: source_suffix = '.rst' michael@0: master_doc = 'index' michael@0: project = u'Mozilla Source Tree Docs' michael@0: year = datetime.now().year michael@0: michael@0: # Grab the version from the source tree's milestone. michael@0: # FUTURE Use Python API from bug 941299. michael@0: with open(os.path.join(mozilla_dir, 'config', 'milestone.txt'), 'rt') as fh: michael@0: for line in fh: michael@0: line = line.strip() michael@0: michael@0: if not line or line.startswith('#'): michael@0: continue michael@0: michael@0: release = line michael@0: break michael@0: michael@0: version = re.sub(r'[ab]\d+$', '', release) michael@0: michael@0: exclude_patterns = ['_build'] michael@0: pygments_style = 'sphinx' michael@0: michael@0: html_theme_path = [mdn_theme.get_theme_dir()] michael@0: html_theme = 'mdn' michael@0: michael@0: html_static_path = ['_static'] michael@0: htmlhelp_basename = 'MozillaTreeDocs'