2022-12-08 01:57:24 +03:00
|
|
|
# tree-sitter-d2
|
|
|
|
|
|
|
|
d2 grammar for tree-sitter.
|
|
|
|
|
2022-12-08 02:22:58 +03:00
|
|
|
References:
|
2023-03-21 10:26:57 +03:00
|
|
|
|
2022-12-08 02:22:58 +03:00
|
|
|
- https://d2lang.com/
|
|
|
|
|
|
|
|
## Highlights
|
|
|
|
|
|
|
|
![screenshot](./assets/screenshot.png)
|
|
|
|
|
2022-12-10 23:15:19 +03:00
|
|
|
# Install
|
|
|
|
|
|
|
|
## Neovim
|
|
|
|
|
|
|
|
Using `nvim-treesitter`, add to your configuration
|
|
|
|
|
|
|
|
```lua
|
|
|
|
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
|
|
|
parser_config.d2 = {
|
|
|
|
install_info = {
|
2023-03-21 10:26:57 +03:00
|
|
|
url = 'https://git.pleshevski.ru/pleshevskiy/tree-sitter-d2',
|
2022-12-21 13:13:56 +03:00
|
|
|
revision = 'main',
|
2022-12-10 23:15:19 +03:00
|
|
|
files = { 'src/parser.c', 'src/scanner.cc' },
|
|
|
|
},
|
|
|
|
filetype = 'd2',
|
|
|
|
};
|
|
|
|
```
|
2023-06-15 12:09:18 +03:00
|
|
|
|
|
|
|
# Mirrors
|
|
|
|
|
|
|
|
- [Git Pleshevski](https://git.pleshevski.ru/pleshevskiy/tree-sitter-d2)
|
|
|
|
- [Codeberg](https://codeberg.org/p8i/tree-sitter-d2)
|