atom-jinja2 icon indicating copy to clipboard operation
atom-jinja2 copied to clipboard

[Needs Some Work] Add json.j2 to supported file types

Open then0rTh opened this issue 8 years ago • 3 comments

So, i tried joining source.jinja and source.json, and it works pretty well, but:

There is issue with first {% %} being marked as invalid(and breaking rest of the code) when inside {} JSON-object, i don't know how to override this. Any help would be appreciated.

{% %} placed outside JSON-object works correctly.

then0rTh avatar Mar 23 '17 00:03 then0rTh

@then0rTh hey did you ever figure out your issue? I'm very interested in using json.j2 as well. @danielchatfield would you be able to look into this?

AlJohri avatar May 17 '17 18:05 AlJohri

@AlJohri nope, no progress. The atom grammar is just over my head and i dont think i will find the time to dig into it, tho it would be nice to get it working.

I tried to combine js with jinja and use it for json.j2. Solved the problem with {% %} being marked as invalid, but when inside { }, the {% %} loose its syntax hi-light and becomes white - but its something.

{% block name %}    <-- correct color 
{% endblock %}
{
    "name": "Whatever",    <-- (js color - not as nice as json)
    {% block name2 %}    <-- (no color)
    {% endblock %}
}

The good news is we can have .js.j2 :)

then0rTh avatar May 19 '17 09:05 then0rTh

Any updates on this PR? Would be very nice to have it working

serpro69 avatar Nov 18 '19 06:11 serpro69