Skip to content

Commit f6a9056

Browse files
authored
Merge pull request #205 from python-project-templates/docs/frontmatter-formatting
Preserve Markdown frontmatter and check documentation sources
2 parents 5ff720b + 81129aa commit f6a9056

16 files changed

Lines changed: 40 additions & 32 deletions

‎python/cpp/Makefile.jinja‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ lint-cpp: ## run cpp linter
3030
clang-format --dry-run -Werror -i -style=file `find ./cpp -name "*.*pp"`
3131

3232
lint-docs: ## lint docs with mdformat and codespell
33-
python -m mdformat --check README.md {% if add_wiki %}docs/wiki/{% endif %}
34-
python -m codespell_lib README.md {% if add_wiki %}docs/wiki/{% endif %}
33+
python -m mdformat --check README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
34+
python -m codespell_lib README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
3535

3636
lint: lint-cpp lint-py ## run project linters
3737

@@ -47,8 +47,8 @@ fix-cpp: ## fix cpp formatting
4747
clang-format -i -style=file `find ./cpp -name "*.*pp"`
4848

4949
fix-docs: ## autoformat docs with mdformat and codespell
50-
python -m mdformat README.md {% if add_wiki %}docs/wiki/{% endif %}
51-
python -m codespell_lib --write README.md {% if add_wiki %}docs/wiki/{% endif %}
50+
python -m mdformat README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
51+
python -m codespell_lib --write README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
5252

5353
fix: fix-cpp fix-py fix-docs ## run project autoformatters
5454

‎python/cpp/pyproject.toml.jinja‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ develop = [
4949
"hatch-cpp{% if add_pyodide %}>=0.5.0{% endif %}",
5050
"hatchling",
5151
"mdformat",
52+
"mdformat-frontmatter",
5253
"mdformat-tables>=1",
5354
"pybind11",
5455
"pytest",

‎python/cppjswasm/Makefile.jinja‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ lint-cpp: ## run C++ linter
5858
make -C cpp lint
5959

6060
lint-docs: ## lint docs with mdformat and codespell
61-
python -m mdformat --check README.md {% if add_wiki %}docs/wiki/{% endif %}
62-
python -m codespell_lib README.md {% if add_wiki %}docs/wiki/{% endif %}
61+
python -m mdformat --check README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
62+
python -m codespell_lib README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
6363

6464
lint: lint-cpp lint-js lint-py lint-docs ## run project linters
6565

@@ -78,8 +78,8 @@ fix-cpp: ## fix C++ formatting
7878
make -C cpp fix
7979

8080
fix-docs: ## autoformat docs with mdformat and codespell
81-
python -m mdformat README.md {% if add_wiki %}docs/wiki/{% endif %}
82-
python -m codespell_lib --write README.md {% if add_wiki %}docs/wiki/{% endif %}
81+
python -m mdformat README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
82+
python -m codespell_lib --write README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
8383

8484
fix: fix-cpp fix-js fix-py fix-docs ## run project autoformatters
8585

‎python/cppjswasm/pyproject.toml.jinja‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ develop = [
5353
"hatchling",
5454
"pybind11",
5555
"mdformat",
56+
"mdformat-frontmatter",
5657
"mdformat-tables>=1",
5758
"pytest",
5859
"pytest-cov",

‎python/cython/Makefile.jinja‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ lint-py: ## lint Python with ruff
1818
python -m ruff format --check {{ module }}
1919

2020
lint-docs: ## lint documentation
21-
python -m mdformat --check README.md docs/development.md{% if add_wiki %} docs/wiki/{% endif %}
22-
python -m codespell_lib README.md docs/development.md{% if add_wiki %} docs/wiki/{% endif %}
21+
python -m mdformat --check README.md docs/development.md $(wildcard docs/src){% if add_wiki %} docs/wiki/{% endif %}
22+
python -m codespell_lib README.md docs/development.md $(wildcard docs/src){% if add_wiki %} docs/wiki/{% endif %}
2323

2424
fix-py: ## autoformat Python code
2525
python -m ruff check --fix {{ module }}
2626
python -m ruff format {{ module }}
2727

2828
fix-docs: ## autoformat documentation
29-
python -m mdformat README.md docs/development.md{% if add_wiki %} docs/wiki/{% endif %}
30-
python -m codespell_lib --write README.md docs/development.md{% if add_wiki %} docs/wiki/{% endif %}
29+
python -m mdformat README.md docs/development.md $(wildcard docs/src){% if add_wiki %} docs/wiki/{% endif %}
30+
python -m codespell_lib --write README.md docs/development.md $(wildcard docs/src){% if add_wiki %} docs/wiki/{% endif %}
3131

3232
lint: lint-py lint-docs ## run all linters
3333
lints: lint

‎python/cython/pyproject.toml.jinja‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ develop = [
5050
"hatch-cython",
5151
"hatchling",
5252
"mdformat",
53+
"mdformat-frontmatter",
5354
"mdformat-tables>=1",
5455
"pytest",
5556
"pytest-cov",

‎python/js/Makefile.jinja‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ lint-js: ## run js linter
4343
cd js; pnpm lint
4444

4545
lint-docs: ## lint docs with mdformat and codespell
46-
python -m mdformat --check README.md {% if add_wiki %}docs/wiki/{% endif %}
47-
python -m codespell_lib README.md {% if add_wiki %}docs/wiki/{% endif %}
46+
python -m mdformat --check README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
47+
python -m codespell_lib README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
4848

4949
lint: lint-js lint-py lint-docs ## run project linters
5050

@@ -60,8 +60,8 @@ fix-js: ## fix js formatting
6060
cd js; pnpm fix
6161

6262
fix-docs: ## autoformat docs with mdformat and codespell
63-
python -m mdformat README.md {% if add_wiki %}docs/wiki/{% endif %}
64-
python -m codespell_lib --write README.md {% if add_wiki %}docs/wiki/{% endif %}
63+
python -m mdformat README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
64+
python -m codespell_lib --write README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
6565

6666
fix: fix-js fix-py fix-docs ## run project autoformatters
6767

‎python/js/pyproject.toml.jinja‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ develop = [
4747
"hatch-js",
4848
"hatchling",
4949
"mdformat",
50+
"mdformat-frontmatter",
5051
"mdformat-tables>=1",
5152
"pytest",
5253
"pytest-cov",

‎python/jupyter/Makefile.jinja‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ lint-js: ## run js linter
4545
cd js; pnpm lint
4646

4747
lint-docs: ## lint docs with mdformat and codespell
48-
python -m mdformat --check README.md {% if add_wiki %}docs/wiki/{% endif %}
49-
python -m codespell_lib README.md {% if add_wiki %}docs/wiki/{% endif %}
48+
python -m mdformat --check README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
49+
python -m codespell_lib README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
5050

5151
lint: lint-js lint-py lint-docs ## run project linters
5252

@@ -62,8 +62,8 @@ fix-js: ## fix js formatting
6262
cd js; pnpm fix
6363

6464
fix-docs: ## autoformat docs with mdformat and codespell
65-
python -m mdformat README.md {% if add_wiki %}docs/wiki/{% endif %}
66-
python -m codespell_lib --write README.md {% if add_wiki %}docs/wiki/{% endif %}
65+
python -m mdformat README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
66+
python -m codespell_lib --write README.md $(wildcard docs/src) {% if add_wiki %}docs/wiki/{% endif %}
6767

6868
fix: fix-js fix-py fix-docs ## run project autoformatters
6969

‎python/jupyter/pyproject.toml.jinja‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ develop = [
5454
"hatchling",
5555
"jupyter-builder>=1.2.3,<2",
5656
"mdformat",
57+
"mdformat-frontmatter",
5758
"mdformat-tables>=1",
5859
"jupyterlab>=4,<5",
5960
"pytest",

0 commit comments

Comments
 (0)