Skip to content

Commit f15a7a9

Browse files
authored
Use giallo instead of syntect (#3044)
* Use giallo instead of syntect * Update * Remove all submodules * Update contributing docs * Update docs * Update changelog
1 parent 95ba13a commit f15a7a9

File tree

245 files changed

+629
-47191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+629
-47191
lines changed

.gitmodules

Lines changed: 0 additions & 78 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,53 @@
22

33
## 0.22.0 (unreleased)
44

5+
### Breaking
6+
Syntect has been replaced with [Giallo](https://github.com/getzola/giallo) and all the highlighting options
7+
of the `markdown` section in the config file have been moved/changed in `[markdown.highlighting].
8+
9+
The themes are different so you will need to find something you like from <https://textmate-grammars-themes.netlify.app/>.
10+
11+
Migration:
12+
13+
**Single theme:**
14+
```toml
15+
# Before
16+
[markdown]
17+
highlight_code = true
18+
highlight_theme = "base16-ocean-dark"
19+
20+
# Now
21+
[markdown.highlighting]
22+
theme = "gruvbox-dark"
23+
```
24+
25+
**Class output:**
26+
```toml
27+
# Before
28+
[markdown]
29+
highlight_code = true
30+
highlight_theme = "css"
31+
highlight_themes_css = [
32+
{ theme = "base16-ocean-dark", filename = "syntax-theme-dark.css" },
33+
{ theme = "base16-ocean-light", filename = "syntax-theme-light.css" },
34+
]
35+
36+
# Now
37+
[markdown.highlighting]
38+
theme = "gruvbox-dark"
39+
style = "class"
40+
```
41+
42+
For more information on how to handle light/dark themes as well as details about CSS generation and required CSS,
43+
see the [documentation](https://www.getzola.org/documentation/content/syntax-highlighting/).
44+
45+
Some grammar names have changed as well, I recommend to set up the following:
46+
47+
```toml
48+
[markdown.highlighting]
49+
error_on_missing_language = true
50+
```
51+
552
## 0.21.0 (2025-07-14)
653

754
- Allow `github_alerts` at config.toml level

CONTRIBUTING.md

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -19,60 +19,6 @@ If you want to work on an issue, please mention it in a comment to avoid potenti
1919
any questions on how to approach it do not hesitate to ping me (@keats).
2020
Easy issues are tagged with `help wanted` and/or `good first issue`
2121

22-
## Adding syntax highlighting languages and themes
22+
## Adding syntax highlighting languages, themes or aliases
2323

24-
### Adding a syntax
25-
Syntax highlighting depends on submodules so ensure you load them first:
26-
27-
```bash
28-
$ git submodule update --init
29-
```
30-
31-
Zola only works with syntaxes in the `.sublime-syntax` format. If your syntax
32-
is in `.tmLanguage` format, open it in Sublime Text and convert it to `sublime-syntax` by clicking on
33-
Tools > Developer > New Syntax from ... and put it in the `sublime/syntaxes` directory.
34-
35-
You can also add a submodule to the repository of the wanted syntax:
36-
37-
```bash
38-
$ cd sublime/syntaxes/extra
39-
$ git submodule add https://github.com/elm-community/SublimeElmLanguageSupport
40-
```
41-
42-
Note that you can also only copy manually the updated syntax definition file but this means
43-
Zola won't be able to automatically update it.
44-
45-
You can check for any updates to the current packages by running:
46-
47-
```bash
48-
$ git submodule update --remote --merge
49-
```
50-
51-
And finally from the root of the components/config crate run the following command:
52-
53-
```bash
54-
$ cargo run --example generate_sublime synpack ../../sublime/syntaxes ../../sublime/syntaxes/newlines.packdump
55-
```
56-
57-
### Adding a theme
58-
A gallery containing lots of themes is located at https://tmtheme-editor.glitch.me/#!/editor/theme/Solarized%20(light).
59-
More themes can be easily added to Zola, just make a PR with the wanted theme added in the `sublime/themes` directory.
60-
61-
If you want to test Zola with a new theme, it needs to be built into the syntect file `all.themedump`.
62-
63-
First build the tool to generate the syntect file:
64-
65-
```bash
66-
$ git clone https://github.com/getzola/zola.git && cd zola/components/config
67-
$ cargo build --example generate_sublime
68-
```
69-
70-
copy your theme in `sublime/themes/`, then regenerate the syntect file:
71-
72-
``` bash
73-
$ ./target/debug/examples/generate_sublime themepack sublime/themes/ sublime/themes/all.themedump
74-
```
75-
76-
You should see the list of themes being added.
77-
78-
To test your new theme, rebuild Zola with `cargo build`.
24+
Open an issue on the [Giallo repository](https://github.com/getzola/giallo).

Cargo.lock

Lines changed: 42 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)