Bug 1643295 - Firefox doc - Ride along - reformat with black r=championshuttler

# ignore-this-changeset

Depends on D78257

Differential Revision: https://phabricator.services.mozilla.com/D78258
This commit is contained in:
Sylvestre Ledru
2020-06-04 12:42:45 +00:00
parent 34afd0e950
commit bc0a2ff760

View File

@@ -11,19 +11,19 @@ from recommonmark.transform import AutoStructify
# Set up Python environment to load build system packages. # Set up Python environment to load build system packages.
OUR_DIR = os.path.dirname(__file__) OUR_DIR = os.path.dirname(__file__)
topsrcdir = os.path.normpath(os.path.join(OUR_DIR, '..')) topsrcdir = os.path.normpath(os.path.join(OUR_DIR, ".."))
EXTRA_PATHS = ( EXTRA_PATHS = (
'layout/tools/reftest', "layout/tools/reftest",
'python/mach', "python/mach",
'python/mozbuild', "python/mozbuild",
'python/mozversioncontrol', "python/mozversioncontrol",
'testing/mozbase/manifestparser', "testing/mozbase/manifestparser",
'testing/mozbase/mozfile', "testing/mozbase/mozfile",
'testing/mozbase/mozprocess', "testing/mozbase/mozprocess",
'third_party/python/futures', "third_party/python/futures",
'third_party/python/jsmin', "third_party/python/jsmin",
'third_party/python/which', "third_party/python/which",
) )
sys.path[:0] = [os.path.join(topsrcdir, p) for p in EXTRA_PATHS] sys.path[:0] = [os.path.join(topsrcdir, p) for p in EXTRA_PATHS]
@@ -31,76 +31,81 @@ sys.path[:0] = [os.path.join(topsrcdir, p) for p in EXTRA_PATHS]
sys.path.insert(0, OUR_DIR) sys.path.insert(0, OUR_DIR)
extensions = [ extensions = [
'sphinx.ext.autodoc', "sphinx.ext.autodoc",
'sphinx.ext.autosectionlabel', "sphinx.ext.autosectionlabel",
'sphinx.ext.doctest', "sphinx.ext.doctest",
'sphinx.ext.graphviz', "sphinx.ext.graphviz",
'sphinx.ext.napoleon', "sphinx.ext.napoleon",
'sphinx.ext.todo', "sphinx.ext.todo",
'mozbuild.sphinx', "mozbuild.sphinx",
'sphinx_js', "sphinx_js",
'sphinxcontrib.mermaid', "sphinxcontrib.mermaid",
'recommonmark', "recommonmark",
'sphinx_copybutton', "sphinx_copybutton",
] ]
# JSDoc must run successfully for dirs specified, so running # JSDoc must run successfully for dirs specified, so running
# tree-wide (the default) will not work currently. # tree-wide (the default) will not work currently.
js_source_path = [ js_source_path = [
'browser/components/extensions', "browser/components/extensions",
'browser/components/uitour', "browser/components/uitour",
'testing/marionette', "testing/marionette",
'toolkit/components/extensions', "toolkit/components/extensions",
'toolkit/components/extensions/parent', "toolkit/components/extensions/parent",
'toolkit/components/featuregates', "toolkit/components/featuregates",
'toolkit/mozapps/extensions', "toolkit/mozapps/extensions",
'toolkit/components/prompts/src', "toolkit/components/prompts/src",
] ]
root_for_relative_js_paths = '.' root_for_relative_js_paths = "."
jsdoc_config_path = 'jsdoc.json' jsdoc_config_path = "jsdoc.json"
templates_path = ['_templates'] templates_path = ["_templates"]
source_suffix = ['.rst', '.md'] source_suffix = [".rst", ".md"]
master_doc = 'index' master_doc = "index"
project = u'Firefox Source Docs' project = "Firefox Source Docs"
html_logo = u'../browser/branding/nightly/content/firefox-wordmark.svg' html_logo = "../browser/branding/nightly/content/firefox-wordmark.svg"
html_favicon = u'../browser/branding/nightly/firefox.ico' html_favicon = "../browser/branding/nightly/firefox.ico"
exclude_patterns = ['_build', '_staging', '_venv'] exclude_patterns = ["_build", "_staging", "_venv"]
pygments_style = 'sphinx' pygments_style = "sphinx"
# We need to perform some adjustment of the settings and environment # We need to perform some adjustment of the settings and environment
# when running on Read The Docs. # when running on Read The Docs.
on_rtd = os.environ.get('READTHEDOCS', None) == 'True' on_rtd = os.environ.get("READTHEDOCS", None) == "True"
if on_rtd: if on_rtd:
# SHELL isn't set on RTD and mach.mixin.process's import raises if a # SHELL isn't set on RTD and mach.mixin.process's import raises if a
# shell-related environment variable can't be found. Set the variable here # shell-related environment variable can't be found. Set the variable here
# to hack us into working on RTD. # to hack us into working on RTD.
assert 'SHELL' not in os.environ assert "SHELL" not in os.environ
os.environ['SHELL'] = '/bin/bash' os.environ["SHELL"] = "/bin/bash"
else: else:
# We only need to set the RTD theme when not on RTD because the RTD # We only need to set the RTD theme when not on RTD because the RTD
# environment handles this otherwise. # environment handles this otherwise.
import sphinx_rtd_theme import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_static_path = ['_static'] html_static_path = ["_static"]
htmlhelp_basename = 'MozillaTreeDocs' htmlhelp_basename = "MozillaTreeDocs"
moz_project_name = 'main' moz_project_name = "main"
html_show_copyright = False html_show_copyright = False
def setup(app): def setup(app):
app.add_config_value('recommonmark_config', { app.add_config_value(
# Crashes with sphinx "recommonmark_config",
'enable_inline_math': False, {
# We use it for testing/web-platform/tests # Crashes with sphinx
'enable_eval_rst': True, "enable_inline_math": False,
}, True) # We use it for testing/web-platform/tests
app.add_stylesheet('custom_theme.css') "enable_eval_rst": True,
},
True,
)
app.add_stylesheet("custom_theme.css")
app.add_transform(AutoStructify) app.add_transform(AutoStructify)