问题
How can one format django template in Sublime Text. My template consists of:
- HTML (django template language with
{{ variable }}
and{% stuff %}
) - javascript
Is there a way to get same kind of formatting PyCharm provides?
回答1:
This package should help: https://github.com/squ1b3r/Djaneiro
Here are some tips on install: How to install plugins to Sublime Text 2 editor?
回答2:
A couple different things:
Djanerio has a nice set of auto-completion and color schemes specific to Django. Check out their README file to see the list of available substitutions
JSFormat is also great for javascript in ST2, for your templates
Colorpicker offers a generic css color sheet that you can tinker with. This comes in handy for things all of the above doesn't pick up on.
来源:https://stackoverflow.com/questions/17218664/how-to-format-django-template-in-sublime-text