I use Pandoc which allows mixing of markdown and latex. It would be nice to have syntax highlighting working for both. Any thoughts on the best way to achieve this?
You should create a new language grammar for Pandoc files that incorporates the Markdown and LaTeX grammars. There are two ways to include rules from other grammars:
Use an include rule and reference elements from the other grammars. For example this would reference include the complete LaTeX and Markdown grammars:
{ patterns = (
{ include = 'text.html.markdown'; },
{ include = 'text.tex.latex'; },
);
}
It is also possible to cherry pick rules from the grammars repository by using this form:
{ include = 'text.html.markdown#block'; }
Use injection grammars. You can read more about those on the TextMate blog.
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With