Skip to content

Commit 7d0c626

Browse files
authored
Merge pull request #7 from EndlessTrax/add-set-snippet
Add set (variable) snippet
2 parents 8ef1019 + ac17fa7 commit 7d0c626

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
See below for details of all version changes and upgrades.
44

5+
## [v1.3]
6+
7+
- Added Jinja `set` snippet as per [issue #6](https://github.com/EndlessTrax/python-template-snippets/issues/6)
8+
59
## [v1.2]
610

711
- Added Jinja comment snippet as per [issue #4](https://github.com/EndlessTrax/python-template-snippets/issues/4)
@@ -19,4 +23,4 @@ See below for details of all version changes and upgrades.
1923

2024
---
2125

22-
### Happy coding!
26+
### Happy coding!

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This VS Code snippet extension includes snippets for both the Jinja2 and Django template engines.
44

5-
Quickly add snippets to HTML template files in your project.
5+
Quickly add snippets to HTML template files in your project.
66

77
If there is a snippet that is not included in this extension, please open an issue on the [repo here](https://github.com/EndlessTrax/python-template-snippets).
88

@@ -52,6 +52,7 @@ Prefix | Output
5252
ptj-url | {{ url_for('static', filename=' `*` ') }}
5353
ptj-mac | {% macro `*` %} {% endmacro %}
5454
ptj-com | {# `*` #}
55+
ptj-set | {% set `*` = `*2` %}
5556

5657
### Django Specific Snippets
5758

@@ -68,7 +69,7 @@ See the [Changelog](https://github.com/EndlessTrax/python-template-snippets/blob
6869

6970
---
7071

71-
This snippet was authored by [Ricky White](https://twitter.com/endlesstrax), and is an open-source extension. Please help to improve this by [submitting issues here](https://github.com/EndlessTrax/python-template-snippets/issues).
72+
This snippet was authored by [Ricky White](https://twitter.com/endlesstrax), and is an open-source extension. Please help to improve this by [submitting issues here](https://github.com/EndlessTrax/python-template-snippets/issues).
7273

7374
If you'd like to sponsor the developwment of this extension, please consider [sponsoring me on GitHub](https://github.com/sponsors/EndlessTrax)
7475

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Flask",
1111
"Web Development"
1212
],
13-
"version": "1.2.0",
13+
"version": "1.3.0",
1414
"publisher": "RickyWhite",
1515
"engines": {
1616
"vscode": "^1.28.0"

snippets/jinja-snippets.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,13 @@
2626
"{# $0 #}"
2727
],
2828
"description": "Adds Jinja comment"
29+
},
30+
"Jinja - Set Variable": {
31+
"scope": "html",
32+
"prefix": "ptj-set",
33+
"body": [
34+
"{% set $1 = $2 %}"
35+
],
36+
"description": "Adds Jinja set variable"
2937
}
3038
}

0 commit comments

Comments
 (0)