aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGokul Soumya2021-12-18 18:35:43 +0000
committerBlaž Hrastnik2021-12-19 06:23:39 +0000
commit7c01d926536bcaacc92bbf4a2b1a06e96e6268a0 (patch)
tree0f8abcf91564a1c7823fbfd285326bdf4cf87024
parent8208d22601dfbecbdaa14be273e998eccfd63220 (diff)
Add link and quote queries for markdown
- Rename markup.underline.link to markup.link.url - Add markup.link.label - Add markup.quote (The constructor theme scope was missing from the docs, so unrelated to this commit).
-rw-r--r--book/src/themes.md6
-rw-r--r--runtime/queries/latex/highlights.scm2
-rw-r--r--runtime/queries/markdown/highlights.scm7
-rw-r--r--runtime/queries/svelte/highlights.scm4
-rw-r--r--theme.toml2
5 files changed, 12 insertions, 9 deletions
diff --git a/book/src/themes.md b/book/src/themes.md
index b6de7002..fce2c0ca 100644
--- a/book/src/themes.md
+++ b/book/src/themes.md
@@ -105,6 +105,7 @@ We use a similar set of scopes as
- `type` - Types
- `builtin` - Primitive types provided by the language (`int`, `usize`)
+- `constructor`
- `constant` (TODO: constant.other.placeholder for %v)
- `builtin` Special constants provided by the language (`true`, `false`, `nil` etc)
@@ -169,8 +170,9 @@ We use a similar set of scopes as
- `numbered`
- `bold`
- `italic`
- - `underline`
- - `link`
+ - `link`
+ - `url`
+ - `label`
- `quote`
- `raw`
- `inline`
diff --git a/runtime/queries/latex/highlights.scm b/runtime/queries/latex/highlights.scm
index 2e308f77..0a030b31 100644
--- a/runtime/queries/latex/highlights.scm
+++ b/runtime/queries/latex/highlights.scm
@@ -371,7 +371,7 @@
((generic_command
name:(generic_command_name) @_name
.
- arg: (_) @markup.underline.link)
+ arg: (_) @markup.link.url)
(#match? @_name "^(\\\\url|\\\\href)$"))
(ERROR) @error
diff --git a/runtime/queries/markdown/highlights.scm b/runtime/queries/markdown/highlights.scm
index a102719b..a0bd3462 100644
--- a/runtime/queries/markdown/highlights.scm
+++ b/runtime/queries/markdown/highlights.scm
@@ -10,15 +10,16 @@
(fenced_code_block)
] @markup.raw.block
+(block_quote) @markup.quote
+
(code_span) @markup.raw.inline
(emphasis) @markup.italic
(strong_emphasis) @markup.bold
-(link_destination) @markup.underline.link
-
-; (link_label) @markup.label ; TODO: rename
+(link_destination) @markup.link.url
+(link_label) @markup.link.label
[
(list_marker_plus)
diff --git a/runtime/queries/svelte/highlights.scm b/runtime/queries/svelte/highlights.scm
index f9eef6b5..22b0c551 100644
--- a/runtime/queries/svelte/highlights.scm
+++ b/runtime/queries/svelte/highlights.scm
@@ -20,12 +20,12 @@
((element (start_tag (tag_name) @_tag) (text) @markup.inline)
(#match? @_tag "^(code|kbd)$"))
-((element (start_tag (tag_name) @_tag) (text) @markup.underline.link)
+((element (start_tag (tag_name) @_tag) (text) @markup.link.url)
(#eq? @_tag "a"))
((attribute
(attribute_name) @_attr
- (quoted_attribute_value (attribute_value) @markup.underline.link))
+ (quoted_attribute_value (attribute_value) @markup.link.url))
(#match? @_attr "^(href|src)$"))
(tag_name) @tag
diff --git a/theme.toml b/theme.toml
index 0a79861e..b316e814 100644
--- a/theme.toml
+++ b/theme.toml
@@ -31,7 +31,7 @@ label = "honey"
"markup.heading" = "lilac"
"markup.bold" = { modifiers = ["bold"] }
"markup.italic" = { modifiers = ["italic"] }
-"markup.underline.link" = { fg = "silver", modifiers = ["underlined"] }
+"markup.link.url" = { fg = "silver", modifiers = ["underlined"] }
"markup.raw" = "almond"
# TODO: diferentiate doc comment