Skip to content

Commit 1745d60

Browse files
committed
build: migrate template docs from mkdocs to zensical
Replace the generated MkDocs config and overrides with a zensical.toml template plus updated CI and Read the Docs build steps. This also separates distribution_name from package_name and moves shared mise tasks to top-level files so generated projects get cleaner packaging and docs defaults.
1 parent f070b33 commit 1745d60

22 files changed

Lines changed: 286 additions & 360 deletions

.config/cspell.config.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,26 @@ useGitignore: true
1515
words:
1616
- arithmatex
1717
- chtml
18-
- cuda
1918
- direnv
20-
- elif
2119
- envops
2220
- envrc
2321
- fieldz
24-
- getattr
22+
- grimp
2523
- hynek
2624
- inlinehilite
2725
- kwargs
28-
- libc
2926
- liblaf
30-
- mathjax
27+
- linenums
28+
- lucide
3129
- mkdocs
3230
- mkdocstrings
3331
- noxfile
34-
- numprocesses
3532
- numpy
33+
- pipx
3634
- pycache
3735
- pydantic
3836
- pydocstyle
37+
- pygments
3938
- pylint
4039
- pymdownx
4140
- pypa
@@ -47,8 +46,10 @@ words:
4746
- pyvista
4847
- sdist
4948
- strftime
49+
- taiki
5050
- tombi
5151
- trimesh
52-
- uuidgen
52+
- twemoji
5353
- venv
5454
- virtualenv
55+
- zensical

copier.yaml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ _external_data:
1010
_envops:
1111
comment_start_string: "# {#"
1212

13-
_migrations:
14-
- command: rm --force '.github/workflows/bench.yaml'
15-
version: v0.2.0
16-
- command: rm --force '.github/workflows/docs.yaml'
17-
version: v0.2.0
18-
- command: rm --force '.github/workflows/release.yaml'
19-
version: v0.2.0
20-
- command: rm --force '.github/workflows/test.yaml'
21-
version: v0.2.0
22-
2313
_skip_if_exists:
2414
- .gitignore
2515
- .vscode/settings.json
2616
- docs/
27-
- mkdocs.yaml
2817
- noxfile.py
2918
- pyproject.toml
3019
- README.md
3120
- src/
32-
- "!.config/copier/mkdocs.yaml"
21+
- zensical.toml
3322

3423
_subdirectory: template
3524

25+
_tasks:
26+
- rm --force --recursive '.config/copier/mise-tasks'
27+
- rm --force '.config/copier/mkdocs.yaml'
28+
- rm --force '.config/linters/pyrightconfig.json'
29+
- rm --force '.config/mise/conf.d/10-python.toml'
30+
- rm --force '.github/workflows/bench.yaml'
31+
- rm --force '.github/workflows/docs.yaml'
32+
- rm --force '.github/workflows/release.yaml'
33+
- rm --force '.github/workflows/test.yaml'
34+
3635
answers_file_shared:
3736
type: str
37+
help: Path to the shared Copier answers file used to preload project metadata.
3838
default: .config/copier/.copier-answers.shared.yaml
3939

4040
project_name:
@@ -74,37 +74,37 @@ github_repo:
7474

7575
namespace:
7676
type: str
77-
help: e.g. "namespace", ""
77+
help: Python package namespace to prepend to the project package. Leave empty for a top-level package.
7878
default: "{{ github_user }}"
7979

80-
package_dir:
80+
distribution_name:
8181
type: str
82-
help: e.g. "namespace/project_name_slug/", "project_name_slug/"
82+
help: Distribution name used for publishing and installation, such as the PyPI project name.
8383
default: |-
8484
{%- if namespace -%}
85-
{{ namespace | replace('.', '/') | replace('-', '_') }}/{{ project_name_slug | replace('-', '_') }}
85+
{{ namespace | replace('.', '-') | replace('/', '-') }}-{{ project_name_slug }}
8686
{%- else -%}
87-
{{ project_name_slug | replace('-', '_') }}
87+
{{ project_name_slug }}
8888
{%- endif -%}
8989
9090
package_name:
9191
type: str
92-
help: e.g. "namespace-project-name-slug", "project-name-slug"
92+
help: Importable Python package name. Use dots to separate namespace packages.
9393
default: |-
9494
{%- if namespace -%}
95-
{{ namespace | replace('.', '-') | replace('/', '-') }}-{{ project_name_slug | replace('_', '-') }}
95+
{{ namespace | replace('-', '_') }}.{{ project_name_slug | replace('-', '_') }}
9696
{%- else -%}
97-
{{ project_name_slug | replace('_', '-') }}
97+
{{ project_name_slug | replace('-', '_') }}
9898
{%- endif -%}
9999
100-
module_name:
100+
package_dir:
101101
type: str
102-
help: e.g. "namespace.project_name_slug", "project_name_slug"
102+
help: Directory under src/ that contains the package code.
103103
default: |-
104-
{{ package_dir | replace('/', '.') }}
104+
{{ package_name | replace('.', '/') }}
105105
106106
wheel_package_dir:
107107
type: str
108-
help: e.g. "namespace/", "project_name_slug/"
108+
help: Top-level directory under src/ to include in the built wheel.
109109
default: |-
110110
{{ package_dir.split('/') | first }}

template/.config/copier/mise-tasks/gen/init.py renamed to mise-tasks/gen/init.py

File renamed without changes.

template/.config/copier/mise-tasks/install.sh renamed to mise-tasks/install.sh

File renamed without changes.

template/.config/copier/mise-tasks/lint/toml.sh renamed to mise-tasks/lint/toml.sh

File renamed without changes.

template/.config/copier/mise-tasks/upgrade.sh renamed to mise-tasks/upgrade.sh

File renamed without changes.

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#:schema https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/pyproject.json
2+
3+
[tool.ruff.lint]
4+
ignore = ["N999"]
5+
6+
[tool.tombi]
7+
files.include = ["**/*.toml", "**/*.toml.jinja"]
8+
9+
[[tool.tombi.overrides]]
10+
files.include = ["template/pyproject.toml.jinja"]
11+
lint.enabled = false
12+
13+
[tool.ty.rules]
14+
unresolved-import = "ignore"

0 commit comments

Comments
 (0)