Permalink
Browse files

added TextMate bundle and vim syntax files

--HG--
branch : trunk
  • Loading branch information...
1 parent 762079c commit decf7e3c108c2b467bc96e67672cb3fb95d79166 @mitsuhiko mitsuhiko committed May 9, 2008
Showing with 234 additions and 747 deletions.
  1. +1 −2 docs/_static/style.css
  2. +11 −2 docs/integration.rst
  3. +2 −3 ext/{Jinja.tmbundle → Jinja Templates.tmbundle}/Commands/Help.tmCommand
  4. 0 ext/{Jinja.tmbundle → Jinja Templates.tmbundle}/Commands/Validate Syntax.tmCommand
  5. 0 ext/{Jinja.tmbundle → Jinja Templates.tmbundle}/Commands/Wrap in Tag.tmCommand
  6. 0 ext/{Jinja.tmbundle → Jinja Templates.tmbundle}/Commands/Wrap in Variable Tag.tmCommand
  7. +27 −0 ext/Jinja Templates.tmbundle/Macros/No automatic Completion for {.tmMacro
  8. 0 ext/{Jinja.tmbundle → Jinja Templates.tmbundle}/Preferences/Symbol List: Blocks.tmPreferences
  9. +3 −3 ext/{Jinja.tmbundle/Snippets/block.tmSnippet → Jinja Templates.tmbundle/Snippets/Block.tmSnippet}
  10. +4 −4 ...undle/Snippets/capitalize.tmSnippet → Jinja Templates.tmbundle/Snippets/Complete Block.tmSnippet}
  11. +4 −4 ....tmbundle/Snippets/abs.tmSnippet → Jinja Templates.tmbundle/Snippets/Complete Variable.tmSnippet}
  12. +3 −3 ...{Jinja.tmbundle/Snippets/extends.tmSnippet → Jinja Templates.tmbundle/Snippets/Extends.tmSnippet}
  13. +3 −3 ext/{Jinja.tmbundle/Snippets/filter.tmSnippet → Jinja Templates.tmbundle/Snippets/Filter.tmSnippet}
  14. +3 −3 ...nja.tmbundle/Snippets/for ___ in ___.tmSnippet → Jinja Templates.tmbundle/Snippets/For.tmSnippet}
  15. +4 −4 ext/{Jinja.tmbundle/Snippets/if.tmSnippet → Jinja Templates.tmbundle/Snippets/If.tmSnippet}
  16. +3 −3 ext/{Jinja.tmbundle/Snippets/macro.tmSnippet → Jinja Templates.tmbundle/Snippets/Macro.tmSnippet}
  17. 0 ext/{Jinja.tmbundle → Jinja Templates.tmbundle}/Syntaxes/HTML (Jinja Templates).tmLanguage
  18. +18 −6 ext/{Jinja.tmbundle → Jinja Templates.tmbundle}/Syntaxes/Jinja Templates.tmLanguage
  19. +9 −49 ext/{Jinja.tmbundle → Jinja Templates.tmbundle}/info.plist
  20. +0 −16 ext/Jinja.tmbundle/Snippets/batch.tmSnippet
  21. +0 −16 ext/Jinja.tmbundle/Snippets/capture.tmSnippet
  22. +0 −16 ext/Jinja.tmbundle/Snippets/center.tmSnippet
  23. +0 −16 ext/Jinja.tmbundle/Snippets/default.tmSnippet
  24. +0 −16 ext/Jinja.tmbundle/Snippets/dformat.tmSnippet
  25. +0 −16 ext/Jinja.tmbundle/Snippets/dictsort.tmSnippet
  26. +0 −16 ext/Jinja.tmbundle/Snippets/escape.tmSnippet
  27. +0 −16 ext/Jinja.tmbundle/Snippets/filesizeformat.tmSnippet
  28. +0 −16 ext/Jinja.tmbundle/Snippets/first.tmSnippet
  29. +0 −16 ext/Jinja.tmbundle/Snippets/float.tmSnippet
  30. +0 −16 ext/Jinja.tmbundle/Snippets/format.tmSnippet
  31. +0 −16 ext/Jinja.tmbundle/Snippets/indent.tmSnippet
  32. +0 −16 ext/Jinja.tmbundle/Snippets/int.tmSnippet
  33. +0 −16 ext/Jinja.tmbundle/Snippets/join.tmSnippet
  34. +0 −16 ext/Jinja.tmbundle/Snippets/jsonencode.tmSnippet
  35. +0 −16 ext/Jinja.tmbundle/Snippets/last.tmSnippet
  36. +0 −16 ext/Jinja.tmbundle/Snippets/length.tmSnippet
  37. +0 −16 ext/Jinja.tmbundle/Snippets/lower.tmSnippet
  38. +0 −16 ext/Jinja.tmbundle/Snippets/markdown.tmSnippet
  39. +0 −16 ext/Jinja.tmbundle/Snippets/pprint.tmSnippet
  40. +0 −16 ext/Jinja.tmbundle/Snippets/random.tmSnippet
  41. +0 −18 ext/Jinja.tmbundle/Snippets/raw.tmSnippet
  42. +0 −16 ext/Jinja.tmbundle/Snippets/replace.tmSnippet
  43. +0 −16 ext/Jinja.tmbundle/Snippets/reverse.tmSnippet
  44. +0 −16 ext/Jinja.tmbundle/Snippets/round.tmSnippet
  45. +0 −16 ext/Jinja.tmbundle/Snippets/rst.tmSnippet
  46. +0 −16 ext/Jinja.tmbundle/Snippets/slice.tmSnippet
  47. +0 −16 ext/Jinja.tmbundle/Snippets/sort.tmSnippet
  48. +0 −16 ext/Jinja.tmbundle/Snippets/string.tmSnippet
  49. +0 −16 ext/Jinja.tmbundle/Snippets/striptags.tmSnippet
  50. +0 −16 ext/Jinja.tmbundle/Snippets/sum.tmSnippet
  51. +0 −16 ext/Jinja.tmbundle/Snippets/textile.tmSnippet
  52. +0 −16 ext/Jinja.tmbundle/Snippets/title.tmSnippet
  53. +0 −16 ext/Jinja.tmbundle/Snippets/trim.tmSnippet
  54. +0 −16 ext/Jinja.tmbundle/Snippets/truncate.tmSnippet
  55. +0 −16 ext/Jinja.tmbundle/Snippets/upper.tmSnippet
  56. +0 −16 ext/Jinja.tmbundle/Snippets/urlencode.tmSnippet
  57. +0 −16 ext/Jinja.tmbundle/Snippets/urlize.tmSnippet
  58. +0 −16 ext/Jinja.tmbundle/Snippets/wordcount.tmSnippet
  59. +0 −16 ext/Jinja.tmbundle/Snippets/wordwrap.tmSnippet
  60. +0 −16 ext/Jinja.tmbundle/Snippets/xmlattr.tmSnippet
  61. +27 −0 ext/Vim/htmljinja.vim
  62. +112 −0 ext/Vim/jinja.vim
View
@@ -134,7 +134,6 @@ p {
line-height: 20px;
margin-bottom: 0;
margin-top: 10px;
- text-align: justify;
}
hr {
@@ -254,7 +253,7 @@ div.admonition p {
}
a.headerlink {
- color: #B4B4B4;
+ color: #B4B4B4!important;
font-size: 0.8em;
margin-left: 8px;
padding: 0 4px 0 4px;
View
@@ -58,11 +58,20 @@ TODO
TextMate
--------
-TODO
+Inside the `ext` folder of Jinja2 there is a bundle for TextMate that supports
+syntax highlighting for Jinja1 and Jinja2 for text based templates as well as
+HTML. It also contains a few often used snippets.
Vim
---
-TODO
+A syntax plugin for `Vim`_ exists in the Vim-scripts directory as well as the
+ext folder of Jinja2. `The script <http://www.vim.org/scripts/script.php?script_id=1856>`_
+supports Jinja1 and Jinja2. Once installed two file types are available `jinja`
+and `htmljinja`. The first one for text based templates, the latter for HTML
+templates.
+
+Copy the files into your `syntax` folder.
.. _Babel: http://babel.edgewall.org/
+.. _Vim: http://www.vim.org/
@@ -10,10 +10,9 @@ html_header "Jinja Help" "Jinja Templates"
Markdown.pl &lt;&lt;'EOF'
-This document describes the commands of the TextMate Jinja Templates bundle and how you can use it. For general Jinja help you should read the [Jinja Documentation](http:/jinja.pocoo.org/documentation/ "Jinja Documentation Overview").
+This document describes the commands of the TextMate Jinja Templates bundle and how you can use it. For general Jinja help you should read the documentation on the [Jinja website](http:/jinja.pocoo.org/ "Jinja Webpage").
-## Requirements
-The Jinja support requires Jinja to be installed in the default python interpreter the system uses. If Jinja is not installed you cannot use the syntax validator.
+This bundle supports Jinja1 and Jinja2.
EOF
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>commands</key>
+ <array>
+ <dict>
+ <key>argument</key>
+ <string>{</string>
+ <key>command</key>
+ <string>insertText:</string>
+ </dict>
+ <dict>
+ <key>command</key>
+ <string>deleteForward:</string>
+ </dict>
+ </array>
+ <key>keyEquivalent</key>
+ <string>{</string>
+ <key>name</key>
+ <string>No automatic Completion for {</string>
+ <key>scope</key>
+ <string>source.jinja, text.html.jinja</string>
+ <key>uuid</key>
+ <string>31E30D4A-5CA5-4E4A-9C13-AB8ED6C1EB94</string>
+</dict>
+</plist>
@@ -3,16 +3,16 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>{% block $1 %}
+ <string>{% block ${1:name} %}
$2
{% endblock %}</string>
<key>name</key>
- <string>block</string>
+ <string>Block</string>
<key>scope</key>
<string>source.jinja, text.html.jinja</string>
<key>tabTrigger</key>
<string>block</string>
<key>uuid</key>
- <string>24C0F9CE-D3F1-4677-8A2E-EFFE776098F0</string>
+ <string>152FEFB6-EE41-47D1-B9AD-4E30AF64406C</string>
</dict>
</plist>
@@ -3,14 +3,14 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>|capitalize</string>
+ <string>{% $0 %}</string>
<key>name</key>
- <string>capitalize</string>
+ <string>Complete Block</string>
<key>scope</key>
<string>source.jinja, text.html.jinja</string>
<key>tabTrigger</key>
- <string>|</string>
+ <string>{%</string>
<key>uuid</key>
- <string>4CCD42F3-8E6E-4B96-9D5D-BFB81E714948</string>
+ <string>08A0C481-0E5A-425E-9486-EC7D681DA01D</string>
</dict>
</plist>
@@ -3,14 +3,14 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>|abs</string>
+ <string>{{ $0 }}</string>
<key>name</key>
- <string>abs</string>
+ <string>Complete Variable</string>
<key>scope</key>
<string>source.jinja, text.html.jinja</string>
<key>tabTrigger</key>
- <string>|</string>
+ <string>{{</string>
<key>uuid</key>
- <string>7E9487F0-B012-4735-96DA-124EF3C87B15</string>
+ <string>502E364B-D4D5-45F0-A996-5E71B3E5B7B6</string>
</dict>
</plist>
@@ -3,14 +3,14 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>{% extends $1 %}</string>
+ <string>{% extends ${1:"${2:template}"} %}</string>
<key>name</key>
- <string>extends</string>
+ <string>Extends</string>
<key>scope</key>
<string>source.jinja, text.html.jinja</string>
<key>tabTrigger</key>
<string>extends</string>
<key>uuid</key>
- <string>CE75CB61-2FDA-4139-B21E-7DE143FAFA1B</string>
+ <string>9BE0D536-28D2-4BAB-ACDA-2DEFD0CF291A</string>
</dict>
</plist>
@@ -3,16 +3,16 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>{% filter ${1:filter_name} %}
+ <string>{% filter ${1:filter} %}
$2
{% endfilter %}</string>
<key>name</key>
- <string>filter</string>
+ <string>Filter</string>
<key>scope</key>
<string>source.jinja, text.html.jinja</string>
<key>tabTrigger</key>
<string>filter</string>
<key>uuid</key>
- <string>85C07823-2B9D-4631-88E7-AEF4E1BE9482</string>
+ <string>1437E81D-2EB6-412E-8D6E-48B4D3B0685E</string>
</dict>
</plist>
@@ -3,16 +3,16 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>{% for ${1:item} in ${2:$1s} %}
+ <string>{% for ${1:item} in ${2:sequence} %}
$3
{% endfor %}</string>
<key>name</key>
- <string>for</string>
+ <string>For</string>
<key>scope</key>
<string>source.jinja, text.html.jinja</string>
<key>tabTrigger</key>
<string>for</string>
<key>uuid</key>
- <string>C0C77C85-3A4E-4DAE-AEE3-533FA0DEA0C0</string>
+ <string>2B7AD6C9-0811-43B9-8E12-BE30772C7453</string>
</dict>
</plist>
@@ -3,16 +3,16 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>{% if $1 %}
- $1
+ <string>{% if ${1:expr} %}
+ $2
{% endif %}</string>
<key>name</key>
- <string>if</string>
+ <string>If</string>
<key>scope</key>
<string>source.jinja, text.html.jinja</string>
<key>tabTrigger</key>
<string>if</string>
<key>uuid</key>
- <string>5B95AA2C-B0E7-4886-9A55-90C1939D39C8</string>
+ <string>56CCF05B-99DA-4899-AFF2-438C61BFE6B7</string>
</dict>
</plist>
@@ -3,16 +3,16 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>{% macro ${1:macro_name}($2) %}
+ <string>{% macro ${1:name}(${2:args}) %}
$3
{% endmacro %}</string>
<key>name</key>
- <string>macro</string>
+ <string>Macro</string>
<key>scope</key>
<string>source.jinja, text.html.jinja</string>
<key>tabTrigger</key>
<string>macro</string>
<key>uuid</key>
- <string>D3BE8551-A17F-47A4-A47D-02F00124F984</string>
+ <string>2ECE58B8-7AB7-43DA-B00F-51C2533284AD</string>
</dict>
</plist>
@@ -152,7 +152,7 @@
</dict>
</dict>
<key>match</key>
- <string>\b(block)\s+([a-zA-Z_][a-zA-Z0-9_]*)</string>
+ <string>\s*\b(block)\s+([a-zA-Z_][a-zA-Z0-9_]*)\b</string>
</dict>
<dict>
<key>captures</key>
@@ -169,7 +169,7 @@
</dict>
</dict>
<key>match</key>
- <string>\b(filter)\s+([a-zA-Z_][a-zA-Z0-9_]*)</string>
+ <string>\s*\b(filter)\s+([a-zA-Z_][a-zA-Z0-9_]*)\b</string>
</dict>
<dict>
<key>captures</key>
@@ -186,23 +186,35 @@
</dict>
</dict>
<key>match</key>
- <string>\b(is)\s+([a-zA-Z_][a-zA-Z0-9_]*)</string>
+ <string>\s*\b(is)\s+([a-zA-Z_][a-zA-Z0-9_]*)\b</string>
+ </dict>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>keyword.control.jinja</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>(?&lt;=\{\%-|\{\%)\s*\b([a-zA-Z_][a-zA-Z0-9_]*)\b(?!\s*[,=])</string>
</dict>
<dict>
<key>match</key>
- <string>\b(and|block|call|cycle|elif|else|endblock|endcall|endfilter|endfor|endif|endmacro|endraw|endtrans|extends|filter|for|if|in|include|is|macro|not|or|pluralize|print|raw|recursive|set|trans)\b</string>
+ <string>\b(and|else|if|in|import|not|or|recursive|with(out)?\s+context)\b</string>
<key>name</key>
<string>keyword.control.jinja</string>
</dict>
<dict>
<key>match</key>
- <string>\b(true|false|undefined|none|_)\b</string>
+ <string>\b(true|false|none)\b</string>
<key>name</key>
<string>constant.language.jinja</string>
</dict>
<dict>
<key>match</key>
- <string>\b(loop|super)\b</string>
+ <string>\b(loop|super|self|varargs|kwargs)\b</string>
<key>name</key>
<string>variable.language.jinja</string>
</dict>
@@ -87,60 +87,20 @@
<array>
<string>CB0F3F8E-6062-4610-85B3-8905C61AD85A</string>
<string>488399C0-5D29-4704-BE85-E03A461C34E7</string>
- <string>C0C77C85-3A4E-4DAE-AEE3-533FA0DEA0C0</string>
- <string>5B95AA2C-B0E7-4886-9A55-90C1939D39C8</string>
- <string>24C0F9CE-D3F1-4677-8A2E-EFFE776098F0</string>
- <string>D3BE8551-A17F-47A4-A47D-02F00124F984</string>
- <string>85C07823-2B9D-4631-88E7-AEF4E1BE9482</string>
- <string>73F00DE1-17B0-4C8C-B495-82A3689EB6F1</string>
- <string>CE75CB61-2FDA-4139-B21E-7DE143FAFA1B</string>
- <string>7E9487F0-B012-4735-96DA-124EF3C87B15</string>
- <string>13A0482A-4EA3-406C-A74B-90131C529E25</string>
- <string>4CCD42F3-8E6E-4B96-9D5D-BFB81E714948</string>
- <string>21EA80D9-967D-4681-BD17-765F1688EE5A</string>
- <string>65CCCA35-3231-4B63-B67D-5FB596D833C7</string>
- <string>3D708572-4CD6-40D6-9F3B-CC96784CC069</string>
- <string>3416F5A3-C0A2-4B4B-ABBA-9EA40207E2B4</string>
- <string>6721CF2A-9DA7-4A7E-85C2-FE609E100DE8</string>
- <string>FDE05A63-E81C-474C-A1A9-47FD862F39EE</string>
- <string>9B7F35A9-3A98-4736-9AB3-21BD9BFB5069</string>
- <string>FDFF242A-F3FB-4A4C-BE1A-F1311158B32B</string>
- <string>4BA654F6-F412-4AF9-9CEA-72BD1A709AF4</string>
- <string>93EEDABE-BC52-4883-AF3D-DE4A44C3C246</string>
- <string>307C3853-AA0B-441C-A3D4-DE5CAE2C1673</string>
- <string>0A6ECEB6-410E-4CF5-823E-139E8769BA16</string>
- <string>FBD6F4B2-3206-4CA9-AE99-B2C78149A357</string>
- <string>93E22AC4-B2B8-426D-89C9-FB416F24F975</string>
- <string>6B7CA02D-D6CF-4F16-9A1E-7610DAEBB43F</string>
- <string>7F5037F1-CCC2-4179-98CA-66D001144AC2</string>
- <string>6F1D6BEF-3D53-4EC8-9C42-DF0D1D2E68C5</string>
- <string>78EEA703-C74E-4D71-9DDA-5674E3AB50D7</string>
- <string>1B45C5DE-21D2-4E2A-B7C6-794C9D7ECB99</string>
- <string>B964A222-F305-44C9-B23C-0D2A55112C43</string>
- <string>C2DF4AC6-C586-4F6C-9A97-916558C248D7</string>
- <string>7DE5D7CF-81BB-4AB3-A9B8-938D47918237</string>
- <string>95E641E1-CAA4-4984-B406-54FEC11D5F1B</string>
- <string>E0F620DA-1CDA-4913-AD04-CAC8C63089D8</string>
- <string>E527CC83-06C6-4B54-8FDC-61FB4554B251</string>
- <string>27647146-46AC-4F2A-9069-178E359E55DF</string>
- <string>D64E1E71-A89E-4349-8178-97BC06A5B35F</string>
- <string>866F74E0-D58C-4BCB-A256-3D94CFB612D9</string>
- <string>AE1A2C7A-2D10-466F-9EB0-E8B540E7BA6E</string>
- <string>2EB9BB55-E38C-4FA9-81B7-73B1A73F65C7</string>
- <string>B99D5C37-BE6D-4397-9F32-90BD1A02E016</string>
- <string>A199B66F-5B1A-4210-9B22-1FC6738EAD76</string>
- <string>3F749711-C818-41C2-8FB0-844CD2839617</string>
- <string>823ABA67-7CA7-4F4F-ACC1-7D84AAC56469</string>
- <string>1C0A622E-7F37-437F-95A3-5342DEA80B4E</string>
- <string>DEDD7EB3-FFD2-4BFD-8D59-5DA8ED0F567F</string>
- <string>40423A4E-9ED4-402C-A5BB-193797A73101</string>
- <string>6000AFC3-4398-4500-B055-296D17DDAB48</string>
- <string>CA8BCFEA-2BDB-4CB8-8E31-6388ECEF05BB</string>
<string>889E682B-196A-4424-8A87-EBFDC86BAAFC</string>
<string>44B1526F-5825-40A5-AB42-6433F1DD02D9</string>
<string>07198D95-F344-47EB-B1F2-69F2DC10BA1F</string>
<string>BD126F84-B849-407F-BE62-EF984946EB82</string>
<string>04309583-742D-4470-8FA7-A12EF5536215</string>
+ <string>31E30D4A-5CA5-4E4A-9C13-AB8ED6C1EB94</string>
+ <string>08A0C481-0E5A-425E-9486-EC7D681DA01D</string>
+ <string>502E364B-D4D5-45F0-A996-5E71B3E5B7B6</string>
+ <string>2B7AD6C9-0811-43B9-8E12-BE30772C7453</string>
+ <string>56CCF05B-99DA-4899-AFF2-438C61BFE6B7</string>
+ <string>1437E81D-2EB6-412E-8D6E-48B4D3B0685E</string>
+ <string>152FEFB6-EE41-47D1-B9AD-4E30AF64406C</string>
+ <string>2ECE58B8-7AB7-43DA-B00F-51C2533284AD</string>
+ <string>9BE0D536-28D2-4BAB-ACDA-2DEFD0CF291A</string>
</array>
<key>uuid</key>
<string>B4E6C4DD-43DB-473D-8E0F-662C5E64C31D</string>
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>|batch(${1:rows})$2</string>
- <key>name</key>
- <string>batch</string>
- <key>scope</key>
- <string>source.jinja, text.html.jinja</string>
- <key>tabTrigger</key>
- <string>|</string>
- <key>uuid</key>
- <string>13A0482A-4EA3-406C-A74B-90131C529E25</string>
-</dict>
-</plist>
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>|capture(${1:captured})$2</string>
- <key>name</key>
- <string>capture</string>
- <key>scope</key>
- <string>source.jinja, text.html.jinja</string>
- <key>tabTrigger</key>
- <string>|</string>
- <key>uuid</key>
- <string>21EA80D9-967D-4681-BD17-765F1688EE5A</string>
-</dict>
-</plist>
Oops, something went wrong.

0 comments on commit decf7e3

Please sign in to comment.