We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
The content area in the docs is too narrow
## 📚 Documentation

In the documentation strings, rendered code examples only fit 63 characters of width. It would be nice if we could make the content area a bit larger so that code examples fit at least 80 characters. On my screen, the content area is exactly the middle third of the screen, with the left and right thirds devoted to menus.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `docs/conf.py`
Content:
```
1 # Configuration file for the Sphinx documentation builder.
2 
3 # -- Path setup --------------------------------------------------------------
4 
5 import atexit
6 import os
7 import shutil
8 import subprocess
9 import sys
10 from pathlib import Path
11 from typing import Any
12 from unittest import mock
13 
14 # -- Project information -----------------------------------------------------
15 
16 project = "Pyodide"
17 copyright = "2019-2022, Pyodide contributors and Mozilla"
18 pyodide_version = "0.22.0.dev0"
19 
20 if ".dev" in pyodide_version or os.environ.get("READTHEDOCS_VERSION") == "latest":
21     CDN_URL = "https://cdn.jsdelivr.net/pyodide/dev/full/"
22 else:
23     CDN_URL = f"https://cdn.jsdelivr.net/pyodide/v{pyodide_version}/full/"
24 
25 # -- General configuration ---------------------------------------------------
26 
27 # If your documentation needs a minimal Sphinx version, state it here.
28 #
29 # needs_sphinx = '1.0'
30 
31 extensions = [
32     "sphinx.ext.autodoc",
33     "sphinx.ext.autosummary",
34     "sphinxcontrib.napoleon",
35     "myst_parser",
36     "sphinx_js",
37     "autodocsumm",
38     "sphinx_panels",
39     "sphinx_pyodide",
40     "sphinx_argparse_cli",
41     "versionwarning.extension",
42     "sphinx_issues",
43 ]
44 
45 myst_enable_extensions = ["substitution"]
46 
47 js_language = "typescript"
48 jsdoc_config_path = "../src/js/tsconfig.json"
49 root_for_relative_js_paths = "../src/"
50 issues_github_path = "pyodide/pyodide"
51 
52 versionwarning_messages = {
53     "latest": (
54         "This is the development version of the documentation. "
55         'See <a href="https://pyodide.org/">here</a> for latest stable '
56         "documentation. Please do not use Pyodide with non "
57         "versioned (`dev`) URLs from the CDN for deployed applications!"
58     )
59 }
60 versionwarning_body_selector = "#main-content > div"
61 
62 autosummary_generate = True
63 autodoc_default_flags = ["members", "inherited-members"]
64 
65 # Add modules to be mocked.
66 mock_modules = ["ruamel.yaml", "tomli"]
67 
68 # Add any paths that contain templates here, relative to this directory.
69 templates_path = ["_templates"]
70 
71 # The suffix(es) of source filenames.
72 source_suffix = [".rst", ".md"]
73 
74 # The master toctree document.
75 master_doc = "index"
76 
77 # The language for content autogenerated by Sphinx.
78 language = None
79 
80 # List of patterns, relative to source directory, that match files and
81 # directories to ignore when looking for source files.
82 exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "README.md"]
83 
84 # The name of the Pygments (syntax highlighting) style to use.
85 pygments_style = None
86 
87 # -- Options for HTML output -------------------------------------------------
88 
89 # The theme to use for HTML and HTML Help pages.  See the documentation for
90 # a list of builtin themes.
91 #
92 html_theme = "sphinx_book_theme"
93 html_logo = "_static/img/pyodide-logo.png"
94 
95 # theme-specific options
96 html_theme_options: dict[str, Any] = {}
97 
98 # paths that contain custom static files (such as style sheets)
99 html_static_path = ["_static"]
100 
101 
102 html_css_files = [
103     "css/pyodide.css",
104 ]
105 
106 # Custom sidebar templates, must be a dictionary that maps document names
107 # to template names.
108 # html_sidebars = {}
109 
110 # -- Options for HTMLHelp output ---------------------------------------------
111 
112 # Output file base name for HTML help builder.
113 htmlhelp_basename = "Pyodidedoc"
114 
115 # A list of files that should not be packed into the epub file.
116 epub_exclude_files = ["search.html"]
117 
118 
119 def delete_attrs(cls):
120     for name in dir(cls):
121         if not name.startswith("_"):
122             try:
123                 delattr(cls, name)
124             except Exception:
125                 pass
126 
127 
128 # Try not to cause side effects if we are imported incidentally.
129 
130 try:
131     import sphinx
132 
133     IN_SPHINX = hasattr(sphinx, "application")
134 except ImportError:
135     IN_SPHINX = False
136 
137 IN_READTHEDOCS = "READTHEDOCS" in os.environ
138 
139 if IN_READTHEDOCS:
140     env = {"PYODIDE_BASE_URL": CDN_URL}
141     os.makedirs("_build/html", exist_ok=True)
142     res = subprocess.check_output(
143         ["make", "-C", "..", "docs/_build/html/console.html"],
144         env=env,
145         stderr=subprocess.STDOUT,
146         encoding="utf-8",
147     )
148     print(res)
149     # insert the Plausible analytics script to console.html
150     console_path = Path("_build/html/console.html")
151     console_html = console_path.read_text().splitlines(keepends=True)
152     for idx, line in enumerate(list(console_html)):
153         if 'pyodide.js">' in line:
154             # insert the analytics script after the `pyodide.js` script
155             console_html.insert(
156                 idx,
157                 '<script defer data-domain="pyodide.org" src="https://plausible.io/js/plausible.js"></script>\n',
158             )
159             break
160     else:
161         raise ValueError("Could not find pyodide.js in the <head> section")
162     console_path.write_text("".join(console_html))
163 
164 
165 if IN_SPHINX:
166     # Compatibility shims. sphinx-js and sphinxcontrib-napoleon have not been updated for Python 3.10
167     import collections
168     from typing import Callable, Mapping
169 
170     collections.Mapping = Mapping  # type: ignore[attr-defined]
171     collections.Callable = Callable  # type: ignore[attr-defined]
172 
173     base_dir = Path(__file__).resolve().parent.parent
174     path_dirs = [
175         str(base_dir),
176         str(base_dir / "pyodide-build"),
177         str(base_dir / "docs/sphinx_pyodide"),
178         str(base_dir / "src/py"),
179         str(base_dir / "packages/micropip/src"),
180     ]
181     sys.path = path_dirs + sys.path
182 
183     import micropip  # noqa: F401
184     import pyodide
185 
186     # We hacked it so that autodoc will look for submodules, but only if we import
187     # them here. TODO: look these up in the source directory?
188     import pyodide.code
189     import pyodide.console
190     import pyodide.ffi.wrappers
191     import pyodide.http
192     import pyodide.webloop
193 
194     # The full version, including alpha/beta/rc tags.
195     release = version = pyodide.__version__
196     html_title = f"Version {version}"
197 
198     shutil.copy("../src/core/pyproxy.ts", "../src/js/pyproxy.gen.ts")
199     shutil.copy("../src/core/error_handling.ts", "../src/js/error_handling.gen.ts")
200     js_source_path = [str(x) for x in Path("../src/js").glob("*.ts")]
201 
202     def remove_pyproxy_gen_ts():
203         Path("../src/js/pyproxy.gen.ts").unlink(missing_ok=True)
204 
205     atexit.register(remove_pyproxy_gen_ts)
206 
207     os.environ["PATH"] += f':{str(Path("../src/js/node_modules/.bin").resolve())}'
208     print(os.environ["PATH"])
209     if IN_READTHEDOCS:
210         subprocess.run(["npm", "ci"], cwd="../src/js")
211     elif not shutil.which("typedoc"):
212         raise Exception(
213             "Before building the Pyodide docs you must run 'npm install' in 'src/js'."
214         )
215 
216     # Prevent API docs for webloop methods: they are the same as for base event loop
217     # and it clutters api docs too much
218     delete_attrs(pyodide.webloop.WebLoop)
219     delete_attrs(pyodide.webloop.WebLoopPolicy)
220     delete_attrs(pyodide.console.PyodideConsole)
221 
222     for module in mock_modules:
223         sys.modules[module] = mock.Mock()
224 
225 
226 # https://github.com/sphinx-doc/sphinx/issues/4054
227 def globalReplace(app, docname, source):
228     result = source[0]
229     for key in app.config.global_replacements:
230         result = result.replace(key, app.config.global_replacements[key])
231     source[0] = result
232 
233 
234 global_replacements = {"{{PYODIDE_CDN_URL}}": CDN_URL}
235 
236 
237 def setup(app):
238     app.add_config_value("global_replacements", {}, True)
239     app.connect("source-read", globalReplace)
240
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -11,6 +11,8 @@
 from typing import Any
 from unittest import mock
 
+panels_add_bootstrap_css = False
+
 # -- Project information -----------------------------------------------------
 
 project = "Pyodide"

{"golden_diff": "diff --git a/docs/conf.py b/docs/conf.py\n--- a/docs/conf.py\n+++ b/docs/conf.py\n@@ -11,6 +11,8 @@\n from typing import Any\n from unittest import mock\n \n+panels_add_bootstrap_css = False\n+\n # -- Project information -----------------------------------------------------\n \n project = \"Pyodide\"\n", "issue": "The content area in the docs is too narrow\n## \ud83d\udcda Documentation\r\n\r\nIn the documentation strings, rendered code examples only fit 63 characters of width. It would be nice if we could make the content area a bit larger so that code examples fit at least 80 characters. On my screen, the content area is exactly the middle third of the screen, with the left and right thirds devoted to menus.\r\n\n", "before_files": [{"content": "# Configuration file for the Sphinx documentation builder.\n\n# -- Path setup --------------------------------------------------------------\n\nimport atexit\nimport os\nimport shutil\nimport subprocess\nimport sys\nfrom pathlib import Path\nfrom typing import Any\nfrom unittest import mock\n\n# -- Project information -----------------------------------------------------\n\nproject = \"Pyodide\"\ncopyright = \"2019-2022, Pyodide contributors and Mozilla\"\npyodide_version = \"0.22.0.dev0\"\n\nif \".dev\" in pyodide_version or os.environ.get(\"READTHEDOCS_VERSION\") == \"latest\":\n    CDN_URL = \"https://cdn.jsdelivr.net/pyodide/dev/full/\"\nelse:\n    CDN_URL = f\"https://cdn.jsdelivr.net/pyodide/v{pyodide_version}/full/\"\n\n# -- General configuration ---------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#\n# needs_sphinx = '1.0'\n\nextensions = [\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.autosummary\",\n    \"sphinxcontrib.napoleon\",\n    \"myst_parser\",\n    \"sphinx_js\",\n    \"autodocsumm\",\n    \"sphinx_panels\",\n    \"sphinx_pyodide\",\n    \"sphinx_argparse_cli\",\n    \"versionwarning.extension\",\n    \"sphinx_issues\",\n]\n\nmyst_enable_extensions = [\"substitution\"]\n\njs_language = \"typescript\"\njsdoc_config_path = \"../src/js/tsconfig.json\"\nroot_for_relative_js_paths = \"../src/\"\nissues_github_path = \"pyodide/pyodide\"\n\nversionwarning_messages = {\n    \"latest\": (\n        \"This is the development version of the documentation. \"\n        'See <a href=\"https://pyodide.org/\">here</a> for latest stable '\n        \"documentation. Please do not use Pyodide with non \"\n        \"versioned (`dev`) URLs from the CDN for deployed applications!\"\n    )\n}\nversionwarning_body_selector = \"#main-content > div\"\n\nautosummary_generate = True\nautodoc_default_flags = [\"members\", \"inherited-members\"]\n\n# Add modules to be mocked.\nmock_modules = [\"ruamel.yaml\", \"tomli\"]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = [\"_templates\"]\n\n# The suffix(es) of source filenames.\nsource_suffix = [\".rst\", \".md\"]\n\n# The master toctree document.\nmaster_doc = \"index\"\n\n# The language for content autogenerated by Sphinx.\nlanguage = None\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = [\"_build\", \"Thumbs.db\", \".DS_Store\", \"README.md\"]\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = None\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\n#\nhtml_theme = \"sphinx_book_theme\"\nhtml_logo = \"_static/img/pyodide-logo.png\"\n\n# theme-specific options\nhtml_theme_options: dict[str, Any] = {}\n\n# paths that contain custom static files (such as style sheets)\nhtml_static_path = [\"_static\"]\n\n\nhtml_css_files = [\n    \"css/pyodide.css\",\n]\n\n# Custom sidebar templates, must be a dictionary that maps document names\n# to template names.\n# html_sidebars = {}\n\n# -- Options for HTMLHelp output ---------------------------------------------\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = \"Pyodidedoc\"\n\n# A list of files that should not be packed into the epub file.\nepub_exclude_files = [\"search.html\"]\n\n\ndef delete_attrs(cls):\n    for name in dir(cls):\n        if not name.startswith(\"_\"):\n            try:\n                delattr(cls, name)\n            except Exception:\n                pass\n\n\n# Try not to cause side effects if we are imported incidentally.\n\ntry:\n    import sphinx\n\n    IN_SPHINX = hasattr(sphinx, \"application\")\nexcept ImportError:\n    IN_SPHINX = False\n\nIN_READTHEDOCS = \"READTHEDOCS\" in os.environ\n\nif IN_READTHEDOCS:\n    env = {\"PYODIDE_BASE_URL\": CDN_URL}\n    os.makedirs(\"_build/html\", exist_ok=True)\n    res = subprocess.check_output(\n        [\"make\", \"-C\", \"..\", \"docs/_build/html/console.html\"],\n        env=env,\n        stderr=subprocess.STDOUT,\n        encoding=\"utf-8\",\n    )\n    print(res)\n    # insert the Plausible analytics script to console.html\n    console_path = Path(\"_build/html/console.html\")\n    console_html = console_path.read_text().splitlines(keepends=True)\n    for idx, line in enumerate(list(console_html)):\n        if 'pyodide.js\">' in line:\n            # insert the analytics script after the `pyodide.js` script\n            console_html.insert(\n                idx,\n                '<script defer data-domain=\"pyodide.org\" src=\"https://plausible.io/js/plausible.js\"></script>\\n',\n            )\n            break\n    else:\n        raise ValueError(\"Could not find pyodide.js in the <head> section\")\n    console_path.write_text(\"\".join(console_html))\n\n\nif IN_SPHINX:\n    # Compatibility shims. sphinx-js and sphinxcontrib-napoleon have not been updated for Python 3.10\n    import collections\n    from typing import Callable, Mapping\n\n    collections.Mapping = Mapping  # type: ignore[attr-defined]\n    collections.Callable = Callable  # type: ignore[attr-defined]\n\n    base_dir = Path(__file__).resolve().parent.parent\n    path_dirs = [\n        str(base_dir),\n        str(base_dir / \"pyodide-build\"),\n        str(base_dir / \"docs/sphinx_pyodide\"),\n        str(base_dir / \"src/py\"),\n        str(base_dir / \"packages/micropip/src\"),\n    ]\n    sys.path = path_dirs + sys.path\n\n    import micropip  # noqa: F401\n    import pyodide\n\n    # We hacked it so that autodoc will look for submodules, but only if we import\n    # them here. TODO: look these up in the source directory?\n    import pyodide.code\n    import pyodide.console\n    import pyodide.ffi.wrappers\n    import pyodide.http\n    import pyodide.webloop\n\n    # The full version, including alpha/beta/rc tags.\n    release = version = pyodide.__version__\n    html_title = f\"Version {version}\"\n\n    shutil.copy(\"../src/core/pyproxy.ts\", \"../src/js/pyproxy.gen.ts\")\n    shutil.copy(\"../src/core/error_handling.ts\", \"../src/js/error_handling.gen.ts\")\n    js_source_path = [str(x) for x in Path(\"../src/js\").glob(\"*.ts\")]\n\n    def remove_pyproxy_gen_ts():\n        Path(\"../src/js/pyproxy.gen.ts\").unlink(missing_ok=True)\n\n    atexit.register(remove_pyproxy_gen_ts)\n\n    os.environ[\"PATH\"] += f':{str(Path(\"../src/js/node_modules/.bin\").resolve())}'\n    print(os.environ[\"PATH\"])\n    if IN_READTHEDOCS:\n        subprocess.run([\"npm\", \"ci\"], cwd=\"../src/js\")\n    elif not shutil.which(\"typedoc\"):\n        raise Exception(\n            \"Before building the Pyodide docs you must run 'npm install' in 'src/js'.\"\n        )\n\n    # Prevent API docs for webloop methods: they are the same as for base event loop\n    # and it clutters api docs too much\n    delete_attrs(pyodide.webloop.WebLoop)\n    delete_attrs(pyodide.webloop.WebLoopPolicy)\n    delete_attrs(pyodide.console.PyodideConsole)\n\n    for module in mock_modules:\n        sys.modules[module] = mock.Mock()\n\n\n# https://github.com/sphinx-doc/sphinx/issues/4054\ndef globalReplace(app, docname, source):\n    result = source[0]\n    for key in app.config.global_replacements:\n        result = result.replace(key, app.config.global_replacements[key])\n    source[0] = result\n\n\nglobal_replacements = {\"{{PYODIDE_CDN_URL}}\": CDN_URL}\n\n\ndef setup(app):\n    app.add_config_value(\"global_replacements\", {}, True)\n    app.connect(\"source-read\", globalReplace)\n", "path": "docs/conf.py"}], "after_files": [{"content": "# Configuration file for the Sphinx documentation builder.\n\n# -- Path setup --------------------------------------------------------------\n\nimport atexit\nimport os\nimport shutil\nimport subprocess\nimport sys\nfrom pathlib import Path\nfrom typing import Any\nfrom unittest import mock\n\npanels_add_bootstrap_css = False\n\n# -- Project information -----------------------------------------------------\n\nproject = \"Pyodide\"\ncopyright = \"2019-2022, Pyodide contributors and Mozilla\"\npyodide_version = \"0.22.0.dev0\"\n\nif \".dev\" in pyodide_version or os.environ.get(\"READTHEDOCS_VERSION\") == \"latest\":\n    CDN_URL = \"https://cdn.jsdelivr.net/pyodide/dev/full/\"\nelse:\n    CDN_URL = f\"https://cdn.jsdelivr.net/pyodide/v{pyodide_version}/full/\"\n\n# -- General configuration ---------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#\n# needs_sphinx = '1.0'\n\nextensions = [\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.autosummary\",\n    \"sphinxcontrib.napoleon\",\n    \"myst_parser\",\n    \"sphinx_js\",\n    \"autodocsumm\",\n    \"sphinx_panels\",\n    \"sphinx_pyodide\",\n    \"sphinx_argparse_cli\",\n    \"versionwarning.extension\",\n    \"sphinx_issues\",\n]\n\nmyst_enable_extensions = [\"substitution\"]\n\njs_language = \"typescript\"\njsdoc_config_path = \"../src/js/tsconfig.json\"\nroot_for_relative_js_paths = \"../src/\"\nissues_github_path = \"pyodide/pyodide\"\n\nversionwarning_messages = {\n    \"latest\": (\n        \"This is the development version of the documentation. \"\n        'See <a href=\"https://pyodide.org/\">here</a> for latest stable '\n        \"documentation. Please do not use Pyodide with non \"\n        \"versioned (`dev`) URLs from the CDN for deployed applications!\"\n    )\n}\nversionwarning_body_selector = \"#main-content > div\"\n\nautosummary_generate = True\nautodoc_default_flags = [\"members\", \"inherited-members\"]\n\n# Add modules to be mocked.\nmock_modules = [\"ruamel.yaml\", \"tomli\"]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = [\"_templates\"]\n\n# The suffix(es) of source filenames.\nsource_suffix = [\".rst\", \".md\"]\n\n# The master toctree document.\nmaster_doc = \"index\"\n\n# The language for content autogenerated by Sphinx.\nlanguage = None\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = [\"_build\", \"Thumbs.db\", \".DS_Store\", \"README.md\"]\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = None\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\n#\nhtml_theme = \"sphinx_book_theme\"\nhtml_logo = \"_static/img/pyodide-logo.png\"\n\n# theme-specific options\nhtml_theme_options: dict[str, Any] = {}\n\n# paths that contain custom static files (such as style sheets)\nhtml_static_path = [\"_static\"]\n\n\nhtml_css_files = [\n    \"css/pyodide.css\",\n]\n\n# Custom sidebar templates, must be a dictionary that maps document names\n# to template names.\n# html_sidebars = {}\n\n# -- Options for HTMLHelp output ---------------------------------------------\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = \"Pyodidedoc\"\n\n# A list of files that should not be packed into the epub file.\nepub_exclude_files = [\"search.html\"]\n\n\ndef delete_attrs(cls):\n    for name in dir(cls):\n        if not name.startswith(\"_\"):\n            try:\n                delattr(cls, name)\n            except Exception:\n                pass\n\n\n# Try not to cause side effects if we are imported incidentally.\n\ntry:\n    import sphinx\n\n    IN_SPHINX = hasattr(sphinx, \"application\")\nexcept ImportError:\n    IN_SPHINX = False\n\nIN_READTHEDOCS = \"READTHEDOCS\" in os.environ\n\nif IN_READTHEDOCS:\n    env = {\"PYODIDE_BASE_URL\": CDN_URL}\n    os.makedirs(\"_build/html\", exist_ok=True)\n    res = subprocess.check_output(\n        [\"make\", \"-C\", \"..\", \"docs/_build/html/console.html\"],\n        env=env,\n        stderr=subprocess.STDOUT,\n        encoding=\"utf-8\",\n    )\n    print(res)\n    # insert the Plausible analytics script to console.html\n    console_path = Path(\"_build/html/console.html\")\n    console_html = console_path.read_text().splitlines(keepends=True)\n    for idx, line in enumerate(list(console_html)):\n        if 'pyodide.js\">' in line:\n            # insert the analytics script after the `pyodide.js` script\n            console_html.insert(\n                idx,\n                '<script defer data-domain=\"pyodide.org\" src=\"https://plausible.io/js/plausible.js\"></script>\\n',\n            )\n            break\n    else:\n        raise ValueError(\"Could not find pyodide.js in the <head> section\")\n    console_path.write_text(\"\".join(console_html))\n\n\nif IN_SPHINX:\n    # Compatibility shims. sphinx-js and sphinxcontrib-napoleon have not been updated for Python 3.10\n    import collections\n    from typing import Callable, Mapping\n\n    collections.Mapping = Mapping  # type: ignore[attr-defined]\n    collections.Callable = Callable  # type: ignore[attr-defined]\n\n    base_dir = Path(__file__).resolve().parent.parent\n    path_dirs = [\n        str(base_dir),\n        str(base_dir / \"pyodide-build\"),\n        str(base_dir / \"docs/sphinx_pyodide\"),\n        str(base_dir / \"src/py\"),\n        str(base_dir / \"packages/micropip/src\"),\n    ]\n    sys.path = path_dirs + sys.path\n\n    import micropip  # noqa: F401\n    import pyodide\n\n    # We hacked it so that autodoc will look for submodules, but only if we import\n    # them here. TODO: look these up in the source directory?\n    import pyodide.code\n    import pyodide.console\n    import pyodide.ffi.wrappers\n    import pyodide.http\n    import pyodide.webloop\n\n    # The full version, including alpha/beta/rc tags.\n    release = version = pyodide.__version__\n    html_title = f\"Version {version}\"\n\n    shutil.copy(\"../src/core/pyproxy.ts\", \"../src/js/pyproxy.gen.ts\")\n    shutil.copy(\"../src/core/error_handling.ts\", \"../src/js/error_handling.gen.ts\")\n    js_source_path = [str(x) for x in Path(\"../src/js\").glob(\"*.ts\")]\n\n    def remove_pyproxy_gen_ts():\n        Path(\"../src/js/pyproxy.gen.ts\").unlink(missing_ok=True)\n\n    atexit.register(remove_pyproxy_gen_ts)\n\n    os.environ[\"PATH\"] += f':{str(Path(\"../src/js/node_modules/.bin\").resolve())}'\n    print(os.environ[\"PATH\"])\n    if IN_READTHEDOCS:\n        subprocess.run([\"npm\", \"ci\"], cwd=\"../src/js\")\n    elif not shutil.which(\"typedoc\"):\n        raise Exception(\n            \"Before building the Pyodide docs you must run 'npm install' in 'src/js'.\"\n        )\n\n    # Prevent API docs for webloop methods: they are the same as for base event loop\n    # and it clutters api docs too much\n    delete_attrs(pyodide.webloop.WebLoop)\n    delete_attrs(pyodide.webloop.WebLoopPolicy)\n    delete_attrs(pyodide.console.PyodideConsole)\n\n    for module in mock_modules:\n        sys.modules[module] = mock.Mock()\n\n\n# https://github.com/sphinx-doc/sphinx/issues/4054\ndef globalReplace(app, docname, source):\n    result = source[0]\n    for key in app.config.global_replacements:\n        result = result.replace(key, app.config.global_replacements[key])\n    source[0] = result\n\n\nglobal_replacements = {\"{{PYODIDE_CDN_URL}}\": CDN_URL}\n\n\ndef setup(app):\n    app.add_config_value(\"global_replacements\", {}, True)\n    app.connect(\"source-read\", globalReplace)\n", "path": "docs/conf.py"}]}