Bug 1389341 - add basic support for sphinx-js to mach doc r?gps
MozReview-Commit-ID: L2Xa2onqpzh
--- a/tools/docs/conf.py
+++ b/tools/docs/conf.py
@@ -31,18 +31,25 @@ sys.path[:0] = [os.path.join(topsrcdir,
sys.path.insert(0, OUR_DIR)
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.graphviz',
'sphinx.ext.todo',
'mozbuild.sphinx',
+ 'sphinx_js',
]
+# JSDoc must run successfully for dirs specified, so running
+# tree-wide (the default) will not work currently.
+js_source_path = []
+root_for_relative_js_paths = '.'
+jsdoc_config_path = 'tools/docs/jsdoc.json'
+
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Mozilla Source Tree Docs'
year = datetime.now().year
# Grab the version from the source tree's milestone.
# FUTURE Use Python API from bug 941299.
new file mode 100644
--- /dev/null
+++ b/tools/docs/jsdoc.json
@@ -0,0 +1,5 @@
+{
+ "source": {
+ "includePattern": ".+\\.jsm$"
+ }
+}
--- a/tools/docs/mach_commands.py
+++ b/tools/docs/mach_commands.py
@@ -31,17 +31,18 @@ class Documentation(MachCommandBase):
@CommandArgument('--outdir', default=None, metavar='DESTINATION',
help='Where to write output.')
@CommandArgument('--no-open', dest='auto_open', default=True, action='store_false',
help="Don't automatically open HTML docs in a browser.")
@CommandArgument('--http', const=':6666', metavar='ADDRESS', nargs='?',
help='Serve documentation on an HTTP server, e.g. ":6666".')
def build_docs(self, what=None, format=None, outdir=None, auto_open=True, http=None):
self._activate_virtualenv()
- self.virtualenv_manager.install_pip_package('sphinx_rtd_theme==0.1.6')
+ self.virtualenv_manager.install_pip_package('sphinx_rtd_theme==0.2.4')
+ self.virtualenv_manager.install_pip_package('sphinx-js==2.1')
import sphinx
import webbrowser
if not outdir:
outdir = os.path.join(self.topobjdir, 'docs')
if not what:
what = [os.path.join(self.topsrcdir, 'tools')]