You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caveat:
Current mdbook-treesitter outputs grammar logic used for highlighting as dylib file (wit.so) and work is needed adding emscripten support to output a wit.wasm grammar file.
Taking a look at the mdbook-treesitter project, it looks like it "simply translates the tree-sitter highlighting into highlightjs one." So, in the end it sounds like we get the best of both worlds. Does that mean mdbook-treesitter outputs a highlight.js file that we could just regenerate in CI?
Activity
kate-goldenring commentedon Apr 10, 2025
Having WIT syntax highlighting would be great. @mkatychev have you explored updating a
highlight.jsfile? Seems like that is MDbooks default path for adding new syntax highlighting. Here is an example PR where someone adds one.mkatychev commentedon Apr 10, 2025
@kate-goldenring I think the advantages of using tree-sitter over base highlight.js are pretty significant overy hand implementing highlight.js:
kate-goldenring commentedon Apr 10, 2025
Taking a look at the
mdbook-treesitterproject, it looks like it "simply translates the tree-sitter highlighting into highlightjs one." So, in the end it sounds like we get the best of both worlds. Does that meanmdbook-treesitteroutputs ahighlight.jsfile that we could just regenerate in CI?mkatychev commentedon Apr 10, 2025
Yep, that's what it does without the duplicitous maintenance oh having a separate highlight.js grammar to maintain!
mkatychev commentedon Jun 4, 2025
Discussed opening issues in the TextMate and Tree-sitter grammar repos for features such as
streamtypes,futuretypes, and nested comments:mkatychev commentedon Jul 16, 2025
bytecodealliance/governance#129 tree-sitter-wit has been approved to be taken up by bytecodealliance
vados-cosmonic commentedon Jul 16, 2025
Thanks for driving this @mkatychev !