[My usual disclaimer: I’m not a programmer, but a prose writer. I like tweaking ST, but I’m a rank beginner.]
Using the Inheritance instructions from the official ST documentation, I’m trying to employ the extends key to associate a small syntax tweak (which OdatNurd taught me how to create a couple years ago–see below) with ST’s Markdown.sublime-syntax definition.
Goal: I want this little syntax tweak to work along with ST’s stock Markdown syntax. As it stands now, I can have one or the other; I want both.
The extends key requires the path to the parent syntax. I couldn’t find that path, as Markdown.sublime-syntax doesn’t appear in Packages.
In an attempt to sidestep that circumstance, I opened Markdown.sublime-syntax via PackageResourceViewer: Open Resource
and re-saved it, which created a copy in my Packages directory.
I then used the path to the instance of Markdown.sublime-syntax in my Packages directory as the extends key within my little syntax file.
Alas, it didn’t do the trick.
A couple of questions:
-
Am I on the right track? Should I be able to make this little custom syntax tweak work in conjunction with the full markdown syntax definition that ships with ST? Is there a better/easier way to accomplish what I’m trying to accomplish?
-
What is the path to ST’s Markdown.sublime-syntax? (i.e., without my opening it via PackageResourceViewer and re-saving it, it doesn’t appear in my Packages directory).
THANKS
Here’s the syntax file I’m working with. It works as is, but only on its own. Again, I want this functionality to function in, or alongside, the main Markdown syntax. NOTE: This copy includes the extends key that I tried but which didn’t work.
%YAML 1.2
---
file_extensions:
- md
- mdown
- mdwn
- markdown
- markdn
scope: text.md
name: my md highlighting tweak
extends: Packages/Markdown/Markdown.sublime-syntax
contexts:
main:
- match: '@@ '
scope: punctuation.definition.note.comment.begin
push:
- meta_scope: note.text.comment
- match: ' @@'
scope: punctuation.definition.note.comment.end
pop: true
- match: '&& '
scope: punctuation.definition.note.header.begin
push:
- meta_scope: note.text.header
- match: ' &&'
scope: punctuation.definition.note.header.end
pop: true