diff --git a/Dockerfile b/Dockerfile index 6c9bcfa57..78290dcf3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/Makefile b/Makefile index 299899da9..1f1afb7eb 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/guides/contributing.rst b/guides/contributing.rst index a8bedbe66..e260a563a 100644 --- a/guides/contributing.rst +++ b/guides/contributing.rst @@ -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 ***** diff --git a/requirements.txt b/requirements.txt index c2bc27aa2..fd427e3c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ sphinx==4.3.2 +sphinx-autobuild==2021.3.14