I have a custom Markdown grammar that I inject into the official Markdown grammar with an injection selector of L:text.html.markdown and it works fine. That custom grammar defines the starting content of a markdown file between -{3} and -{3} as YAML.
I have a custom YAML grammar that I inject into the official YAML grammar with an injection selector of L:source.yaml and it also works fine. That custom grammar defines runs of entity.name.value.yaml.
But my custom YAML injection does not work in Markdown. I wanted my injected custom YAML to be injected into Markdown, but it’s not. I guess injecting into YAML is not picked up when YAML is injected into Markdown. :(
Is that how it is expected to work?
Is there another way to get injections to work on top of injections like this:
Custom YAML -> YAML -> Markdown
Or do I have to fork the YAML grammar?
Bob ------------------- Robert J. Rockefeller Richmond Hill, GA www.bobrockefeller.com
On 10 Feb 2015, at 20:12, Robert J. Rockefeller wrote:
I have a custom Markdown grammar that I inject into the official Markdown grammar with an injection selector of L:text.html.markdown and it works fine. That custom grammar defines the starting content of a markdown file between -{3} and -{3} as YAML.
I have a custom YAML grammar that I inject into the official YAML grammar with an injection selector of L:source.yaml and it also works fine. That custom grammar defines runs of entity.name.value.yaml.
But my custom YAML injection does not work in Markdown […]
Does the grammar you inject into Markdown declare the source.yaml scope?
That would be required for the injected YAML grammar to (also) match.
Yes. Like this:
{ name = 'text.html.markdown.yaml'; begin = '\A-{3}'; end = '-{3}'; patterns = ( { include = 'source.yaml'; }, ); },
Bob ------------------- Robert J. Rockefeller Richmond Hill, GA www.bobrockefeller.com
On Feb 10, 2015, at 9:03 AM, Allan Odgaard mailinglist@textmate.org wrote:
On 10 Feb 2015, at 20:12, Robert J. Rockefeller wrote:
I have a custom Markdown grammar that I inject into the official Markdown grammar with an injection selector of L:text.html.markdown and it works fine. That custom grammar defines the starting content of a markdown file between -{3} and -{3} as YAML.
I have a custom YAML grammar that I inject into the official YAML grammar with an injection selector of L:source.yaml and it also works fine. That custom grammar defines runs of entity.name.value.yaml.
But my custom YAML injection does not work in Markdown […]
Does the grammar you inject into Markdown declare the source.yaml scope?
That would be required for the injected YAML grammar to (also) match.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 10 Feb 2015, at 21:17, Robert J. Rockefeller wrote:
Yes. Like this:
Please stop top-posting.
{ name = 'text.html.markdown.yaml';
This gives the block a scope of `text.html.markdown.yaml`.
If you want YAML functionality (and injections) to be active, it should be `source.yaml[.front-matter]`.
begin = '\A-{3}'; end = '-{3}'; patterns = ( { include = 'source.yaml'; }, );
That was the missing piece. Thanks!
And sorry about the top posting; I think this fixed it.
Bob ------------------- Robert J. Rockefeller Richmond Hill, GA www.bobrockefeller.com