Combine YAML and Jinja2 highlighting

Answered

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?

3 comments
Comment actions Permalink

Hello!

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.

 

1
Comment actions Permalink

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

0
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.

0

Please sign in to leave a comment.