Skip to content

Conversation

@Keats
Copy link
Collaborator

@Keats Keats commented Dec 14, 2025

This won't work until you have giallo checked out in a sibling folder to zola and after running just generate-dump. If you try it on your site, make sure you include the default CSS for giallo:

.giallo-l {
  display: block;
}
.giallo-ln {
  display: inline-block;
  user-select: none;
  white-space: pre;
  margin-right: 0.4em;
  padding: 0.4em;
  min-width: 3ch;
  text-align: right;
  opacity: 0.8;
}

I'll replace the path when rust-onig is released and therefore giallo can be on crates.io. I'll also remove the submodules and update docs etc at that point.

docs/config.toml Outdated

[markdown.highlighting]
theme = "github-dark"

Copy link
Collaborator Author

@Keats Keats Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config has changed to allow more options. Setting a theme (or 2 for light/dark dual theming) will enable highlighting.

@asibahi
Copy link

asibahi commented Dec 19, 2025

Hello.

I am wondering how this works with custom syntax. On my website I have a couple of articles with languages not supported natively, and I’m using separate syntax files. I’m wondering what the path for transferring those would be.

@Keats
Copy link
Collaborator Author

Keats commented Dec 19, 2025

Odin: https://github.com/DanielGavin/ols/blob/master/editors/vscode/syntaxes/odin.tmLanguage.json
smt: https://github.com/soaibsafi/smt-z3-vscode/blob/main/syntaxes/smt.tmLanguage.json

you should be able to download those in your site, add the paths to them in the config

[markdown.highlighting]
extra_grammars = [..., ...]

and it should work

@Dimev
Copy link

Dimev commented Dec 19, 2025

Nice work!
I currently style my code via CSS directly, so it may be nice if theme = "... is not required if style = "class" is present.

Would it also be possible for the .giallo-l spans to be block elements by default, without having to include CSS for this?

@Dimev
Copy link

Dimev commented Dec 19, 2025

Also, is there still a way to generate the css for a given theme?

@Keats
Copy link
Collaborator Author

Keats commented Dec 19, 2025

I currently style my code via CSS directly, so it may be nice if theme = "... is not required if style = "class" is present.

That's not possible, you need a theme to match the actual grammar scopes to theme scopes in textmate and I'm not going to expose that in Zola. How do you style via CSS?

Would it also be possible for the .giallo-l spans to be block elements by default, without having to include CSS for this?

I'd say no, in theory only span are allowed in <code> blocks and I don't want to make that part configurable for the HTML renderer

@Keats
Copy link
Collaborator Author

Keats commented Dec 19, 2025

Also, is there still a way to generate the css for a given theme?

Yes, I've just pushed the updated docs if you want to have a look. I won't have the time to do migration guide today though but it's pretty easy in theory.

@Dimev
Copy link

Dimev commented Dec 19, 2025

That's not possible, you need a theme to match the actual grammar scopes to theme scopes in textmate and I'm not going to expose that in Zola. How do you style via CSS?

Oh, didn't know that. I took a theme I liked and manually modified the colors in the css.

I also see the docs now, thanks!

@asibahi
Copy link

asibahi commented Dec 19, 2025

Odin: https://github.com/DanielGavin/ols/blob/master/editors/vscode/syntaxes/odin.tmLanguage.json smt: https://github.com/soaibsafi/smt-z3-vscode/blob/main/syntaxes/smt.tmLanguage.json

you should be able to download those in your site, add the paths to them in the config

[markdown.highlighting]
extra_grammars = [..., ...]

and it should work

Thanks for the links. Saves me the search effort later. I was mostly pointing out that it is a breaking change that needs addressing (if you don't intend to keep syntect behind as a fallback).

Complete tangent question: Is it possible somehow to annotate inline elements with a language for coloring or not? In other words, something like let x = 4; and I can annotate the inline block being Rust somehow and get Rust coloring?

@Keats
Copy link
Collaborator Author

Keats commented Dec 20, 2025

Saves me the search effort later. I was mostly pointing out that it is a breaking change that needs addressing (if you don't intend to keep syntect behind as a fallback).

I've updated the docs and changelog now so that should be clearer.

Complete tangent question: Is it possible somehow to annotate inline elements with a language for coloring or not? In other words, something like let x = 4; and I can annotate the inline block being Rust somehow and get Rust coloring?

I don't think so? You can't put which language it is in an inline code. Maybe with shortcodes?

@Keats Keats merged commit f15a7a9 into next Dec 21, 2025
42 checks passed
@Keats Keats deleted the giallo branch December 21, 2025 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants