summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authoramitkummer <49096391+amitkummer@users.noreply.github.com>2022-05-21 18:56:08 +0300
committerGitHub <noreply@github.com>2022-05-21 17:56:08 +0200
commitcbcbffea1b1f8edf4b824edadbb181f5143ce9ab (patch)
tree10043832a312f0312368620e970cf720dde5a2d5 /README.rst
parent78e2a410033e53481bc33bf7b192145c63dc6623 (diff)
downloadpygments-git-cbcbffea1b1f8edf4b824edadbb181f5143ce9ab.tar.gz
Overhaul demo and support running it locally (#2141)
* Add Make target for building Pyodide with currently checked out Pygments Add a target to the documentation's Makefile to make Pyodide with Pygments from the current checkout. Additionally, use this target when building the documentation with the demo page. The new target works by building Pyodide on a Docker container, and then exporting the build artifacts back to the host. The Dockerfile used by the new target is based on the Dockerfile which was used for building Pyodide on the CI: https://github.com/pygments/pyodide-artifacts/blob/master/container/Dockerfile The main difference between the two is that the new Dockerfile uses the newest Pyodide base image, which is built by a repository which is actively maintained (the Iodide project is no longer maintained). The purpose of this change is to allow running the demo locally, which was not possible previously, as Pyodide was only built by the CI when deploying to Github Pages. * Add instructions on how to run the demo locally to the README * Update demo to work with Pyodide v0.20 Remove usage of Pyodide functionality which was deprecated in Pyodide v0.17: - Loading Pyodide using `languagePluginURL` and `languagePluginLoader`. - Access to globals via `pyodide.globals.x` has changed to `pyodide.globals.get("x")`. Source: https://pyodide.org/en/stable/project/release-notes/v0.17.0.html?highlight=languageplugin#api-changes * Fix #2137 * Fix use of `styles` variable before it's defined The `styles` variable was being used before it's value was set (which is done when Pyodide finishes loading). * Remove GitHub action for building Pyodide This action is obsolete, as building Pyodide is now done using `make pyodide`. * Upgrade Pages deployment action version * Add to .dockerignore all files in .gitignore * Change `pyodide` target to be a phony target
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst18
1 files changed, 16 insertions, 2 deletions
diff --git a/README.rst b/README.rst
index 9974cbbe..e9633e05 100644
--- a/README.rst
+++ b/README.rst
@@ -16,8 +16,22 @@ Documentation
... can be found online at https://pygments.org/ or created with Sphinx by ::
- cd doc
- make html
+ make docs
+
+By default, the documentation does not include the demo page, as it requires
+having Docker installed for building Pyodide. To build the documentation with
+the demo page, use ::
+
+ WEBSITE_BUILD=1 make docs
+
+The initial build might take some time, but subsequent ones should be instant
+because of Docker caching.
+
+To view the generated documentation, serve it using Python's ``http.server``
+module (this step is required for the demo to work) ::
+
+ python3 -m http.server --directory doc/_build/html
+
Development
-----------