Add live HTML preview

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
This commit is contained in:
Michał Żygowski
2023-05-31 12:43:29 +02:00
parent 9c6a1a13e7
commit be8cd94afc
4 changed files with 21 additions and 7 deletions
+4 -1
View File
@@ -12,7 +12,10 @@ BUILDDIR = build
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
livehtml:
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help livehtml Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
+11 -5
View File
@@ -88,7 +88,7 @@ For more details please refer to the [methodology documentation](docs/methodolog
Python requirements:
```
```bash
virtualenv -p $(which python3) venv
source venv/bin/activate
pip install -r requirements.txt
@@ -102,14 +102,20 @@ We use [Python Docstring](https://peps.python.org/pep-0257/) in
[Sphinx format](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html)
to generate detailed code documentation automatically.
To view the documentation run the following:
To generate the documentation run the following:
```
```bash
(venv) make html
(venv) python -m http.server -d build/html 8080
python -m http.server 8000
```
Open the web browser and type `localhost:8080` as address. Or alternatively
For live preview run:
```bash
(venv) make livehtml
```
Open the web browser and type `localhost:8000` as address. Or alternatively
open `build/html/index.html` file in the web browser directly.
## Checking Python style
+4
View File
@@ -24,6 +24,7 @@ if errorlevel 9009 (
)
if "%1" == "" goto help
if "%1" == "livehtml" goto help
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
@@ -31,5 +32,8 @@ goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:livehtml
sphinx-autobuild %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
+2 -1
View File
@@ -1,5 +1,6 @@
bluepy
sphinx
sphinx-autobuild
sphinx-rtd-theme
matplotlib
pycodestyle
pycodestyle