Replace syntect with giallo for syntax highlighting.#350
Replace syntect with giallo for syntax highlighting.#350dflock wants to merge 4 commits intonlopes:mainfrom
Conversation
|
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). |
|
And I want to be able to compile to 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. |
|
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 |
|
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! |
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:
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