Skip to content

Commit

Permalink
build(tasks): add docstring to tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Nov 6, 2023
1 parent 06f47d5 commit f55fd87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ def stop_api_server_container(

@task(help={"clean": "clean the docs before building"})
def build_docs(ctx: Context, clean: bool = False) -> None:
"""Build sphinx docs"""
with ctx.cd(docs_root):
if clean:
ctx.run("make clean")
ctx.run("make html")


@task()
def serve_docs(ctx: Context) -> None:
@task(help={"rebuild": "clean and build the doc before serving"})
def serve_docs(ctx: Context, rebuild: bool = False) -> None:
"""Serve the docs locally (http://127.0.0.1:8000)"""
with ctx.cd(docs_root / Path("_build/html")):
ctx.run("python -m http.server")

0 comments on commit f55fd87

Please sign in to comment.