chore: support PDF from nox (#3121)

This commit is contained in:
Henry Schreiner 2021-07-15 16:54:40 -04:00 committed by GitHub
parent 55f6f6e9bf
commit 1b10292c05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,14 +53,18 @@ def docs(session: nox.Session) -> None:
session.install("-r", "docs/requirements.txt") session.install("-r", "docs/requirements.txt")
session.chdir("docs") session.chdir("docs")
if "pdf" in session.posargs:
session.run("sphinx-build", "-M", "latexpdf", ".", "_build")
return
session.run("sphinx-build", "-M", "html", ".", "_build") session.run("sphinx-build", "-M", "html", ".", "_build")
if session.posargs:
if "serve" in session.posargs: if "serve" in session.posargs:
print("Launching docs at http://localhost:8000/ - use Ctrl-C to quit") session.log("Launching docs at http://localhost:8000/ - use Ctrl-C to quit")
session.run("python", "-m", "http.server", "8000", "-d", "_build/html") session.run("python", "-m", "http.server", "8000", "-d", "_build/html")
else: elif session.posargs:
print("Unsupported argument to docs") session.error("Unsupported argument to docs")
@nox.session(reuse_venv=True) @nox.session(reuse_venv=True)