bytecodealliance / bytecodealliance/component-docs

Add syntax highlighting to WIT documentation

Abierto
#238 7 comentarios 0 reacciones 1 asignado Reclamado por @mkatychev Ver en GitHub
Lenguaje dominante
Rust
Estrellas
137
Forks
88
Merge medio
5 d 12 h
PR fusionados (30 d)
4

Descripción

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)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.