|
2 | 2 |
|
3 | 3 | This VS Code snippet extension includes snippets for both the Jinja2 and Django template engines. |
4 | 4 |
|
5 | | -## Installation |
| 5 | +Quickly add snippets to HTML template files in your project. |
6 | 6 |
|
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 |
8 | 10 |
|
9 | | -## Settings |
| 11 | +To install this extension during development copy it into your local `<user home>/.vscode/extensions` folder and restart VS Code. |
10 | 12 |
|
11 | 13 | Works best with `editor.tabCompletion` enabled (`on`) in your VS Code `Settings`. |
12 | 14 |
|
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 |
14 | 47 |
|
15 | | -Coming soon... |
| 48 | +Prefix | Output |
| 49 | +-------|------- |
| 50 | +ptj-url | {{ url_for('static', filename=' `*` ') }} |
| 51 | +ptj-mac | {% macro `*` %} {% endmacro %} |
16 | 52 |
|
17 | | -## Known Issues |
| 53 | +### Django Specific Snippets |
18 | 54 |
|
19 | | -Too many to list before release. |
| 55 | +Prefix | Output |
| 56 | +-------|------- |
| 57 | +ptd-url | {% url ' `*` ' `*2` %} |
| 58 | +ptd-load | {% load `*` %} |
| 59 | +ptd-stat | {% static ' `*` ' %} |
20 | 60 |
|
21 | 61 | ## Release Notes |
22 | 62 |
|
23 | | -Coming soon... |
| 63 | +### 1.0 |
24 | 64 |
|
25 | | -### 0.0.1 |
| 65 | +- Initial release! Yay me! |
26 | 66 |
|
27 | | -- Initial development |
| 67 | +--- |
28 | 68 |
|
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). |
30 | 70 |
|
31 | 71 | **Happy Coding!** |
0 commit comments