Skip to content

Comments

Replace syntect with giallo for syntax highlighting.#350

Open
dflock wants to merge 4 commits intonlopes:mainfrom
dflock:replace-syntect-with-giallo
Open

Replace syntect with giallo for syntax highlighting.#350
dflock wants to merge 4 commits intonlopes:mainfrom
dflock:replace-syntect-with-giallo

Conversation

@dflock
Copy link

@dflock dflock commented Feb 21, 2026

I played around with the syntax highlighting for a while and discovered that syntect isn't actually all that good - there are lots of issues here: https://github.com/getzola/zola/issues?q=is%3Aissue%20state%3Aclosed%20replace%20syntect - and the zola project eventually ended up developing giallo to replace it: https://github.com/getzola/giallo - summary of why:

syntect is using old Sublime Text syntaxes, it doesn't support features that recent syntaxes use (see trishume/syntect#271). Projects like bat keep their own curated set of grammars, sometimes applying patches to fix things. The Rust syntax for example is about 6 years old and does not know about async/await. VSCode is also a LOT more popular than Sublime these days.

Giallo has been developed to replace syntect usage in Zola.

So syntect is very out of date, using very old syntax definitions - and doesn't support things like typescript at all, which I needed.

So, I asked Claude Opus to replace syntect with giallo and this is the result.

It passes all the tests, compiles and it works! The syntax highlighting is much better, it supports all the languages and themes from VSCode, which is ~everything.

Caveat Emptor: I am an experienced developer, but not a rust dev. I kept a close eye on what Calude was up to and it seemed reasonable to me! One issue is that I checked acdc & giallo out into a new folder, next to each other, so I think that Claude has imported giallo from the sibling folder, rather than... importing the public crate, or whatever you are supposed to do?

I've attached the initial prompt, the plan produced, as well as the full output from Claude, just in case you wanted to check anything.

Anyway, I'm making this PR so that, if you wish, you can have a look and see what you think? Please don't feel obliged to wade through this if you don't want to, much less merge it, unless you think it's worthwhile.

1 - initial-prompt.md
2 - Plan to Replace syntect with giallo in acdc.md
3 - claude-opus-thread-1.md

@dflock dflock changed the title Initial claude syntect->giallo commit Replace syntect with giallo for syntax highlighting. Feb 21, 2026
@nlopes
Copy link
Owner

nlopes commented Feb 21, 2026

I'll take a look, this is still early that I'd be happy just killing syntect (not precious at all about it) but the rest of the changes I'll have to take a look.

Specifically, want to think a bit if I want one highlight or end up with support for many (like asciidoctor does).

@nlopes
Copy link
Owner

nlopes commented Feb 23, 2026

giallo depends on orig-regset which in turn seems to have a dependency on a c/c++ libraryoniguruma, meaning it can't compile to wasm32-unknown-unknown.

And I want to be able to compile to wasm32-unknown-unknown so that I can use the html converter in acdc-editor-wasm.

I think the best approach is likely to keep syntect as a fallback for wasm and giallo as the default (or vice versa). Not sure which yet.

@dflock
Copy link
Author

dflock commented Feb 23, 2026

Apparently Giallo is working on replacing oniguruma, for similar reasons: getzola/giallo#21 - and appears to be quite close to replacing it with fancy-regex: fancy-regex/fancy-regex#162

@nlopes
Copy link
Owner

nlopes commented Feb 23, 2026

Nice! Then I'll keep this open and keep an eye on those issues. Once they're sorted I'll finish this up.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants