on master help sign in
feat(languages): Support markdoc (#6432)

Add basic support for [markdoc](https://markdoc.dev/). For language server, see: https://github.com/markdoc-extra/markdoc-ls For tree sitter, see: https://github.com/markdoc-extra/tree-sitter-markdoc

commit70de5026b801fb1a0eb54acc2d3685291c8e14f3 authorMatouš Dzivjak <matousdzivjak@gmail.com> dateWed 12 Apr 2023, 17:28 (4 years ago) parentfed5e6e
4 files changed+30
book/src/generated/lang-support.md+1 languages.toml+11 runtime/queries/markdoc/highlights.scm+16 runtime/queries/markdoc/injections.scm+2
book/src/generated/lang-support.md+1
@@ -81,6 +81,7 @@
8181| llvm-mir-yaml | ✓ | | ✓ | |
8282| lua | ✓ | ✓ | ✓ | `lua-language-server` |
8383| make | ✓ | | | |
84+| markdoc | ✓ | | | `markdoc-ls` |
8485| markdown | ✓ | | | `marksman` |
8586| markdown.inline | ✓ | | | |
8687| matlab | ✓ | | | |
languages.toml+11
@@ -2461,3 +2461,14 @@ indent = { tab-width = 2, unit = " " }
24612461[[grammar]]
24622462name = "hurl"
24632463source = { git = "https://github.com/pfeiferj/tree-sitter-hurl", rev = "264c42064b61ee21abe88d0061f29a0523352e22" }
2464+
2465+[[language]]
2466+name = "markdoc"
2467+scope = "text.markdoc"
2468+roots = []
2469+file-types = ["mdoc"]
2470+language-server = { command = "markdoc-ls", args = ["--stdio"] }
2471+
2472+[[grammar]]
2473+name = "markdoc"
2474+source = { git = "https://github.com/markdoc-extra/tree-sitter-markdoc", rev = "5ffe71b29e8a3f94823913ea9cea51fcfa7e3bf8" }
runtime/queries/markdoc/highlights.scmnew file+16
@@ -0,0 +1,16 @@
1+tag_name: (identifier) @tag
2+(tag_self_closing "/" @tag)
3+(tag_close "/" @tag)
4+([(tag_start) (tag_end) "="] @tag)
5+(attribute [key : (identifier)] @attribute)
6+(attribute [shorthand : (identifier)] @attribute)
7+(variable [variable : (identifier) (variable_sigil)] @variable)
8+(variable_tail property : (identifier) @variable.other.member)
9+(function function_name : (identifier) @function)
10+(function_parameter_named parameter : (identifier) @variable.parameter)
11+
12+(hash_key key: (identifier) @variable.other.member)
13+(string) @string
14+(number) @constant.numeric
15+(boolean) @constant.builtin.boolean
16+(null) @constant.builtin
runtime/queries/markdoc/injections.scmnew file+2
@@ -0,0 +1,2 @@
1+((markdown) @injection.content
2+ (#set! injection.language "markdown"))