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?
Please sign in to leave a comment.
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.
Sorry for the log delay, thank you Anna this worked perfectly.
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.
Under File Types -> Jinja2 you can add an extension, say *.sls and say that it is Jinja2 rendered Yaml. I guess it can be configured in similar way for mako.