Skip to content

Commit

Permalink
Merge pull request #274 from humitos/build-readthedocs
Browse files Browse the repository at this point in the history
Build on Read the Docs
  • Loading branch information
pradyunsg committed Sep 30, 2021
2 parents 5527d43 + ac81fa8 commit ab8a6a9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2

build:
os: "ubuntu-20.04"
tools:
python: "3.10"
nodejs: "14"

sphinx:
configuration: docs/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- doc
11 changes: 11 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import os
import subprocess
import sys

# add the demo python code to the path, so that it can be used to demonstrate
Expand Down Expand Up @@ -87,3 +88,13 @@
"</a>!"
)
}

# Generate JS/CSS assets before running Sphinx on Read the Docs
if os.environ.get("READTHEDOCS") == "True":
subprocess.run(
[
"npx",
"gulp",
"build",
]
)

0 comments on commit ab8a6a9

Please sign in to comment.