Closed noniq closed 8 years ago
Will have a think about this; a dedicated bundle might be best, though.
Makes sense. What would be the best way of extending / changing the preview command from a dedicated bundle? I’m thinking including an adapted copy of redcarpet.rb
in the bundle and then setting $TM_MARKDOWN
to point to this copy. But setting this variable from within the bundle isn’t possible, is it? (I’d like to avoid the need for manual configuration / installation as much as possible).
Are there any other ways?
I guess I'd look at extending this bundle like how this bundle has done to the Markdown bundle.
This will now be implemented as a separate bundle, see https://github.com/noniq/Markdown-Front-Matter.tmbundle
Thanks @noniq!
Based on https://github.com/textmate/markdown.tmbundle/issues/27
This is not strictly speaking a feature of “GitHub markdown”, so not sure if you want to include it. I could of course create a dedicated bundle for it, too.
The grammar needs to be injected to have precedence over the default Markdown grammar (which parses
---
as setext header). Therefore I created a new grammar instead of just adding the rules to the “Markdown (GitHub)”.I also extended the preview command to strip a YAML frontmatter before converting the document to markdown.
I tested several edge cases (frontmatter only, no end delimiter for frontmatter, …) and both highlighting and preview seem to work fine. I’d be happy to support this in the future, too, if any problems should appear.