Skip to content

Commit 22ddefd

Browse files
committed
moved docs scripts to invoke
1 parent a7fefb9 commit 22ddefd

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

pyproject.toml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,23 @@ test = [
6868
"pytest-mock==3.14.0",
6969
"coverage==7.6.9",
7070
]
71+
docs = [
72+
"mkdocs==1.6.1",
73+
"mkdocstrings[python]==0.27.0",
74+
"mkdocs-material==9.5.44",
75+
"pymdown-extensions==10.12",
76+
"mkdocs-gen-files==0.5.0",
77+
"mkdocs-literate-nav==0.6.1",
78+
"mkdocs-include-markdown-plugin==7.1.2",
79+
]
7180
dev = [
7281
"ipython==8.30.0",
7382
"pre-commit==4.0.1",
7483
"zimscraperlib[scripts]",
7584
"zimscraperlib[lint]",
7685
"zimscraperlib[test]",
7786
"zimscraperlib[check]",
87+
"zimscraperlib[docs]",
7888
]
7989

8090
[project.scripts]
@@ -137,22 +147,11 @@ pyright = "inv check-pyright --args '{args}'"
137147
all = "inv checkall --args '{args}'"
138148

139149
[tool.hatch.envs.docs]
140-
template = "docs"
141-
detached = true
142-
dependencies = [
143-
"mkdocs==1.6.1",
144-
"mkdocstrings[python]==0.27.0",
145-
"mkdocs-material==9.5.44",
146-
"pymdown-extensions==10.12",
147-
"mkdocs-gen-files==0.5.0",
148-
"mkdocs-literate-nav==0.6.1",
149-
"mkdocs-include-markdown-plugin==7.1.2",
150-
"black==24.10.0",
151-
]
150+
features = ["scripts", "docs"]
152151

153152
[tool.hatch.envs.docs.scripts]
154-
serve = "mkdocs serve"
155-
build = "mkdocs build"
153+
serve = "inv docs-serve --args '{args}'"
154+
build = "inv docs-build --args '{args}'"
156155

157156
[tool.black]
158157
line-length = 88

tasks.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,17 @@ def fixall(ctx: Context, args: str = "."):
108108
fix_black(ctx, args)
109109
fix_ruff(ctx, args)
110110
lintall(ctx, args)
111+
112+
113+
@task(optional=["args"], help={"args": "mkdocs build additional arguments"})
114+
def docs_build(ctx: Context, args: str = ""):
115+
"""build mkdocs documentation"""
116+
args = args or "" # needed for hatch script
117+
ctx.run(f"mkdocs build {args}", pty=use_pty)
118+
119+
120+
@task(optional=["args"], help={"args": "mkdocs serve additional arguments"})
121+
def docs_serve(ctx: Context, args: str = ""):
122+
"""serve mkdocs documentation locally"""
123+
args = args or "" # needed for hatch script
124+
ctx.run(f"mkdocs serve {args}", pty=use_pty)

0 commit comments

Comments
 (0)