Skip to content

Commit e80e7f0

Browse files
committed
fix: can't make a directory conditional
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 3f6575d commit e80e7f0

8 files changed

+23
-9
lines changed

cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"maturin": "Maturin - Compiled Rust (recommended)"
4848
},
4949
"docs": {
50-
"__prompt__": "Chose your documentation tool",
50+
"__prompt__": "Choose your documentation tool",
5151
"sphinx": "Sphinx",
5252
"mkdocs": "MkDocs"
5353
},

docs/pages/guides/docs.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ with render_cookie(backend="hatch", docs="sphinx") as package:
6969
docs_index_md = package.joinpath("docs/index.md").read_text(encoding="utf-8").strip()
7070
readthedocs_yaml = package.joinpath(".readthedocs.yaml").read_text(encoding="utf-8").strip()
7171
noxfile = Matcher.from_file(package / "noxfile.py")
72-
with render_cookie(backend="hatch", docs="sphinx") as package:
72+
with render_cookie(backend="hatch", docs="mkdocs") as package:
73+
mkdocs_conf_yaml = package.joinpath("mkdocs.yml").read_text(encoding="utf-8").strip()
7374
noxfile_mkdocs = Matcher.from_file(package / "noxfile.py")
7475
readthedocs_yaml_mkdocs = package.joinpath(".readthedocs.yaml").read_text(encoding="utf-8").strip()
7576
]]] -->
@@ -304,12 +305,18 @@ example configuration now.
304305

305306
Here's the whole file for completeness. We'll break it into sections underneath.
306307

308+
<!-- [[[cog
309+
with code_fence("yaml"):
310+
print(mkdocs_conf_yaml)
311+
]]] -->
312+
<!-- prettier-ignore-start -->
307313
```yaml
308-
site_name: some_project
309-
site_url: https://some_project.readthedocs.io/
310-
site_author: "Bruce Wayne"
311-
repo_name: "wayne_industries/some_project"
312-
repo_url: "https://github.com/wayne_industries/some_project"
314+
site_name: package
315+
site_url: https://package.readthedocs.io/
316+
site_author: "My Name"
317+
318+
repo_name: "org/package"
319+
repo_url: "https://github.com/org/package"
313320

314321
theme:
315322
name: material
@@ -357,6 +364,8 @@ nav:
357364
- Home: index.md
358365
- Python API: api.md
359366
```
367+
<!-- prettier-ignore-end -->
368+
<!-- [[[end]]] -->
360369
361370
First, the basic site metadata contains authors, repository details, URLs, etc:
362371
@@ -605,7 +614,7 @@ def docs(session: nox.Session) -> None:
605614
"""
606615
607616
doc_deps = nox.project.dependency_groups(PROJECT, "docs")
608-
session.install("{% if cookiecutter.backend != "mesonpy" %}-e{% endif %}.", *doc_deps)
617+
session.install("-e.", *doc_deps)
609618
session.run("mkdocs", "serve", "--clean")
610619
```
611620
<!-- prettier-ignore-end -->

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,18 @@ scikit-hep = "sp_repo_review.families:get_families"
8383
[dependency-groups]
8484
dev = [
8585
{ include-group = "test" },
86+
{ include-group = "cog" },
8687
"repo-review[cli]",
8788
"validate-pyproject-schema-store[all]",
8889
]
8990
test = [
9091
"pytest >=7",
9192
"repo-review >=0.10.6",
9293
]
94+
cog = [
95+
"cogapp",
96+
"cookiecutter",
97+
]
9398

9499
[tool.hatch]
95100
version.source = "vcs"

{{cookiecutter.project_name}}/{% if cookiecutter.docs == 'mkdocs' %}docs{% endif %}/api.md renamed to {{cookiecutter.project_name}}/docs/{% if cookiecutter.docs == 'mkdocs' %}api.md{% endif %}

File renamed without changes.

{{cookiecutter.project_name}}/{% if cookiecutter.docs == 'mkdocs' %}docs{% endif %}/index.md renamed to {{cookiecutter.project_name}}/docs/{% if cookiecutter.docs == 'mkdocs' %}index.md{% endif %}

File renamed without changes.

{{cookiecutter.project_name}}/{% if cookiecutter.docs == 'sphinx' %}docs{% endif %}/conf.py renamed to {{cookiecutter.project_name}}/docs/{% if cookiecutter.docs == 'sphinx' %}conf.py{% endif %}

File renamed without changes.

{{cookiecutter.project_name}}/{% if cookiecutter.docs == 'sphinx' %}docs{% endif %}/index.md renamed to {{cookiecutter.project_name}}/docs/{% if cookiecutter.docs == 'sphinx' %}index.md{% endif %}

File renamed without changes.

{{cookiecutter.project_name}}/{% if cookiecutter.docs=='mkdocs' %}mkdocs.yml{% endif %}

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ theme:
1616
- navigation.tracking
1717
- toc.follow
1818
palette:
19-
# See options to customise your colour scheme here:
19+
# See options to customise your colour scheme here:
2020
# https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/
2121
- media: "(prefers-color-scheme: light)"
2222
scheme: default

0 commit comments

Comments
 (0)