component-docs icon indicating copy to clipboard operation
component-docs copied to clipboard

Add syntax highlighting to WIT documentation

Open mkatychev opened this issue 7 months ago • 7 comments

WIT code is currently unhighlighted as highlight.js does not support WIT currently. Using the mdbook-treesitter preprocessor is a good avenue to add syntax highlighting for all WIT codeblocks in the documentation, working example of it in action: https://mkatychev.github.io/component-docs/design/wit.html#worlds

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.

Create issues in https://github.com/bytecodealliance/vscode-wit and https://github.com/liamwh/tree-sitter-wit to support newer component model syntaxes:

mkatychev avatar Apr 09 '25 18:04 mkatychev