Bug 1675375 Part 3: Stub in polygon clipping in WebRender. r=gw
[gecko.git] / docs / conf.py
blob91a50c51a3a1a2e4cb016f8fb590cae95fd605e5
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 from __future__ import absolute_import, unicode_literals
7 import os
8 import sys
10 from recommonmark.transform import AutoStructify
12 # Set up Python environment to load build system packages.
13 OUR_DIR = os.path.dirname(__file__)
14 topsrcdir = os.path.normpath(os.path.join(OUR_DIR, ".."))
16 # Escapes $, [, ] and 3 dots in copy button
17 copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
18 copybutton_prompt_is_regexp = True
20 EXTRA_PATHS = (
21 "layout/tools/reftest",
22 "python/mach",
23 "python/mozbuild",
24 "python/mozversioncontrol",
25 "testing/mozbase/manifestparser",
26 "testing/mozbase/mozfile",
27 "testing/mozbase/mozprocess",
28 "third_party/python/futures",
29 "third_party/python/jsmin",
30 "third_party/python/which",
31 "toolkit/components/glean/sphinx",
34 sys.path[:0] = [os.path.join(topsrcdir, p) for p in EXTRA_PATHS]
36 sys.path.insert(0, OUR_DIR)
38 extensions = [
39 "sphinx.ext.autodoc",
40 "sphinx.ext.autosectionlabel",
41 "sphinx.ext.doctest",
42 "sphinx.ext.graphviz",
43 "sphinx.ext.napoleon",
44 "sphinx.ext.todo",
45 "mozbuild.sphinx",
46 "sphinx_js",
47 "sphinxcontrib.mermaid",
48 "recommonmark",
49 "sphinx_copybutton",
50 "sphinx_markdown_tables",
51 "sphinx_panels",
52 "glean",
55 # JSDoc must run successfully for dirs specified, so running
56 # tree-wide (the default) will not work currently.
57 js_source_path = [
58 "../browser/components/extensions",
59 "../browser/components/uitour",
60 "../testing/marionette",
61 "../toolkit/components/extensions",
62 "../toolkit/components/extensions/parent",
63 "../toolkit/components/featuregates",
64 "../toolkit/mozapps/extensions",
65 "../toolkit/components/prompts/src",
66 "../toolkit/components/pictureinpicture",
67 "../toolkit/components/pictureinpicture/content",
69 root_for_relative_js_paths = ".."
70 jsdoc_config_path = "jsdoc.json"
72 templates_path = ["_templates"]
73 source_suffix = [".rst", ".md"]
74 master_doc = "index"
75 project = "Firefox Source Docs"
76 html_logo = os.path.join(
77 topsrcdir, "browser/branding/nightly/content/firefox-wordmark.svg"
79 html_favicon = os.path.join(topsrcdir, "browser/branding/nightly/firefox.ico")
80 html_js_files = ["https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.9.1/mermaid.js"]
82 exclude_patterns = ["_build", "_staging", "_venv"]
83 pygments_style = "sphinx"
85 # We need to perform some adjustment of the settings and environment
86 # when running on Read The Docs.
87 on_rtd = os.environ.get("READTHEDOCS", None) == "True"
89 if on_rtd:
90 # SHELL isn't set on RTD and mach.mixin.process's import raises if a
91 # shell-related environment variable can't be found. Set the variable here
92 # to hack us into working on RTD.
93 assert "SHELL" not in os.environ
94 os.environ["SHELL"] = "/bin/bash"
95 else:
96 # We only need to set the RTD theme when not on RTD because the RTD
97 # environment handles this otherwise.
98 import sphinx_rtd_theme
100 html_theme = "sphinx_rtd_theme"
101 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
104 html_static_path = ["_static"]
105 htmlhelp_basename = "MozillaTreeDocs"
107 moz_project_name = "main"
109 html_show_copyright = False
111 # Only run autosection for the page title.
112 # Otherwise, we have a huge number of duplicate links.
113 # For example, the page https://firefox-source-docs.mozilla.org/code-quality/lint/
114 # is called "Linting"
115 # just like https://firefox-source-docs.mozilla.org/remote/CodeStyle.html
116 autosectionlabel_maxdepth = 1
119 def setup(app):
120 app.add_config_value(
121 "recommonmark_config",
123 # Crashes with sphinx
124 "enable_inline_math": False,
125 # We use it for testing/web-platform/tests
126 "enable_eval_rst": True,
128 True,
130 app.add_stylesheet("custom_theme.css")
131 app.add_transform(AutoStructify)