Closed
Description
Feature already in Vim?
No!
Feature description
Now that we bundle a (mostly) working treesitter parser for help files, we can have nice things: properly syntax-highlighted code examples. This involves the following steps:
- extend the vimdoc parser to support language annotation for code markers (e.g.,
>lua
) and add the corresponding injections to the bundled queries (feat: annotated code blocks tree-sitter-vimdoc#65) - add corresponding conceal rules to
syntax/help.vim
to fall back gracefully if treesitter is disabled (feat(help): highlighted codeblocks #21154) - adapt the HTML documentation generator script to turn annotated blocks into highlighted code blocks (using https://highlightjs.org? feat: add highlight.js neovim.github.io#303)
- successively rewrite the (Neovim-specific) help pages to add the right language annotations (start with all files titled "NVIM REFERENCE MANUAL")
- change
gen_vimdoc.py
to handle annotated<pre>
codeblocks - add annotation to
<pre>
blocks in Lua and C docstrings - profit!