[TxMt] Re: Supporting YAML front matter in Markdown

Stefan Daschek stefan at daschek.net
Sat Jul 16 20:35:55 UTC 2016


Am 16.07.16 um 21:44 schrieb Allan Odgaard:

> On 16 Jul 2016, at 18:41, Stefan Daschek wrote:
>
>     So in principle I want to implement a preview command that just
>     strips the frontmatter and then delegates to whatever else preview
>     command would have been normally used, if this bundle would not be
>     installed (like calling `super` in an overridden oop method). 
>
> How many Markdown preview commands are out there?
>
There’s at least the one from Markdown (GitHub) 
<https://github.com/MikeMcQuaid/GitHub-Markdown.tmbundle/blob/master/Commands/Preview.tmCommand> 
(a bundle I happen to be using :-).

> The default Markdown bundle uses |TM_MARKDOWN| to convert the text to 
> HTML so it can be used with alternative Markdown processors (I use it 
> with multimarkdown), so not sure what the motivation would be to 
> create new preview commands.
>
Markdown (GitHub) also uses |TM_MARKDOWN|, but defaults to (a bundled 
version of) |redcarpet.rb|.

After all, I don’t really want to create a new preview command, I’d 
rather somehow “hook into” the existing preview command(s). (My bundle 
should only care about stripping the YAML front matter and not impose 
its own choice of markdown processor.) So setting |TM_MARKDOWN| isn’t 
really suitable, as far as I understand.

Maybe we could introduce something like |TM_MARKDOWN_PREPROCESSOR| into 
the existing preview commands? With the idea that as long as this is not 
set (the default) it does nothing, but if it is set the document gets 
piped through this first before being processed further.

​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20160716/4900c9f2/attachment.html>


More information about the textmate mailing list