kramdown-syntax_tree_sitter 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/ext/tree_sitter_adapter/Cargo.lock +168 -146
- data/ext/tree_sitter_adapter/src/tree_sitter_adapter.rs +18 -4
- data/lib/kramdown/syntax_tree_sitter/version.rb +1 -1
- metadata +17 -74
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a04dc6ceb1cee4150c0c893d87d48bdec1edeea51deb0c8fe7481efc7fb34913
|
|
4
|
+
data.tar.gz: b8402223f1bc2752fa043e2d20ac3df02a41ba9edb253f09331c3fb61e692425
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a11c4e18f4d378b5b8bea1498b77a43a0653184b1d549112d70470f22645eebbf58e74432032485a9dd3146bed3330d97068d8bd2363eb7a71a5fbd86d3d4d4f
|
|
7
|
+
data.tar.gz: 398ab77b1edc7c48918cdb28001dc9d69c9c965258cd5404eb20ff65323b71fad77ff33e1ded791e27f8e7ec344a76c6d413f1db28db19a7caa1666b5286feaa
|
data/README.md
CHANGED
|
@@ -23,7 +23,7 @@ hence also requires a compatible [Rust](https://www.rust-lang.org) installation
|
|
|
23
23
|
function. It is officially compatible with the following environments:
|
|
24
24
|
|
|
25
25
|
- **Ruby**: 2.7, 3.0, 3.1, 3.2
|
|
26
|
-
- **Rust**: 1.
|
|
26
|
+
- **Rust**: 1.66, 1.67, 1.68, 1.69
|
|
27
27
|
- **Platforms**: MacOS, Linux
|
|
28
28
|
|
|
29
29
|
### Installation
|
|
@@ -11,15 +11,6 @@ dependencies = [
|
|
|
11
11
|
"memchr",
|
|
12
12
|
]
|
|
13
13
|
|
|
14
|
-
[[package]]
|
|
15
|
-
name = "android_system_properties"
|
|
16
|
-
version = "0.1.5"
|
|
17
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
18
|
-
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
|
|
19
|
-
dependencies = [
|
|
20
|
-
"libc",
|
|
21
|
-
]
|
|
22
|
-
|
|
23
14
|
[[package]]
|
|
24
15
|
name = "ansi_term"
|
|
25
16
|
version = "0.12.1"
|
|
@@ -31,9 +22,9 @@ dependencies = [
|
|
|
31
22
|
|
|
32
23
|
[[package]]
|
|
33
24
|
name = "anyhow"
|
|
34
|
-
version = "1.0.
|
|
25
|
+
version = "1.0.71"
|
|
35
26
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
36
|
-
checksum = "
|
|
27
|
+
checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
|
|
37
28
|
|
|
38
29
|
[[package]]
|
|
39
30
|
name = "ascii"
|
|
@@ -70,6 +61,12 @@ version = "3.11.1"
|
|
|
70
61
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
71
62
|
checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba"
|
|
72
63
|
|
|
64
|
+
[[package]]
|
|
65
|
+
name = "bytes"
|
|
66
|
+
version = "1.4.0"
|
|
67
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
68
|
+
checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
|
|
69
|
+
|
|
73
70
|
[[package]]
|
|
74
71
|
name = "cc"
|
|
75
72
|
version = "1.0.74"
|
|
@@ -77,22 +74,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
77
74
|
checksum = "581f5dba903aac52ea3feb5ec4810848460ee833876f1f9b0fdeab1f19091574"
|
|
78
75
|
|
|
79
76
|
[[package]]
|
|
80
|
-
name = "
|
|
81
|
-
version = "1.
|
|
77
|
+
name = "cesu8"
|
|
78
|
+
version = "1.1.0"
|
|
82
79
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
83
|
-
checksum = "
|
|
80
|
+
checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
|
|
84
81
|
|
|
85
82
|
[[package]]
|
|
86
|
-
name = "
|
|
87
|
-
version = "0.
|
|
83
|
+
name = "cfg-if"
|
|
84
|
+
version = "1.0.0"
|
|
88
85
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
89
|
-
checksum = "
|
|
90
|
-
dependencies = [
|
|
91
|
-
"iana-time-zone",
|
|
92
|
-
"num-integer",
|
|
93
|
-
"num-traits",
|
|
94
|
-
"winapi",
|
|
95
|
-
]
|
|
86
|
+
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|
96
87
|
|
|
97
88
|
[[package]]
|
|
98
89
|
name = "chunked_transfer"
|
|
@@ -116,64 +107,30 @@ dependencies = [
|
|
|
116
107
|
]
|
|
117
108
|
|
|
118
109
|
[[package]]
|
|
119
|
-
name = "
|
|
120
|
-
version = "
|
|
110
|
+
name = "combine"
|
|
111
|
+
version = "4.6.6"
|
|
121
112
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
122
|
-
checksum = "
|
|
113
|
+
checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4"
|
|
123
114
|
dependencies = [
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
]
|
|
127
|
-
|
|
128
|
-
[[package]]
|
|
129
|
-
name = "core-foundation-sys"
|
|
130
|
-
version = "0.8.3"
|
|
131
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
132
|
-
checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
|
|
133
|
-
|
|
134
|
-
[[package]]
|
|
135
|
-
name = "cxx"
|
|
136
|
-
version = "1.0.81"
|
|
137
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
138
|
-
checksum = "97abf9f0eca9e52b7f81b945524e76710e6cb2366aead23b7d4fbf72e281f888"
|
|
139
|
-
dependencies = [
|
|
140
|
-
"cc",
|
|
141
|
-
"cxxbridge-flags",
|
|
142
|
-
"cxxbridge-macro",
|
|
143
|
-
"link-cplusplus",
|
|
115
|
+
"bytes",
|
|
116
|
+
"memchr",
|
|
144
117
|
]
|
|
145
118
|
|
|
146
119
|
[[package]]
|
|
147
|
-
name = "
|
|
148
|
-
version = "
|
|
120
|
+
name = "core-foundation"
|
|
121
|
+
version = "0.9.3"
|
|
149
122
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
150
|
-
checksum = "
|
|
123
|
+
checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"
|
|
151
124
|
dependencies = [
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
"once_cell",
|
|
155
|
-
"proc-macro2",
|
|
156
|
-
"quote",
|
|
157
|
-
"scratch",
|
|
158
|
-
"syn",
|
|
125
|
+
"core-foundation-sys",
|
|
126
|
+
"libc",
|
|
159
127
|
]
|
|
160
128
|
|
|
161
129
|
[[package]]
|
|
162
|
-
name = "
|
|
163
|
-
version = "
|
|
164
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
165
|
-
checksum = "8ca220e4794c934dc6b1207c3b42856ad4c302f2df1712e9f8d2eec5afaacf1f"
|
|
166
|
-
|
|
167
|
-
[[package]]
|
|
168
|
-
name = "cxxbridge-macro"
|
|
169
|
-
version = "1.0.81"
|
|
130
|
+
name = "core-foundation-sys"
|
|
131
|
+
version = "0.8.3"
|
|
170
132
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
171
|
-
checksum = "
|
|
172
|
-
dependencies = [
|
|
173
|
-
"proc-macro2",
|
|
174
|
-
"quote",
|
|
175
|
-
"syn",
|
|
176
|
-
]
|
|
133
|
+
checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
|
|
177
134
|
|
|
178
135
|
[[package]]
|
|
179
136
|
name = "difference"
|
|
@@ -190,6 +147,15 @@ dependencies = [
|
|
|
190
147
|
"dirs-sys",
|
|
191
148
|
]
|
|
192
149
|
|
|
150
|
+
[[package]]
|
|
151
|
+
name = "dirs"
|
|
152
|
+
version = "4.0.0"
|
|
153
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
154
|
+
checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059"
|
|
155
|
+
dependencies = [
|
|
156
|
+
"dirs-sys",
|
|
157
|
+
]
|
|
158
|
+
|
|
193
159
|
[[package]]
|
|
194
160
|
name = "dirs-sys"
|
|
195
161
|
version = "0.3.7"
|
|
@@ -258,28 +224,10 @@ dependencies = [
|
|
|
258
224
|
]
|
|
259
225
|
|
|
260
226
|
[[package]]
|
|
261
|
-
name = "
|
|
262
|
-
version = "0.
|
|
263
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
264
|
-
checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765"
|
|
265
|
-
dependencies = [
|
|
266
|
-
"android_system_properties",
|
|
267
|
-
"core-foundation-sys",
|
|
268
|
-
"iana-time-zone-haiku",
|
|
269
|
-
"js-sys",
|
|
270
|
-
"wasm-bindgen",
|
|
271
|
-
"winapi",
|
|
272
|
-
]
|
|
273
|
-
|
|
274
|
-
[[package]]
|
|
275
|
-
name = "iana-time-zone-haiku"
|
|
276
|
-
version = "0.1.1"
|
|
227
|
+
name = "httpdate"
|
|
228
|
+
version = "1.0.2"
|
|
277
229
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
278
|
-
checksum = "
|
|
279
|
-
dependencies = [
|
|
280
|
-
"cxx",
|
|
281
|
-
"cxx-build",
|
|
282
|
-
]
|
|
230
|
+
checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
|
|
283
231
|
|
|
284
232
|
[[package]]
|
|
285
233
|
name = "idna"
|
|
@@ -307,6 +255,28 @@ version = "1.0.4"
|
|
|
307
255
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
308
256
|
checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc"
|
|
309
257
|
|
|
258
|
+
[[package]]
|
|
259
|
+
name = "jni"
|
|
260
|
+
version = "0.21.1"
|
|
261
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
262
|
+
checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97"
|
|
263
|
+
dependencies = [
|
|
264
|
+
"cesu8",
|
|
265
|
+
"cfg-if",
|
|
266
|
+
"combine",
|
|
267
|
+
"jni-sys",
|
|
268
|
+
"log",
|
|
269
|
+
"thiserror",
|
|
270
|
+
"walkdir",
|
|
271
|
+
"windows-sys",
|
|
272
|
+
]
|
|
273
|
+
|
|
274
|
+
[[package]]
|
|
275
|
+
name = "jni-sys"
|
|
276
|
+
version = "0.3.0"
|
|
277
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
278
|
+
checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
|
|
279
|
+
|
|
310
280
|
[[package]]
|
|
311
281
|
name = "js-sys"
|
|
312
282
|
version = "0.3.60"
|
|
@@ -339,21 +309,21 @@ dependencies = [
|
|
|
339
309
|
]
|
|
340
310
|
|
|
341
311
|
[[package]]
|
|
342
|
-
name = "
|
|
343
|
-
version = "
|
|
312
|
+
name = "log"
|
|
313
|
+
version = "0.4.17"
|
|
344
314
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
345
|
-
checksum = "
|
|
315
|
+
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
|
|
346
316
|
dependencies = [
|
|
347
|
-
"
|
|
317
|
+
"cfg-if",
|
|
348
318
|
]
|
|
349
319
|
|
|
350
320
|
[[package]]
|
|
351
|
-
name = "
|
|
352
|
-
version = "0.
|
|
321
|
+
name = "malloc_buf"
|
|
322
|
+
version = "0.0.6"
|
|
353
323
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
354
|
-
checksum = "
|
|
324
|
+
checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
|
|
355
325
|
dependencies = [
|
|
356
|
-
"
|
|
326
|
+
"libc",
|
|
357
327
|
]
|
|
358
328
|
|
|
359
329
|
[[package]]
|
|
@@ -363,22 +333,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
363
333
|
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
|
364
334
|
|
|
365
335
|
[[package]]
|
|
366
|
-
name = "
|
|
367
|
-
version = "0.1.
|
|
336
|
+
name = "ndk-context"
|
|
337
|
+
version = "0.1.1"
|
|
368
338
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
369
|
-
checksum = "
|
|
370
|
-
dependencies = [
|
|
371
|
-
"autocfg",
|
|
372
|
-
"num-traits",
|
|
373
|
-
]
|
|
339
|
+
checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b"
|
|
374
340
|
|
|
375
341
|
[[package]]
|
|
376
|
-
name = "
|
|
377
|
-
version = "0.2.
|
|
342
|
+
name = "objc"
|
|
343
|
+
version = "0.2.7"
|
|
378
344
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
379
|
-
checksum = "
|
|
345
|
+
checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"
|
|
380
346
|
dependencies = [
|
|
381
|
-
"
|
|
347
|
+
"malloc_buf",
|
|
382
348
|
]
|
|
383
349
|
|
|
384
350
|
[[package]]
|
|
@@ -411,6 +377,12 @@ dependencies = [
|
|
|
411
377
|
"proc-macro2",
|
|
412
378
|
]
|
|
413
379
|
|
|
380
|
+
[[package]]
|
|
381
|
+
name = "raw-window-handle"
|
|
382
|
+
version = "0.5.2"
|
|
383
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
384
|
+
checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9"
|
|
385
|
+
|
|
414
386
|
[[package]]
|
|
415
387
|
name = "redox_syscall"
|
|
416
388
|
version = "0.2.16"
|
|
@@ -479,12 +451,6 @@ dependencies = [
|
|
|
479
451
|
"winapi-util",
|
|
480
452
|
]
|
|
481
453
|
|
|
482
|
-
[[package]]
|
|
483
|
-
name = "scratch"
|
|
484
|
-
version = "1.0.2"
|
|
485
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
486
|
-
checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898"
|
|
487
|
-
|
|
488
454
|
[[package]]
|
|
489
455
|
name = "semver"
|
|
490
456
|
version = "1.0.14"
|
|
@@ -546,15 +512,6 @@ dependencies = [
|
|
|
546
512
|
"unicode-ident",
|
|
547
513
|
]
|
|
548
514
|
|
|
549
|
-
[[package]]
|
|
550
|
-
name = "termcolor"
|
|
551
|
-
version = "1.1.3"
|
|
552
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
553
|
-
checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
|
|
554
|
-
dependencies = [
|
|
555
|
-
"winapi-util",
|
|
556
|
-
]
|
|
557
|
-
|
|
558
515
|
[[package]]
|
|
559
516
|
name = "textwrap"
|
|
560
517
|
version = "0.11.0"
|
|
@@ -586,15 +543,14 @@ dependencies = [
|
|
|
586
543
|
|
|
587
544
|
[[package]]
|
|
588
545
|
name = "tiny_http"
|
|
589
|
-
version = "0.
|
|
546
|
+
version = "0.12.0"
|
|
590
547
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
591
|
-
checksum = "
|
|
548
|
+
checksum = "389915df6413a2e74fb181895f933386023c71110878cd0825588928e64cdc82"
|
|
592
549
|
dependencies = [
|
|
593
550
|
"ascii",
|
|
594
|
-
"chrono",
|
|
595
551
|
"chunked_transfer",
|
|
552
|
+
"httpdate",
|
|
596
553
|
"log",
|
|
597
|
-
"url",
|
|
598
554
|
]
|
|
599
555
|
|
|
600
556
|
[[package]]
|
|
@@ -623,9 +579,9 @@ dependencies = [
|
|
|
623
579
|
|
|
624
580
|
[[package]]
|
|
625
581
|
name = "tree-sitter"
|
|
626
|
-
version = "0.20.
|
|
582
|
+
version = "0.20.10"
|
|
627
583
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
628
|
-
checksum = "
|
|
584
|
+
checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d"
|
|
629
585
|
dependencies = [
|
|
630
586
|
"cc",
|
|
631
587
|
"regex",
|
|
@@ -633,16 +589,16 @@ dependencies = [
|
|
|
633
589
|
|
|
634
590
|
[[package]]
|
|
635
591
|
name = "tree-sitter-cli"
|
|
636
|
-
version = "0.20.
|
|
592
|
+
version = "0.20.8"
|
|
637
593
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
638
|
-
checksum = "
|
|
594
|
+
checksum = "ae7e9d844d4d38e511a7b93fe8ced79f2a364c32fdea10d04546f1c8317d5a0c"
|
|
639
595
|
dependencies = [
|
|
640
596
|
"ansi_term",
|
|
641
597
|
"anyhow",
|
|
642
598
|
"atty",
|
|
643
599
|
"clap",
|
|
644
600
|
"difference",
|
|
645
|
-
"dirs",
|
|
601
|
+
"dirs 3.0.2",
|
|
646
602
|
"glob",
|
|
647
603
|
"html-escape",
|
|
648
604
|
"indexmap",
|
|
@@ -674,7 +630,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
674
630
|
checksum = "f5fec4cb27f052ead2246631b332dba0cb6af9a54ce012badee59c4b0ded5e03"
|
|
675
631
|
dependencies = [
|
|
676
632
|
"anyhow",
|
|
677
|
-
"dirs",
|
|
633
|
+
"dirs 3.0.2",
|
|
678
634
|
"serde",
|
|
679
635
|
"serde_json",
|
|
680
636
|
]
|
|
@@ -698,7 +654,7 @@ checksum = "d0b17eef4833c7c139abed66d562dfa23228e97e647597baf246fd56c21bbfaf"
|
|
|
698
654
|
dependencies = [
|
|
699
655
|
"anyhow",
|
|
700
656
|
"cc",
|
|
701
|
-
"dirs",
|
|
657
|
+
"dirs 3.0.2",
|
|
702
658
|
"libloading",
|
|
703
659
|
"once_cell",
|
|
704
660
|
"regex",
|
|
@@ -866,13 +822,19 @@ dependencies = [
|
|
|
866
822
|
|
|
867
823
|
[[package]]
|
|
868
824
|
name = "webbrowser"
|
|
869
|
-
version = "0.
|
|
825
|
+
version = "0.8.9"
|
|
870
826
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
871
|
-
checksum = "
|
|
827
|
+
checksum = "b692165700260bbd40fbc5ff23766c03e339fbaca907aeea5cb77bf0a553ca83"
|
|
872
828
|
dependencies = [
|
|
829
|
+
"core-foundation",
|
|
830
|
+
"dirs 4.0.0",
|
|
831
|
+
"jni",
|
|
832
|
+
"log",
|
|
833
|
+
"ndk-context",
|
|
834
|
+
"objc",
|
|
835
|
+
"raw-window-handle",
|
|
836
|
+
"url",
|
|
873
837
|
"web-sys",
|
|
874
|
-
"widestring",
|
|
875
|
-
"winapi",
|
|
876
838
|
]
|
|
877
839
|
|
|
878
840
|
[[package]]
|
|
@@ -886,12 +848,6 @@ dependencies = [
|
|
|
886
848
|
"once_cell",
|
|
887
849
|
]
|
|
888
850
|
|
|
889
|
-
[[package]]
|
|
890
|
-
name = "widestring"
|
|
891
|
-
version = "0.4.3"
|
|
892
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
893
|
-
checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c"
|
|
894
|
-
|
|
895
851
|
[[package]]
|
|
896
852
|
name = "winapi"
|
|
897
853
|
version = "0.3.9"
|
|
@@ -922,3 +878,69 @@ name = "winapi-x86_64-pc-windows-gnu"
|
|
|
922
878
|
version = "0.4.0"
|
|
923
879
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
924
880
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|
881
|
+
|
|
882
|
+
[[package]]
|
|
883
|
+
name = "windows-sys"
|
|
884
|
+
version = "0.45.0"
|
|
885
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
886
|
+
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
|
|
887
|
+
dependencies = [
|
|
888
|
+
"windows-targets",
|
|
889
|
+
]
|
|
890
|
+
|
|
891
|
+
[[package]]
|
|
892
|
+
name = "windows-targets"
|
|
893
|
+
version = "0.42.2"
|
|
894
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
895
|
+
checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
|
|
896
|
+
dependencies = [
|
|
897
|
+
"windows_aarch64_gnullvm",
|
|
898
|
+
"windows_aarch64_msvc",
|
|
899
|
+
"windows_i686_gnu",
|
|
900
|
+
"windows_i686_msvc",
|
|
901
|
+
"windows_x86_64_gnu",
|
|
902
|
+
"windows_x86_64_gnullvm",
|
|
903
|
+
"windows_x86_64_msvc",
|
|
904
|
+
]
|
|
905
|
+
|
|
906
|
+
[[package]]
|
|
907
|
+
name = "windows_aarch64_gnullvm"
|
|
908
|
+
version = "0.42.2"
|
|
909
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
910
|
+
checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
|
|
911
|
+
|
|
912
|
+
[[package]]
|
|
913
|
+
name = "windows_aarch64_msvc"
|
|
914
|
+
version = "0.42.2"
|
|
915
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
916
|
+
checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
|
|
917
|
+
|
|
918
|
+
[[package]]
|
|
919
|
+
name = "windows_i686_gnu"
|
|
920
|
+
version = "0.42.2"
|
|
921
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
922
|
+
checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
|
|
923
|
+
|
|
924
|
+
[[package]]
|
|
925
|
+
name = "windows_i686_msvc"
|
|
926
|
+
version = "0.42.2"
|
|
927
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
928
|
+
checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
|
|
929
|
+
|
|
930
|
+
[[package]]
|
|
931
|
+
name = "windows_x86_64_gnu"
|
|
932
|
+
version = "0.42.2"
|
|
933
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
934
|
+
checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
|
|
935
|
+
|
|
936
|
+
[[package]]
|
|
937
|
+
name = "windows_x86_64_gnullvm"
|
|
938
|
+
version = "0.42.2"
|
|
939
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
940
|
+
checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
|
|
941
|
+
|
|
942
|
+
[[package]]
|
|
943
|
+
name = "windows_x86_64_msvc"
|
|
944
|
+
version = "0.42.2"
|
|
945
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
946
|
+
checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
|
|
@@ -9,6 +9,8 @@ use tree_sitter_highlight::{Error as TSError, HighlightEvent};
|
|
|
9
9
|
use tree_sitter_highlight::{Highlight, HighlightConfiguration, Highlighter, HtmlRenderer};
|
|
10
10
|
use tree_sitter_loader::{Config, LanguageConfiguration, Loader};
|
|
11
11
|
|
|
12
|
+
use std::collections::HashSet;
|
|
13
|
+
|
|
12
14
|
const LOADER_ERROR_MSG: &str = "Error loading Tree-sitter parsers from directory";
|
|
13
15
|
const NO_LANGUAGE_ERROR_MSG: &str = "Error retrieving language configuration for scope";
|
|
14
16
|
const NO_HIGHLIGHT_ERROR_MSG: &str = "Error retrieving highlight configuration for scope";
|
|
@@ -105,10 +107,22 @@ fn render_html(
|
|
|
105
107
|
Ok(renderer.lines().collect())
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
fn
|
|
110
|
+
fn highlight_names_for_language(scope: &str, loader: &Loader) -> Result<Vec<String>> {
|
|
109
111
|
let (language, config) = language_and_configuration(loader, scope)?;
|
|
110
112
|
let highlight_config = highlight_configuration(language, config, scope)?;
|
|
111
|
-
Ok(highlight_config.names().
|
|
113
|
+
Ok(highlight_config.names().to_vec())
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
fn highlight_names(parser_directory: PathBuf) -> Result<Vec<String>> {
|
|
117
|
+
let loader = loader(parser_directory)?;
|
|
118
|
+
let highlight_names = loader
|
|
119
|
+
.get_all_language_configurations()
|
|
120
|
+
.into_iter()
|
|
121
|
+
.flat_map(|(config, _)| config.scope.clone())
|
|
122
|
+
.flat_map(|scope| highlight_names_for_language(&scope, &loader))
|
|
123
|
+
.flat_map(Vec::into_iter)
|
|
124
|
+
.collect::<HashSet<_>>();
|
|
125
|
+
Ok(highlight_names.into_iter().collect())
|
|
112
126
|
}
|
|
113
127
|
|
|
114
128
|
fn highlight_name_styles() -> HashMap<String, Style> {
|
|
@@ -146,8 +160,8 @@ fn highlight_adapter(
|
|
|
146
160
|
css_classes: bool,
|
|
147
161
|
) -> Result<String> {
|
|
148
162
|
let parsers_dir = PathBuf::from(parsers_dir);
|
|
149
|
-
let mut loader = loader(parsers_dir)?;
|
|
150
|
-
let highlight_names = highlight_names(
|
|
163
|
+
let mut loader = loader(parsers_dir.clone())?;
|
|
164
|
+
let highlight_names = highlight_names(parsers_dir)?;
|
|
151
165
|
loader.configure_highlights(&highlight_names);
|
|
152
166
|
let (language, config) = language_and_configuration(&loader, scope)?;
|
|
153
167
|
let highlight_config = highlight_configuration(language, config, scope)?;
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kramdown-syntax_tree_sitter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew T. Biehl
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-05-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: kramdown
|
|
@@ -52,77 +52,10 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: 0.0.4
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
- - "~>"
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '5.0'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - "~>"
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '5.0'
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: rouge
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
73
|
-
- - "~>"
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: '4.0'
|
|
76
|
-
type: :development
|
|
77
|
-
prerelease: false
|
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
-
requirements:
|
|
80
|
-
- - "~>"
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
version: '4.0'
|
|
83
|
-
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: rubocop
|
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
|
86
|
-
requirements:
|
|
87
|
-
- - "~>"
|
|
88
|
-
- !ruby/object:Gem::Version
|
|
89
|
-
version: '1.36'
|
|
90
|
-
type: :development
|
|
91
|
-
prerelease: false
|
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
-
requirements:
|
|
94
|
-
- - "~>"
|
|
95
|
-
- !ruby/object:Gem::Version
|
|
96
|
-
version: '1.36'
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: rubocop-minitest
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - "~>"
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0.22'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - "~>"
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0.22'
|
|
111
|
-
- !ruby/object:Gem::Dependency
|
|
112
|
-
name: rubocop-rake
|
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
|
114
|
-
requirements:
|
|
115
|
-
- - "~>"
|
|
116
|
-
- !ruby/object:Gem::Version
|
|
117
|
-
version: '0.6'
|
|
118
|
-
type: :development
|
|
119
|
-
prerelease: false
|
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
-
requirements:
|
|
122
|
-
- - "~>"
|
|
123
|
-
- !ruby/object:Gem::Version
|
|
124
|
-
version: '0.6'
|
|
125
|
-
description:
|
|
55
|
+
description: |-
|
|
56
|
+
This is a syntax highlighter plugin for Kramdown that leverages Tree-sitter's native syntax highlighter to highlight code blocks (and spans) when rendering HTML.
|
|
57
|
+
|
|
58
|
+
Tree-sitter is a modern, general-purpose parsing library that outclasses many existing tools at the task of syntax highlighting. This plugin adapts Tree-sitter's native highlighter for Kramdown, so that Tree-sitter's superior highlighting capabilities can be easily leveraged in the context of rendering Markdown.
|
|
126
59
|
email:
|
|
127
60
|
executables: []
|
|
128
61
|
extensions:
|
|
@@ -147,6 +80,11 @@ licenses:
|
|
|
147
80
|
- MIT
|
|
148
81
|
metadata:
|
|
149
82
|
rubygems_mfa_required: 'true'
|
|
83
|
+
homepage_uri: https://github.com/andrewtbiehl/kramdown-syntax_tree_sitter
|
|
84
|
+
source_code_uri: https://github.com/andrewtbiehl/kramdown-syntax_tree_sitter
|
|
85
|
+
documentation_uri: https://github.com/andrewtbiehl/kramdown-syntax_tree_sitter/blob/main/README.md
|
|
86
|
+
changelog_uri: https://github.com/andrewtbiehl/kramdown-syntax_tree_sitter/blob/main/CHANGELOG.md
|
|
87
|
+
bug_tracker_uri: https://github.com/andrewtbiehl/kramdown-syntax_tree_sitter/issues
|
|
150
88
|
post_install_message:
|
|
151
89
|
rdoc_options: []
|
|
152
90
|
require_paths:
|
|
@@ -161,7 +99,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
161
99
|
- - ">="
|
|
162
100
|
- !ruby/object:Gem::Version
|
|
163
101
|
version: '0'
|
|
164
|
-
requirements:
|
|
102
|
+
requirements:
|
|
103
|
+
- |-
|
|
104
|
+
This plugin is essentially an adapter for the Tree-sitter highlight library and hence requires a compatible Rust installation to function. It is officially compatible with the following environments:
|
|
105
|
+
|
|
106
|
+
- Rust: 1.66, 1.67, 1.68, 1.69
|
|
107
|
+
- Platforms: MacOS, Linux
|
|
165
108
|
rubygems_version: 3.4.1
|
|
166
109
|
signing_key:
|
|
167
110
|
specification_version: 4
|