component-docs
component-docs copied to clipboard
Add syntax highlighting to WIT documentation
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:
- [x] Sized lists:
list<u8, 4> - [x] feature gates
- [x]
streamandfuturetypes - [x] nested comments