Skip to content

Commit 55b84a6

Browse files
committed
feat: 🔨 add Panache Markdown formatter
1 parent ff9b194 commit 55b84a6

15 files changed

Lines changed: 104 additions & 68 deletions

File tree

.config/panache.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
flavor = "quarto"
2+
exclude = [".git/", ".github/", "LICENSE.md", "README.md"]
3+
4+
[format]
5+
tab-width = 2
6+
7+
[linters]
8+
r = "jarl"
9+
python = "ruff"
10+
rust = "clippy"
11+
12+
[formatters]
13+
r = "air"
14+
python = "ruff"
15+
rust = "rustfmt"

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
with:
5757
command: check
5858

59-
# Install uv to use git-cliff and rumdl
59+
# Install uv to use git-cliff and panache
6060
- name: Set up uv
6161
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
6262
with:

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ repos:
1010
hooks:
1111
- id: gitleaks
1212

13+
- repo: https://github.com/jolars/panache-pre-commit
14+
rev: v2.51.0
15+
hooks:
16+
- id: panache-format
17+
1318
- repo: https://github.com/pre-commit/pre-commit-hooks
1419
rev: v6.0.0
1520
hooks:
@@ -27,8 +32,3 @@ repos:
2732
rev: v1.47.2
2833
hooks:
2934
- id: typos
30-
31-
- repo: https://github.com/rvben/rumdl-pre-commit
32-
rev: v0.2.26
33-
hooks:
34-
- id: rumdl-fmt # Auto-format

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"tekumara.typos-vscode",
1515
"EditorConfig.EditorConfig",
1616
"samuelcolvin.jinjahtml",
17-
"rvben.rumdl"
17+
"rvben.rumdl",
18+
"jolars.panache"
1819
],
1920
"unwantedRecommendations": []
2021
}

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"perf"
1616
],
1717
"conventional-branch.format": "{Type}/{Branch}",
18-
"[quarto][qmd][jinja]": {
19-
"editor.formatOnSave": false
18+
"[quarto][qmd][md][jinja]": {
19+
"editor.defaultFormatter": "jolars.panache"
2020
},
2121
"files.associations": {
2222
"justfile.jinja": "plaintext",

index.qmd

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,74 +4,72 @@ title: "{{< meta tagline >}}"
44

55
{{< include /docs/includes/_badges.qmd >}}
66

7-
This is a template for creating a new Python package following the
8-
Seedcase structure. Use this template to quickly get started with a new
9-
Python package with all the necessary files and configurations in place,
10-
including for developing the package.
7+
This is a template for creating a new Python package following the Seedcase
8+
structure. Use this template to quickly get started with a new Python package
9+
with all the necessary files and configurations in place, including for
10+
developing the package.
1111

1212
## Features
1313

14-
- Use [uv](https://decisions.seedcase-project.org/why-uv/) to manage the
15-
Python package and for project management.
16-
- Includes a [justfile](https://just.systems/man/en/) for managing
17-
common tasks like building the website and running checks.
18-
- Uses [typos](https://github.com/crate-ci/typos) to check for common
19-
spelling mistakes.
14+
- Use [uv](https://decisions.seedcase-project.org/why-uv/) to manage the Python
15+
package and for project management.
16+
- Includes a [justfile](https://just.systems/man/en/) for managing common tasks
17+
like building the website and running checks.
18+
- Uses [typos](https://github.com/crate-ci/typos) to check for common spelling
19+
mistakes.
2020
- Code formatting and linting with
2121
[ruff](https://decisions.seedcase-project.org/why-ruff/).
2222
- Run checks with [pre-commit](https://pre-commit.com/) hooks to ensure
23-
consistent formatting and style across the project. It includes checks
24-
for credentials, typos, and file formatting.
25-
- GitHub workflows for automatically adding Pull Requests and Issues to
26-
a project board.
23+
consistent formatting and style across the project. It includes checks for
24+
credentials, typos, and file formatting.
25+
- GitHub workflows for automatically adding Pull Requests and Issues to a
26+
project board.
2727
- Pull Request template for easy creation of new Pull Requests.
28-
- Includes [GitHub Actions](https://docs.github.com/en/actions) for
29-
continuous integration, testing, and delivery for running checks,
30-
formatting, releasing, and building the Python package and associated
31-
documentation.
28+
- Includes [GitHub Actions](https://docs.github.com/en/actions) for continuous
29+
integration, testing, and delivery for running checks, formatting, releasing,
30+
and building the Python package and associated documentation.
3231
- Pull Request template for easy creation of new Pull Requests.
3332
- [VS Code](https://code.visualstudio.com/) settings commonly used by
3433
contributors working in VS Code.
3534
- Includes an [EditorConfig](https://editorconfig.org/) file to ensure
3635
consistent formatting across different editors.
37-
- [`CITATION.cff`](https://citation-file-format.github.io/) file for
38-
citation information.
39-
- Python package folder and file structure that takes advantage of
40-
Python's packaging ecosystem.
36+
- [`CITATION.cff`](https://citation-file-format.github.io/) file for citation
37+
information.
38+
- Python package folder and file structure that takes advantage of Python's
39+
packaging ecosystem.
4140
- [`pyproject.toml`](https://peps.python.org/pep-0518/) for tracking
4241
dependencies and project metadata.
43-
- Uses [Quarto](https://quarto.org/) Markdown for the website content,
44-
allowing for easy integration of code, text, and figures.
42+
- Uses [Quarto](https://quarto.org/) Markdown for the website content, allowing
43+
for easy integration of code, text, and figures.
4544
- Uses
4645
[git-cliff](https://decisions.seedcase-project.org/why-changelog-with-git-cliff/)
4746
to automatically create the changelog.
4847
- Automates Git tagging and GitHub releases with
4948
[Cocogitto](https://decisions.seedcase-project.org/why-semantic-release-with-cocogitto/)
50-
that are based on messages following
51-
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits/).
52-
- Uses a [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/)
53-
license for the website content.
54-
- Uses an [MIT](https://decisions.seedcase-project.org/why-mit-license/)
55-
license for the code.
49+
that are based on messages following [Conventional
50+
Commits](https://decisions.seedcase-project.org/why-conventional-commits/).
51+
- Uses a [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/) license for
52+
the website content.
53+
- Uses an [MIT](https://decisions.seedcase-project.org/why-mit-license/) license
54+
for the code.
5655
- Optionally uses the
57-
[`seedcase-theme`](https://github.com/seedcase-project/seedcase-theme)
58-
Quarto extension for a standard appearance across websites.
56+
[`seedcase-theme`](https://github.com/seedcase-project/seedcase-theme) Quarto
57+
extension for a standard appearance across websites.
5958
- Uses [Netlify](https://www.netlify.com/) for hosting the website.
60-
- Includes a [GoatCounter](https://www.goatcounter.com/) file for
61-
website visitor tracking, which is privacy-friendly and does not use
62-
cookies. That means it doesn't need a GDPR notice as no personal data
63-
is collected.
64-
- Uses [rumdl](https://rumdl.dev/) to format Markdown files so that they
65-
are standardized and consistent across the project, as well as being
66-
easier to read in raw form.
67-
- Checks URLs with [Lychee](https://lychee.cli.rs) to ensure they aren't
68-
broken or blocked.
59+
- Includes a [GoatCounter](https://www.goatcounter.com/) file for website
60+
visitor tracking, which is privacy-friendly and does not use cookies. That
61+
means it doesn't need a GDPR notice as no personal data is collected.
62+
- Uses [rumdl](https://rumdl.dev/) and [Panache](https://panache.bz/) to format
63+
Markdown files so that they are standardized and consistent across the
64+
project, as well as being easier to read in raw form.
65+
- Checks URLs with [Lychee](https://lychee.cli.rs) to ensure they aren't broken
66+
or blocked.
6967

7068
## Want to contribute?
7169

72-
We would love your feedback or contributions! Head over to our
73-
[GitHub repository]({{< meta links.github >}}) to share your ideas or
74-
contribute code. Your input makes us better!
70+
We would love your feedback or contributions! Head over to our [GitHub
71+
repository]({{< meta links.github >}}) to share your ideas or contribute code.
72+
Your input makes us better!
7573

7674
### Contributors
7775

justfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ check-all: check-spelling check-urls
4949

5050
# Format Markdown files
5151
format-md:
52+
# Use both rumdl and panache, for different purposes
5253
uvx rumdl fmt --silent
53-
# includes option doesn't work with Jinja files, so do manually
54+
# `includes` option doesn't work with Jinja files, so do manually
5455
uvx rumdl fmt --silent **/*.qmd.jinja **/*.md.jinja
56+
uvx --from panache-cli panache format . --quiet
5557

5658
# Test template creation with specific parameters: LIST
5759
test for_seedcase="true" hosting_provider="netlify":

template/.config/cog.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ branch_whitelist = ["main"]
55
pre_bump_hooks = [
66
# Quiet the log output of git-cliff, it is noisy.
77
"RUST_LOG='none' uvx git-cliff --tag {{version}}",
8-
"uvx rumdl fmt CHANGELOG.md --silent",
8+
"uvx --from panache-cli panache format CHANGELOG.md --quiet",
99
"uv version {{version}}",
1010
"git commit CHANGELOG.md pyproject.toml uv.lock -m 'build: 🔖 update version to {{version}} [skip ci]'",
1111
]

template/.config/panache.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
flavor = "quarto"
2+
exclude = [".git/", ".github/", "LICENSE.md", "README.md"]
3+
4+
[format]
5+
tab-width = 2
6+
7+
[linters]
8+
r = "jarl"
9+
python = "ruff"
10+
rust = "clippy"
11+
12+
[formatters]
13+
r = "air"
14+
python = "ruff"
15+
rust = "rustfmt"

template/.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
with:
6161
command: check
6262

63-
# Install uv to use git-cliff and rumdl
63+
# Install uv to use git-cliff and panache
6464
- name: Set up uv
6565
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
6666
with:

0 commit comments

Comments
 (0)