gabrielelana / vim-markdown

Markdown for Vim: a complete environment to create Markdown files with a syntax highlight that doesn't suck!
MIT License
741 stars 58 forks source link

Support for Liquid #19

Closed mrzool closed 9 years ago

mrzool commented 9 years ago

In the readme you state:

Automatically detects Jekyll files and adds support for Liquid template engine

Does this mean the plugin is supposed to enable proper syntax highlighting for Liquid tags and YAML frontmatter?

Because that's not working for me. I've also tried to explicitly set

let g:markdown_include_jekyll_support = 1

but that doesn't change anything. Any idea or known bug/limitation?

gabrielelana commented 9 years ago

The syntax is lazily loaded and it’s loaded only if the first line begins with a triple dash. When I say the first line I mean literally the first line and not the first non blank line. Moreover, the triple dash line must be there when you open the file otherwise the syntax extension won’t be loaded (so, if you are editing a new file, you need to insert the fist “triple dash” line and then reopen the file :e %). For me, the example below works

--- 
title: the example
—

# {{ page.title }}

Other limitations that I would like to remove in the future:

It should be it, let me know if this works for you.

mrzool commented 9 years ago

Thanks a lot, I'll try tomorrow.

mrzool commented 9 years ago

Still not working for me...

This is what I get:

screenshot - 12122014 - 10 50 20 am

gabrielelana commented 9 years ago

Well it kind of does :blush:

All the front matter is grey as it’s supposed to be

screen shot 2014-12-12 at 11 35 03

Try to move all the front matter a line below and reload the file. This is what it should look like

screen shot 2014-12-12 at 11 35 30

Also it seems that your current color scheme uses the same color for comments and delimiters, try to change color scheme to see the difference

mrzool commented 9 years ago

I see! Just a color scheme issue then. I'm using Molokai, for the record.

Too bad the syntax for liquid tags couldn't be implemented though.

Thanks for the help.

mrzool commented 9 years ago

Anyway though, this is how the front matter gets rendered in html files using vim-liquid. Same color scheme of course:

screenshot - 12122014 - 03 20 31 pm

That's why I was tricked into thinking the plugin wasn't working properly.