on master help sign in
Initial basic Org markup support thanks to tree-sitter-org (#1845)
commit7eb013c6fb33df40b2fae31c9d08f7da275cd963 authorzetashift <rskaraya@gmail.com> dateSun 20 Mar 2022, 23:14 (5 years ago) parenta7ee9f7
4 files changed+41
book/src/generated/lang-support.md+1 languages.toml+12 runtime/queries/org/highlights.scm+24 runtime/queries/org/injections.scm+4
book/src/generated/lang-support.md+1
@@ -42,6 +42,7 @@
4242| nix | ✓ | | ✓ | `rnix-lsp` |
4343| ocaml | ✓ | | ✓ | |
4444| ocaml-interface | ✓ | | | |
45+| org | ✓ | | | |
4546| perl | ✓ | ✓ | ✓ | |
4647| php | ✓ | ✓ | ✓ | |
4748| prolog | | | | `swipl` |
languages.toml+12
@@ -976,3 +976,15 @@ auto-format = true
976976[[grammar]]
977977name = "hcl"
978978source = { git = "https://github.com/MichaHoffmann/tree-sitter-hcl", rev = "3cb7fc28247efbcb2973b97e71c78838ad98a583" }
979+
980+[[language]]
981+name = "org"
982+scope = "source.org"
983+injection-regex = "org"
984+file-types = ["org"]
985+roots = []
986+indent = { tab-width = 2, unit = " " }
987+
988+[[grammar]]
989+name = "org"
990+source = { git = "https://github.com/milisims/tree-sitter-org", rev = "1c3eb533a9cf6800067357b59e03ac3f91fc3a54" }
runtime/queries/org/highlights.scmnew file+24
@@ -0,0 +1,24 @@
1+(headline (stars) @markup.heading.marker (#eq? @markup.heading.marker "*")) @markup.heading.1
2+(headline (stars) @markup.heading.marker (#eq? @markup.heading.marker "**")) @markup.heading.2
3+(headline (stars) @markup.heading.marker (#eq? @markup.heading.marker "***")) @markup.heading.3
4+(headline (stars) @markup.heading.marker (#eq? @markup.heading.marker "****")) @markup.heading.4
5+(headline (stars) @markup.heading.marker (#eq? @markup.heading.marker "*****")) @markup.heading.5
6+(headline (stars) @markup.heading.marker (#eq? @markup.heading.marker "******")) @markup.heading.6
7+
8+(block) @markup.raw.block
9+(list) @markup.list.unnumbered
10+(directive) @markup.label
11+(property_drawer) @markup.label
12+
13+
14+((expr) @markup.bold
15+ (#match? @markup.bold "\\*.*\\*"))
16+
17+((expr) @markup.italic
18+ (#match? @markup.italic "/.*/"))
19+((expr) @markup.raw.inline
20+ (#match? @markup.raw.inline "~.*~"))
21+
22+((expr) @markup.quote
23+ (#match? @markup.quote "=.*="))
24+
runtime/queries/org/injections.scmnew file+4
@@ -0,0 +1,4 @@
1+(block parameter: (expr) @injection.language
2+ (contents) @injection.content
3+ (#set! injection.include-children))
4+