How to format django template in Sublime Text
Asked Answered
B

2

12

How can one format django template in Sublime Text. My template consists of:

  1. HTML (django template language with {{ variable }} and {% stuff %})
  2. javascript

Is there a way to get same kind of formatting PyCharm provides?

Balough answered 20/6, 2013 at 16:15 Comment(0)
T
18

This package should help: https://github.com/squ1b3r/Djaneiro

Here are some tips on install: How to install plugins to Sublime Text 2 editor?

Thirza answered 20/6, 2013 at 16:18 Comment(3)
i do not see syntax in javascript sectionBalough
There is an error in this plugin, it uses {# #} to comment multiple lines in html templates which won't comment out anything. Instead, you are supposed to use the comment tag.Schilling
I wasn't sure about Djaneiro at first but after using it for a while I found it extremely helpful. The improved syntax highlighting for Django templates is awesome. I ended up writing a quick review and feature walkthrough for it: dbader.org/blog/sublime-text-djaneiro-reviewIllusory
C
5

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.

Croze answered 20/6, 2013 at 16:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.