Add live reloading (#1786)

Replace the existing webserver target with a live-reloading target.

Adds a dependency on https://github.com/executablebooks/sphinx-autobuild
This commit is contained in:
Flaviu Tamas 2022-01-25 08:49:20 -05:00 committed by GitHub
parent 497258cae7
commit 0469882912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 10 deletions

View File

@ -15,4 +15,4 @@ RUN pip3 install --no-cache-dir --no-binary :all: -r requirements.txt
EXPOSE 8000
WORKDIR /data/esphomedocs
CMD ["make", "webserver"]
CMD ["make", "live-html"]

View File

@ -1,10 +1,12 @@
ESPHOME_PATH = ../esphome
ESPHOME_REF = 2022.1.2
.PHONY: html html-strict cleanhtml deploy help webserver Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png minify
.PHONY: html html-strict cleanhtml deploy help live-html Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png minify
html:
sphinx-build -M html . _build -j auto -n $(O)
live-html:
sphinx-autobuild . _build -j auto -n $(O) --host 0.0.0.0
html-strict:
sphinx-build -M html . _build -W -j auto -n $(O)
@ -48,9 +50,6 @@ copy-svg2png:
netlify: netlify-dependencies netlify-api html copy-svg2png
webserver: html
cd "_build/html" && python3 -m http.server
lint: html-strict
python3 travis.py

View File

@ -110,15 +110,12 @@ To check your documentation changes locally, you first need install Sphinx (with
# in ESPHome-Docs repo:
pip install -r requirements.txt
Then, use the provided Makefile to build the changes and start a simple web server:
Then, use the provided Makefile to build the changes and start a live-updating web server:
.. code-block:: bash
# Start web server on port 8000
make webserver
# Updates then happen via:
make html
make live-html
Notes
*****

View File

@ -1 +1,2 @@
sphinx==4.3.2
sphinx-autobuild==2021.3.14