Skip to content

Commit 6e513c9

Browse files
committed
fix: colorize toml blocks
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
1 parent 66766f5 commit 6e513c9

16 files changed

Lines changed: 55 additions & 54 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,4 @@ The noxfile generates temporary projects for **all 9 backends** × **vcs on/off*
8585
- Tab-sets use `:sync: <tab-name>` for cross-page tab synchronization, where the
8686
sync key is the tab label itself (e.g., `sphinx`, `mkdocs`,
8787
`trusted-publishing`, `scikit-build-core`).
88+
- TOML code bloacks use "ini" to get syntax highlighting for now.

docs/_partials/pyproject.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ with code_fence("toml"):
1414
print(pyproject.get_source("project"))
1515
]]] -->
1616
<!-- rumdl-disable MD013 -->
17-
```toml
17+
```ini
1818
[project]
1919
name = "package"
2020
version = "0.1.0"
@@ -82,7 +82,7 @@ other tools often did the wrong thing (such as load the entire file into the
8282
metadata's free-form one line text field that was intended to describe
8383
deviations from the classifier license(s)).
8484

85-
```toml
85+
```ini
8686
classifiers = [
8787
"License :: OSI Approved :: BSD License",
8888
]
@@ -100,7 +100,7 @@ package or wheel name when installing, like `package[cli,mpl]`.
100100

101101
Here is an example of a simple extras:
102102

103-
```toml
103+
```ini
104104
[project.optional-dependencies]
105105
cli = [
106106
"click",
@@ -118,7 +118,7 @@ Self dependencies can be used by using the name of the package, such as
118118
If you want to ship an "app" that a user can run from the command line, you need
119119
to add a `script` entry point. The form is:
120120

121-
```toml
121+
```ini
122122
[project.scripts]
123123
cliapp = "package.__main__:main"
124124
```
@@ -146,7 +146,7 @@ with code_fence("toml"):
146146
print(pyproject.get_source("dependency-groups"))
147147
]]] -->
148148
<!-- rumdl-disable MD013 -->
149-
```toml
149+
```ini
150150
[dependency-groups]
151151
test = [
152152
"pytest >=9",

docs/pages/guides/coverage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ There is a configuration section in `pyproject.toml` for coverage. Here are some
9898
common options
9999
[(see the docs for more)](https://coverage.readthedocs.io/en/latest/config.html):
100100

101-
```toml
101+
```ini
102102
[tool.coverage]
103103
run.core = "sysmon"
104104
run.disable_warnings = ["no-sysmon"]

docs/pages/guides/docs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ and MkDocs diverge.
8989

9090
Setting a `docs` dependency group looks like this:
9191

92-
```toml
92+
```ini
9393
[dependency-groups]
9494
docs = [
9595
"furo",
@@ -279,7 +279,7 @@ If you selected the `mkdocs` option when using the template cookie-cutter
279279
repository, you will already have this group. Otherwise, add to your
280280
`pyproject.toml`:
281281

282-
```toml
282+
```ini
283283
[dependency-groups]
284284
docs = [
285285
"markdown>=3.9",

docs/pages/guides/gha_wheels.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Since these variables will be used by all jobs, you could make them available in
4545
your `pyproject.toml` file, so they can be used everywhere (even locally for
4646
Linux and Windows):
4747

48-
```toml
48+
```ini
4949
[tool.cibuildwheel]
5050
test-groups = ["test"]
5151
test-command = "pytest {project}/tests"

docs/pages/guides/packaging_classic.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ library or if you access package metadata.
5050

5151
Packages should provide a `pyproject.toml` file that _at least_ looks like this:
5252

53-
```toml
53+
```ini
5454
[build-system]
5555
requires = ["setuptools>=42"]
5656
build-backend = "setuptools.build_meta"
@@ -88,7 +88,7 @@ You may want to build against NumPy (mostly for Cython packages, pybind11 does
8888
not need to access the NumPy headers). This is the recommendation for scientific
8989
Python packages supporting older versions of NumPy:
9090

91-
```toml
91+
```ini
9292
requires = [
9393
"oldest-supported-numpy",
9494
```
@@ -124,7 +124,7 @@ Scientific Python packages should use one of the following systems:
124124
125125
One more section is very useful in your `pyproject.toml` file:
126126
127-
```toml
127+
```ini
128128
requires = [
129129
"setuptools>=42",
130130
"setuptools_scm[toml]>=3.4",
@@ -348,7 +348,7 @@ SDist structure that shows up in another place in the package, then replace
348348
With the exception of flake8, all package configuration should be possible via
349349
`pyproject.toml`, such as pytest (6+):
350350

351-
```toml
351+
```ini
352352
[tool.pytest]
353353
junit_family = "xunit2"
354354
testpaths = ["tests"]

docs/pages/guides/packaging_compiled.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ with code_fence("toml"):
7676
print(skbuild_pyproject.get_source("build-system"))
7777
]]] -->
7878
<!-- rumdl-disable MD013 -->
79-
```toml
79+
```ini
8080
[build-system]
8181
requires = ["pybind11", "scikit-build-core>=0.12"]
8282
build-backend = "scikit_build_core.build"
@@ -91,7 +91,7 @@ with code_fence("toml"):
9191
print(mesonpy_pyproject.get_source("build-system"))
9292
]]] -->
9393
<!-- rumdl-disable MD013 -->
94-
```toml
94+
```ini
9595
[build-system]
9696
requires = ["meson-python>=0.18", "pybind11"]
9797
build-backend = "mesonpy"
@@ -106,7 +106,7 @@ with code_fence("toml"):
106106
print(maturin_pyproject.get_source("build-system"))
107107
]]] -->
108108
<!-- rumdl-disable MD013 -->
109-
```toml
109+
```ini
110110
[build-system]
111111
requires = ["maturin>=1.9,<2"]
112112
build-backend = "maturin"
@@ -132,7 +132,7 @@ with code_fence("toml"):
132132
print(skbuild_pyproject.get_source("tool.scikit-build"))
133133
]]] -->
134134
<!-- rumdl-disable MD013 -->
135-
```toml
135+
```ini
136136
[tool.scikit-build]
137137
minimum-version = "build-system.requires"
138138
build-dir = "build/{wheel_tag}"
@@ -153,7 +153,7 @@ with code_fence("toml"):
153153
print(maturin_pyproject.get_source("tool.maturin"))
154154
]]] -->
155155
<!-- rumdl-disable MD013 -->
156-
```toml
156+
```ini
157157
[tool.maturin]
158158
module-name = "package._core"
159159
python-source = "src"
@@ -247,7 +247,7 @@ with code_fence("toml"):
247247
print(maturin_cargo_toml)
248248
]]] -->
249249
<!-- rumdl-disable MD013 -->
250-
```toml
250+
```ini
251251
[package]
252252
name = "package"
253253
version = "0.1.0"

docs/pages/guides/packaging_simple.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ selects the backend:
4545
::::{tab-set}
4646
:::{tab-item} Hatchling
4747

48-
```toml
48+
```ini
4949
[build-system]
5050
requires = ["hatchling"]
5151
build-backend = "hatchling.build"
@@ -54,7 +54,7 @@ build-backend = "hatchling.build"
5454
:::
5555
:::{tab-item} uv_build
5656

57-
```toml
57+
```ini
5858
[build-system]
5959
requires = ["uv_build>=0.7.19"]
6060
build-backend = "uv_build"
@@ -63,7 +63,7 @@ build-backend = "uv_build"
6363
:::
6464
:::{tab-item} Flit-core
6565

66-
```toml
66+
```ini
6767
[build-system]
6868
requires = ["flit_core>=3.12"]
6969
build-backend = "flit_core.buildapi"
@@ -72,7 +72,7 @@ build-backend = "flit_core.buildapi"
7272
:::
7373
:::{tab-item} PDM-backend
7474

75-
```toml
75+
```ini
7676
[build-system]
7777
requires = ["pdm-backend"]
7878
build-backend = "pdm.backend"
@@ -81,7 +81,7 @@ build-backend = "pdm.backend"
8181
:::
8282
:::{tab-item} Setuptools
8383

84-
```toml
84+
```ini
8585
[build-system]
8686
requires = ["setuptools>=61.0"]
8787
build-backend = "setuptools.build_meta"
@@ -129,7 +129,7 @@ in a file or use git.
129129
You will always need to specify that the version will be supplied dynamically
130130
with:
131131

132-
```toml
132+
```ini
133133
dynamic = ["version"]
134134
```
135135

@@ -139,15 +139,15 @@ Then you'll configure your backend to compute the version.
139139
You can tell hatchling to get the version from VCS. Add `hatch-vcs` to your
140140
`build-backend.requires`, then add the following configuration:
141141

142-
```toml
142+
```ini
143143
[tool.hatch]
144144
version.source = "vcs"
145145
build.hooks.vcs.version-file = "src/<package>/version.py"
146146
```
147147

148148
Or you can tell it to look for it in a file (see docs for arbitrary regex's):
149149

150-
```toml
150+
```ini
151151
[tool.hatch]
152152
version.path = "src/<package>/__init__.py"
153153
```

docs/pages/guides/pytest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ is an example configuration:
6666
::::{tab-set}
6767
:::{tab-item} Pytest 9+
6868

69-
```toml
69+
```ini
7070
[tool.pytest]
7171
minversion = "9.0"
7272
addopts = ["-ra", "--showlocals"]
@@ -81,7 +81,7 @@ testpaths = [
8181
:::
8282
:::{tab-item} Pytest 6+
8383

84-
```toml
84+
```ini
8585
[tool.pytest.ini_options]
8686
minversion = "6.0"
8787
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]

docs/pages/guides/style.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ won't tell you what or why it fixed things.
251251
::::{tab-set}
252252
:::{tab-item} Simple config
253253

254-
```toml
254+
```ini
255255
[tool.ruff.lint]
256256
extend-select = [
257257
"B", # flake8-bugbear
@@ -264,7 +264,7 @@ extend-select = [
264264
:::
265265
:::{tab-item} Full config
266266

267-
```toml
267+
```ini
268268
[tool.ruff.lint]
269269
extend-select = [
270270
"ARG", # flake8-unused-arguments
@@ -317,7 +317,7 @@ typing-modules = ["mypackage._compat.typing"]
317317
:::
318318
:::{tab-item} Ignore-based config
319319

320-
```toml
320+
```ini
321321
[tool.ruff.lint]
322322
select = ["ALL"]
323323
ignore = [
@@ -372,7 +372,7 @@ needed if just set to `["src"]` in Ruff 0.6+. {rr}`RF003`
372372
If you don't use a `[project]` table (older setuptools or Poetry), then you
373373
should also set:
374374

375-
```toml
375+
```ini
376376
target-version = "py39"
377377
```
378378

@@ -691,7 +691,7 @@ it from PyPI. Run it on your repository and see what it says. If you want to
691691
ignore files (like test folders, example folders, docs, etc) you can add these
692692
into your `pyproject.toml` file:
693693

694-
```toml
694+
```ini
695695
[tool.check-manifest]
696696
ignore = [
697697
".travis.yml",
@@ -795,7 +795,7 @@ integration.
795795

796796
To configure it, you can use this section in `pyproject.toml`:
797797

798-
```toml
798+
```ini
799799
[tool.typos.default.extend-words]
800800
nd = "nd"
801801
sur = "sur"
@@ -962,7 +962,7 @@ pre-commit, since it needs to have your package installed - it is less static of
962962
check than Ruff or Flake8. Here is a suggested `pyproject.toml` entry to get you
963963
started:
964964

965-
```toml
965+
```ini
966966
[tool.pylint]
967967
py-version = "3.10"
968968
jobs = "0"

0 commit comments

Comments
 (0)