From 1b10292c0597a497cdee43dcba731bcdd1ce0c49 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 15 Jul 2021 16:54:40 -0400 Subject: [PATCH] chore: support PDF from nox (#3121) --- noxfile.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/noxfile.py b/noxfile.py index 3bc61273..f0f66801 100644 --- a/noxfile.py +++ b/noxfile.py @@ -53,14 +53,18 @@ def docs(session: nox.Session) -> None: session.install("-r", "docs/requirements.txt") session.chdir("docs") + + if "pdf" in session.posargs: + session.run("sphinx-build", "-M", "latexpdf", ".", "_build") + return + session.run("sphinx-build", "-M", "html", ".", "_build") - if session.posargs: - if "serve" in session.posargs: - print("Launching docs at http://localhost:8000/ - use Ctrl-C to quit") - session.run("python", "-m", "http.server", "8000", "-d", "_build/html") - else: - print("Unsupported argument to docs") + if "serve" in session.posargs: + session.log("Launching docs at http://localhost:8000/ - use Ctrl-C to quit") + session.run("python", "-m", "http.server", "8000", "-d", "_build/html") + elif session.posargs: + session.error("Unsupported argument to docs") @nox.session(reuse_venv=True)