Skip to content

Commit

Permalink
chore: support PDF from nox (pybind#3121)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii authored Jul 15, 2021
1 parent 55f6f6e commit 1b10292
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1b10292

Please sign in to comment.