Skip to content

Add set (variable) snippet #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

See below for details of all version changes and upgrades.

## [v1.3]

- Added Jinja `set` snippet as per [issue #6](https://github.com/EndlessTrax/python-template-snippets/issues/6)

## [v1.2]

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

---

### Happy coding!
### Happy coding!
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

Quickly add snippets to HTML template files in your project.
Quickly add snippets to HTML template files in your project.

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).

Expand Down Expand Up @@ -52,6 +52,7 @@ Prefix | Output
ptj-url | {{ url_for('static', filename=' `*` ') }}
ptj-mac | {% macro `*` %} {% endmacro %}
ptj-com | {# `*` #}
ptj-set | {% set `*` = `*2` %}

### Django Specific Snippets

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

---

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).
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).

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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"Flask",
"Web Development"
],
"version": "1.2.0",
"version": "1.3.0",
"publisher": "RickyWhite",
"engines": {
"vscode": "^1.28.0"
Expand Down
8 changes: 8 additions & 0 deletions snippets/jinja-snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,13 @@
"{# $0 #}"
],
"description": "Adds Jinja comment"
},
"Jinja - Set Variable": {
"scope": "html",
"prefix": "ptj-set",
"body": [
"{% set $1 = $2 %}"
],
"description": "Adds Jinja set variable"
}
}