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:
parent
497258cae7
commit
0469882912
|
@ -15,4 +15,4 @@ RUN pip3 install --no-cache-dir --no-binary :all: -r requirements.txt
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
WORKDIR /data/esphomedocs
|
WORKDIR /data/esphomedocs
|
||||||
|
|
||||||
CMD ["make", "webserver"]
|
CMD ["make", "live-html"]
|
||||||
|
|
7
Makefile
7
Makefile
|
@ -1,10 +1,12 @@
|
||||||
ESPHOME_PATH = ../esphome
|
ESPHOME_PATH = ../esphome
|
||||||
ESPHOME_REF = 2022.1.2
|
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:
|
html:
|
||||||
sphinx-build -M html . _build -j auto -n $(O)
|
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:
|
html-strict:
|
||||||
sphinx-build -M html . _build -W -j auto -n $(O)
|
sphinx-build -M html . _build -W -j auto -n $(O)
|
||||||
|
@ -48,9 +50,6 @@ copy-svg2png:
|
||||||
|
|
||||||
netlify: netlify-dependencies netlify-api html copy-svg2png
|
netlify: netlify-dependencies netlify-api html copy-svg2png
|
||||||
|
|
||||||
webserver: html
|
|
||||||
cd "_build/html" && python3 -m http.server
|
|
||||||
|
|
||||||
lint: html-strict
|
lint: html-strict
|
||||||
python3 travis.py
|
python3 travis.py
|
||||||
|
|
||||||
|
|
|
@ -110,15 +110,12 @@ To check your documentation changes locally, you first need install Sphinx (with
|
||||||
# in ESPHome-Docs repo:
|
# in ESPHome-Docs repo:
|
||||||
pip install -r requirements.txt
|
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
|
.. code-block:: bash
|
||||||
|
|
||||||
# Start web server on port 8000
|
# Start web server on port 8000
|
||||||
make webserver
|
make live-html
|
||||||
|
|
||||||
# Updates then happen via:
|
|
||||||
make html
|
|
||||||
|
|
||||||
Notes
|
Notes
|
||||||
*****
|
*****
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
sphinx==4.3.2
|
sphinx==4.3.2
|
||||||
|
sphinx-autobuild==2021.3.14
|
||||||
|
|
Loading…
Reference in New Issue