Bug 1389341 - add basic support for sphinx-js to mach doc r=gps
MozReview-Commit-ID: FIzWD8tnjYi
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
from mach.decorators import (
|
||||
@@ -13,6 +14,7 @@ from mach.decorators import (
|
||||
CommandProvider,
|
||||
)
|
||||
|
||||
import which
|
||||
import mozhttpd
|
||||
|
||||
from mozbuild.base import MachCommandBase
|
||||
@@ -42,8 +44,14 @@ class Documentation(MachCommandBase):
|
||||
help='Upload generated files to S3')
|
||||
def build_docs(self, what=None, format=None, outdir=None, auto_open=True,
|
||||
http=None, archive=False, upload=False):
|
||||
try:
|
||||
jsdoc = which.which('jsdoc')
|
||||
except which.WhichError:
|
||||
return die('jsdoc not found - please install from npm.')
|
||||
|
||||
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')
|
||||
self.virtualenv_manager.install_pip_package('recommonmark==0.4.0')
|
||||
|
||||
import sphinx
|
||||
@@ -168,3 +176,4 @@ def die(msg, exit_code=1):
|
||||
msg = '%s: %s' % (sys.argv[0], msg)
|
||||
print(msg, file=sys.stderr)
|
||||
return exit_code
|
||||
|
||||
|
||||
Reference in New Issue
Block a user