Combine YAML and Jinja2 highlighting


Hello, I am using PyCharm for writing states for SaltStack.

Most of the states are a combination of YAML and Jinja2, PyCharm supports both of these but not together, is it possible to use both at the same time to have PyCharm highlight both Jinja2 and YAML?

Comment actions Permalink


To get it working PyCharm you need do the following:

- go to Settings| Languages&Frameworks| Python Template Language| Select Jinja2
- add YAML Template file type there
- apply changes

Please let me know if you have any questions.


Comment actions Permalink

Sorry for the log delay, thank you Anna this worked perfectly.

Comment actions Permalink

Any way to get this working with mako? It works for jinja2 for me but when I use mako instead it thinks it's html so loses the yaml features.


Please sign in to leave a comment.