|
1 | 1 | # tree-sitter-loongdoc
|
2 | 2 |
|
3 |
| -LoongDoc is normalized asciidoc. LoongDocs make **BEST EFFORT** to keep compatibility with asciidoc. |
4 |
| - |
5 |
| -This repo contains: |
6 |
| - |
7 |
| -- tree-sitter-loongdoc for parse blocks. |
8 |
| -- tree-sitter-loongdoc_inline for parse inline grammar. |
9 |
| -- loongdoc: a wrapper to provide a rust ast. \[WIP] |
10 |
| - |
11 |
| -There two website for this repo: |
12 |
| - |
13 |
| -- <https://cathaysia.github.io/tree-sitter-loongdoc/> current loongdoc spec. |
14 |
| -- <https://tree-sitter-loongdoc.vercel.app/> a playground for loongdoc. |
15 |
| - |
16 |
| -## Usage |
17 |
| - |
18 |
| -add the following lines to your tree-sitter configuration: |
19 |
| - |
20 |
| -### Add this repo to your lazy.nvim config: |
21 |
| - |
22 |
| -```lua |
23 |
| -{ |
24 |
| - 'cathaysia/tree-sitter-loongdoc', |
25 |
| -}, |
26 |
| -``` |
27 |
| - |
28 |
| -```lua |
29 |
| -vim.filetype.add({ |
30 |
| - extension = { |
31 |
| - adoc = 'loongdoc' |
32 |
| - }, |
33 |
| -}) |
34 |
| - |
35 |
| -local parser_config = require('nvim-treesitter.parsers').get_parser_configs() |
36 |
| -parser_config.loongdoc = { |
37 |
| - install_info = { |
38 |
| - url = 'https://github.com/cathaysia/tree-sitter-loongdoc.git', |
39 |
| - files = { 'tree-sitter-loongdoc/src/parser.c', 'tree-sitter-loongdoc/src/scanner.c' }, |
40 |
| - branch = 'master', |
41 |
| - generate_requires_npm = false, |
42 |
| - requires_generate_from_grammar = false, |
43 |
| - }, |
44 |
| -} |
45 |
| -parser_config.loongdoc_inline = { |
46 |
| - install_info = { |
47 |
| - url = 'https://github.com/cathaysia/tree-sitter-loongdoc.git', |
48 |
| - files = { 'tree-sitter-loongdoc_inline/src/parser.c', 'tree-sitter-loongdoc_inline/src/scanner.c' }, |
49 |
| - branch = 'master', |
50 |
| - generate_requires_npm = false, |
51 |
| - requires_generate_from_grammar = false, |
52 |
| - }, |
53 |
| -} |
54 |
| -``` |
| 3 | +[loongdoc](https://cathaysia.github.io/tree-sitter-loongdoc/) grammar for tree-sitter. |
0 commit comments