Deploy console.html as part of the documentation (#1445)

This commit is contained in:
Roman Yurchak 2021-04-13 23:14:37 +02:00 committed by GitHub
parent f063719e98
commit 60c1e04b15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -75,6 +75,13 @@ build/console.html: src/templates/console.html
cp $< $@
sed -i -e 's#{{ PYODIDE_BASE_URL }}#$(PYODIDE_BASE_URL)#g' $@
.PHONY: docs/_build/html/console.html
docs/_build/html/console.html: src/templates/console.html
cp $< $@
sed -i -e 's#{{ PYODIDE_BASE_URL }}#$(PYODIDE_BASE_URL)#g' $@
.PHONY: build/webworker.js
build/webworker.js: src/webworker.js
cp $< $@

View File

@ -3,9 +3,11 @@
# -- Path setup --------------------------------------------------------------
import os
import sys
from typing import Dict, Any
import pathlib
import subprocess
base_dir = pathlib.Path(__file__).resolve().parent.parent
path_dirs = [
@ -102,3 +104,14 @@ htmlhelp_basename = "Pyodidedoc"
# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]
if "READTHEDOCS" in os.environ:
env = {"PYODIDE_BASE_URL": "https://cdn.jsdelivr.net/pyodide/dev/full/"}
os.makedirs("_build/html", exist_ok=True)
res = subprocess.check_output(
["make", "-C", "..", "docs/_build/html/console.html"],
env=env,
stderr=subprocess.STDOUT,
encoding="utf-8",
)
print(res)