Bug 1411430 - Support markdown in Sphinx docs; r=gps
authorMaja Frydrychowicz <mjzffr@gmail.com>
Mon, 23 Oct 2017 09:59:31 -0400
changeset 388541 c1191b82382a6eae17191ae062ff16a50c91f986
parent 388540 53f5585bb94d8e9ae18ecba173724743b6433949
child 388542 84139047f8dc8cbb2006770c1a7ba19ee71a9b30
push id54193
push usergszorc@mozilla.com
push dateFri, 27 Oct 2017 00:07:43 +0000
treeherderautoland@c1191b82382a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1411430
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1411430 - Support markdown in Sphinx docs; r=gps MozReview-Commit-ID: IdRuC4AFarq
build/sparse-profiles/sphinx-docs
taskcluster/ci/source-test/doc.yml
tools/docs/conf.py
tools/docs/mach_commands.py
--- a/build/sparse-profiles/sphinx-docs
+++ b/build/sparse-profiles/sphinx-docs
@@ -1,16 +1,17 @@
 %include build/sparse-profiles/mach
 
 [include]
 # Code for generating docs.
 glob:tools/docs/**
 
 # Potential docs sources
 glob:**/*.rst
+glob:**/*.md
 
 # Python API docs.
 glob:**/*.py
 
 # moz.build files are read to discover location of docs.
 glob:**/moz.build
 
 # Read to set the version of the docs.
--- a/taskcluster/ci/source-test/doc.yml
+++ b/taskcluster/ci/source-test/doc.yml
@@ -18,16 +18,17 @@ generate:
         command: >
             cd /builds/worker/checkouts/gecko &&
             ./mach doc --outdir docs-out --no-open --archive
         sparse-profile: sphinx-docs
     when:
         files-changed:
             - '**/*.py'
             - '**/*.rst'
+            - '**/*.md'
             - 'tools/docs/**'
 
 upload:
     description: Generate and upload the Sphinx documentation
     platform: lint/opt
     treeherder:
         symbol: tc(DocUp)
         kind: test
--- a/tools/docs/conf.py
+++ b/tools/docs/conf.py
@@ -3,16 +3,18 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import unicode_literals
 
 import os
 import re
 import sys
 
+from recommonmark.parser import CommonMarkParser
+
 from datetime import datetime
 
 # Set up Python environment to load build system packages.
 OUR_DIR = os.path.dirname(__file__)
 topsrcdir = os.path.normpath(os.path.join(OUR_DIR, '..', '..'))
 
 EXTRA_PATHS = (
     'layout/tools/reftest',
@@ -35,16 +37,20 @@ extensions = [
     'sphinx.ext.autodoc',
     'sphinx.ext.graphviz',
     'sphinx.ext.todo',
     'mozbuild.sphinx',
 ]
 
 templates_path = ['_templates']
 source_suffix = '.rst'
+source_suffix = ['.rst', '.md']
+source_parsers = {
+   '.md': CommonMarkParser,
+}
 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.
 with open(os.path.join(topsrcdir, 'config', 'milestone.txt'), 'rt') as fh:
     for line in fh:
--- a/tools/docs/mach_commands.py
+++ b/tools/docs/mach_commands.py
@@ -39,16 +39,17 @@ class Documentation(MachCommandBase):
                      help='Serve documentation on an HTTP server, '
                           'e.g. ":6666".')
     @CommandArgument('--upload', action='store_true',
                      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):
         self._activate_virtualenv()
         self.virtualenv_manager.install_pip_package('sphinx_rtd_theme==0.1.6')
+        self.virtualenv_manager.install_pip_package('recommonmark==0.4.0')
 
         import sphinx
         import webbrowser
         import moztreedocs
 
         if not outdir:
             outdir = os.path.join(self.topobjdir, 'docs')
         if not what: