mirror of
https://github.com/Dasharo/Openness-Score.git
synced 2026-06-13 19:16:16 -07:00
Add live HTML preview
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -1,5 +1,6 @@
|
||||
bluepy
|
||||
sphinx
|
||||
sphinx-autobuild
|
||||
sphinx-rtd-theme
|
||||
matplotlib
|
||||
pycodestyle
|
||||
pycodestyle
|
||||
|
||||
Reference in New Issue
Block a user