Skip to content

Commit 18e9367

Browse files
author
RWhiteDev
committed
Changed some prefixs. + Updated README.md.
1 parent 598cfbc commit 18e9367

File tree

4 files changed

+57
-18
lines changed

4 files changed

+57
-18
lines changed

README.md

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,70 @@
22

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

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

7-
To install this extension during development copy it into your local `<user home>/.vscode/extensions` folder and restart VS Code.
7+
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).
8+
9+
## Setup
810

9-
## Settings
11+
To install this extension during development copy it into your local `<user home>/.vscode/extensions` folder and restart VS Code.
1012

1113
Works best with `editor.tabCompletion` enabled (`on`) in your VS Code `Settings`.
1214

13-
## Features
15+
## Usage
16+
17+
Simply type `pt` to start using any of the snippets. The full documentation is below.
18+
19+
This extension works best with `editor.tabCompletion` enabled (`on`) in your VS Code `Settings`.
20+
21+
## Changelog
22+
23+
The full changelog can be found [here](CHANGELOG.md).
24+
25+
## Documentation
26+
27+
See the tables below for general, jinja, django snippets. The `*` denotes where the cursor will start so you can start typing your variables etc. straight the way without wasting key strokes! A `*2` denotes the second position upon hitting the `tab` key again.
28+
29+
### General Snippets
30+
31+
Prefix | Output
32+
-------|-------
33+
ptnew | Creates a simple base template for any Jinja/Django HTML file
34+
ptvar | {{ `*` }}
35+
ptfilt | {{ `* | *2` }}
36+
ptcode | {% `*` %}
37+
ptblock | {% block `*` %} {% endblock `*` %}
38+
ptext | {% extends ' `*` ' %}
39+
ptsup | {{ `super()` }}
40+
ptfor | Adds a `for` loop block
41+
ptif | Adds an `if` statement block
42+
ptifel | Adds an `if/else` statement block
43+
ptelif | Adds an `if/elif/else` statement block
44+
ptwith | Adds a `with` statement block
45+
46+
### Jinja Specific Snippets
1447

15-
Coming soon...
48+
Prefix | Output
49+
-------|-------
50+
ptj-url | {{ url_for('static', filename=' `*` ') }}
51+
ptj-mac | {% macro `*` %} {% endmacro %}
1652

17-
## Known Issues
53+
### Django Specific Snippets
1854

19-
Too many to list before release.
55+
Prefix | Output
56+
-------|-------
57+
ptd-url | {% url ' `*` ' `*2` %}
58+
ptd-load | {% load `*` %}
59+
ptd-stat | {% static ' `*` ' %}
2060

2161
## Release Notes
2262

23-
Coming soon...
63+
### 1.0
2464

25-
### 0.0.1
65+
- Initial release! Yay me!
2666

27-
- Initial development
67+
---
2868

29-
-----------------------------------------------------------------------------------------------------------
69+
This snippet was authored by [Ricky White](https://rickywhite.net/), and is an open-source extension. Please help to improve this by [submitting issues here](https://github.com/EndlessTrax/python-template-snippets).
3070

3171
**Happy Coding!**

snippets/django-snippets.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"Django - Url Tags": {
33
"scope": "html",
4-
"prefix": "pt-durl",
4+
"prefix": "ptd-url",
55
"body": [
66
"{% url '$1' $2%}$0"
77
],
88
"description": "Adds Django URL block"
9-
},
9+
},
1010

1111
"Django - Load tags": {
1212
"scope": "html",
13-
"prefix": "pt-dload",
13+
"prefix": "ptd-load",
1414
"body": [
1515
"{% load $1 %}$0"
1616
],
@@ -19,7 +19,7 @@
1919

2020
"Django - Static File": {
2121
"scope": "html",
22-
"prefix": "pt-dstat",
22+
"prefix": "ptd-stat",
2323
"body": [
2424
"{% static '$1' %}$0"
2525
],

snippets/jinja-snippets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Jinja - Link Static File": {
33
"scope": "html",
4-
"prefix": "pt-jurl",
4+
"prefix": "ptj-url",
55
"body": [
66
"{{ url_for('static', filename='$1') }}$0"
77
],
@@ -10,7 +10,7 @@
1010

1111
"Jinja - Macros": {
1212
"scope": "html",
13-
"prefix": "pt-jmac",
13+
"prefix": "ptj-mac",
1414
"body": [
1515
"{% macro $1 %}",
1616
"\t$0",

snippets/snippets.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,4 @@
131131
],
132132
"description": "Adds with statement"
133133
}
134-
135134
}

0 commit comments

Comments
 (0)