atom-jinja2
atom-jinja2 copied to clipboard
File type detection for html
It looks like the only way a jinja2 html file is detected is by extends in the first line. Very few of my templates have that, making having to manually select the mode a big pain for each and every file (it isn't remembered across atom restarts).
In theory some heuristics would help, but it seems like many template engines use similar punctuation. Perhaps you could also add comment detection - eg \{#.*jinja2.*#\}
which I can add to all my templates.
At the very least it would be helpful documenting how the detection is done.
+1 It is not very helpful to highlight only "extends" files, as not many of them actually contain this code...
@rogerbinns @JacobCZ Not sure it helps you guys, but I recently encountered problems with detecting jinja html for files that end in .jinja2
. I added this to my config.cson
:
core:
customFileTypes:
'text.html.jinja': [
'jinja2'
]
I did this so that HTML (.html
) file itself is picked up by atom-jinja2:
core:
customFileTypes:
"text.html.jinja": [
"html"
]
Hi,
I tried adding
core: customFileTypes: "text.html.jinja": [ "html" ]
it works but I dont have html syntax error highlighting anymore for html files , any idea how to have both ?