Skip to content

Commit

Permalink
🔨 Update docs.py script to enable dirty reload conditionally (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo authored Aug 9, 2024
1 parent 23ed7b5 commit 53ccae1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scripts/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def verify_readme() -> None:


@app.command()
def live() -> None:
def live(dirty: bool = False) -> None:
"""
Serve with livereload a docs site for a specific language.
Expand All @@ -89,11 +89,10 @@ def live() -> None:
en.
"""
# Enable line numbers during local development to make it easier to highlight
subprocess.run(
["mkdocs", "serve", "--dev-addr", "127.0.0.1:8008", "--dirty"],
env={**os.environ, "LINENUMS": "true"},
check=True,
)
args = ["mkdocs", "serve", "--dev-addr", "127.0.0.1:8008"]
if dirty:
args.append("--dirty")
subprocess.run(args, env={**os.environ, "LINENUMS": "true"}, check=True)


@app.command()
Expand Down

0 comments on commit 53ccae1

Please sign in to comment.