bytecodealliance / bytecodealliance/component-docs
Add syntax highlighting to WIT documentation
- 主要言語
- Rust
- スター
- 137
- フォーク
- 88
- 平均マージ
- 5日 12時間
- マージ済み PR(30日)
- 4
説明
WIT code is currently unhighlighted as [highlight.js](https://highlightjs.org/) does not support WIT currently. Using the [`mdbook-treesitter`](https://github.com/Corpauration/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](https://github.com/Corpauration/mdbook-treesitter) (`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`](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#:~:text=list%3Cu8%2C%204%3E;)
- [x] [feature gates](https://github.com/mkatychev/tree-sitter-wit/commit/9edb9528bc69fcb4552aa0cfd9d3c50b78946807)
- [x] [`stream` and `future` types](https://github.com/liamwh/tree-sitter-wit/pull/15)
- [x] [nested comments](https://github.com/mkatychev/tree-sitter-wit/commit/129157bfad15f9c3c142c60625ef3cd88b33e453)
コントリビューションガイド
評価
この issue はまだ評価されていません。