summaryrefslogtreecommitdiff
path: root/doc/conf.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2019-11-24 14:33:01 +0100
committerGeorg Brandl <georg@python.org>2019-11-24 14:33:01 +0100
commit0f2c308957d8c7c5ed6a64309d20211aeb27e44d (patch)
treea4971e596c9562ae43bf4f1562a044f466e4ffa2 /doc/conf.py
parent7a72527427c86045b81e59995382961dba6e22e7 (diff)
downloadpygments-git-0f2c308957d8c7c5ed6a64309d20211aeb27e44d.tar.gz
add pyodide-based demo for the website
Diffstat (limited to 'doc/conf.py')
-rw-r--r--doc/conf.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/doc/conf.py b/doc/conf.py
index c744b4d1..3ab5c2e2 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -129,7 +129,10 @@ html_sidebars = {'index': ['indexsidebar.html', 'searchbox.html']}
# Additional templates that should be rendered to pages, maps page names to
# template names.
-#html_additional_pages = {}
+if os.environ.get('WEBSITE_BUILD'):
+ html_additional_pages = {
+ 'demo': 'demo.html',
+ }
# If false, no module index is generated.
#html_domain_indices = True
@@ -217,3 +220,11 @@ man_pages = [
# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'http://docs.python.org/': None}
+
+
+def pg_context(app, pagename, templatename, ctx, event_arg):
+ ctx['demo_active'] = bool(os.environ.get('WEBSITE_BUILD'))
+
+
+def setup(app):
+ app.connect('html-page-context', pg_context)