From: Florimond Manca Date: Thu, 10 Oct 2019 12:02:17 +0000 (+0200) Subject: Allow serving docs via nox (#450) X-Git-Tag: 0.7.5~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65b8593c7c389b06c5f38fb24caec52c6b157999;p=thirdparty%2Fhttpx.git Allow serving docs via nox (#450) --- diff --git a/docs/contributing.md b/docs/contributing.md index fb52785f..ca569e81 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -102,17 +102,12 @@ $ nox -s test -- tests/test_multipart.py ## Documenting -To work with the documentation, make sure you have `mkdocs` and -`mkdocs-material` installed on your environment: +Documentation pages are located under the `docs/` folder. -```shell -$ pip install mkdocs mkdocs-material -``` - -To spawn the docs server run: +To run the documentation site locally (useful for previewing changes), use: ```shell -$ mkdocs serve +$ nox -s serve ``` ## Releasing diff --git a/noxfile.py b/noxfile.py index 341fa7de..acd8fce5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -2,6 +2,7 @@ import nox nox.options.stop_on_first_error = True nox.options.reuse_existing_virtualenvs = True +nox.options.keywords = "not serve" source_files = ("httpx", "tools", "tests", "setup.py", "noxfile.py") @@ -48,6 +49,13 @@ def docs(session): session.run("mkdocs", "build") +@nox.session(reuse_venv=True) +def serve(session): + session.install("--upgrade", "mkdocs", "mkdocs-material") + + session.run("mkdocs", "serve") + + @nox.session(python=["3.6", "3.7", "3.8"]) def test(session): session.install("--upgrade", "-r", "test-requirements.txt")