Skip to content

Commit 1766d8f

Browse files
author
RWhiteDev
committed
Initial Commit - Files generated and first snippet JSON copied across.
1 parent 5697df0 commit 1766d8f

File tree

9 files changed

+185
-2
lines changed

9 files changed

+185
-2
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Set default behavior to automatically normalize line endings.
2+
* text=auto
3+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
*.vsix

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// A launch configuration that launches the extension inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"runtimeExecutable": "${execPath}",
13+
"args": [
14+
"--extensionDevelopmentPath=${workspaceFolder}"
15+
]
16+
}
17+
]
18+
}

.vscodeignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vscode/**
2+
.vscode-test/**
3+
.gitignore
4+
vsc-extension-quickstart.md

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Change Log
2+
3+
See below for details of all version changes and upgrades.
4+
5+
## [v0.0.1]
6+
7+
- It's just the start!

README.md

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,65 @@
1-
# python-template-snippets
2-
A Visual Studio Code snippet extention for Python templating engines. Currently for Jinja2 and Django.
1+
# python-template-snippets README
2+
3+
This is the README for your extension "python-template-snippets". After writing up a brief description, we recommend including the following sections.
4+
5+
## Features
6+
7+
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
8+
9+
For example if there is an image subfolder under your extension project workspace:
10+
11+
\!\[feature X\]\(images/feature-x.png\)
12+
13+
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
14+
15+
## Requirements
16+
17+
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
18+
19+
## Extension Settings
20+
21+
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
22+
23+
For example:
24+
25+
This extension contributes the following settings:
26+
27+
* `myExtension.enable`: enable/disable this extension
28+
* `myExtension.thing`: set to `blah` to do something
29+
30+
## Known Issues
31+
32+
Calling out known issues can help limit users opening duplicate issues against your extension.
33+
34+
## Release Notes
35+
36+
Users appreciate release notes as you update your extension.
37+
38+
### 1.0.0
39+
40+
Initial release of ...
41+
42+
### 1.0.1
43+
44+
Fixed issue #.
45+
46+
### 1.1.0
47+
48+
Added features X, Y, and Z.
49+
50+
-----------------------------------------------------------------------------------------------------------
51+
52+
## Working with Markdown
53+
54+
**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
55+
56+
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux)
57+
* Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux)
58+
* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets
59+
60+
### For more information
61+
62+
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
63+
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
64+
65+
**Enjoy!**

package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "python-template-snippets",
3+
"displayName": "Python Template Snippets",
4+
"description": "A code snippet extension for Jinja and Django templating engines.",
5+
"version": "0.0.1",
6+
"publisher": "Ricky White",
7+
"engines": {
8+
"vscode": "^1.28.0"
9+
},
10+
"categories": [
11+
"Snippets"
12+
],
13+
"contributes": {
14+
"snippets": [
15+
{
16+
"language": "html",
17+
"path": "./snippets/snippets.json"
18+
}
19+
]
20+
}
21+
}

snippets/snippets.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"New Jinja HTML Template": {
3+
"scope": "html",
4+
"prefix": "ptnew",
5+
"body": [
6+
"{% extends '${1:base.html}' %}",
7+
"\n",
8+
"{% block content %}",
9+
"\t$2",
10+
"{% endblock content %}",
11+
"\n",
12+
"{% block scripts %}",
13+
"{% endblock scripts %}"
14+
],
15+
"description": "Creates the base Jinja / Django template for a new HTML file"
16+
},
17+
18+
"Jinja Variable": {
19+
"scope": "html",
20+
"prefix": "ptvar",
21+
"body": [
22+
"{{ $1 }}$0"
23+
],
24+
"description": "Opens variable tags"
25+
},
26+
27+
"Jinja Code Block": {
28+
"scope": "html",
29+
"prefix": "ptcode",
30+
"body": [
31+
"{% $1 %}$0"
32+
],
33+
"description": "Opens code block tags"
34+
},
35+
36+
"Jinja - Link Static File": {
37+
"scope": "html",
38+
"prefix": "pt-jurl",
39+
"body": [
40+
"{{ url_for('static', filename='$1') }}$0"
41+
],
42+
"description": "Link static file with Jinja"
43+
}
44+
45+
}

vsc-extension-quickstart.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Welcome to your VS Code Extension
2+
3+
## What's in the folder
4+
* This folder contains all of the files necessary for your extension.
5+
* `package.json` - this is the manifest file that defines the location of the snippet file
6+
and specifies the language of the snippets.
7+
* `snippets/snippets.json` - the file containing all snippets.
8+
9+
## Get up and running straight away
10+
* Press `F5` to open a new window with your extension loaded.
11+
* Create a new file with a file name suffix matching your language.
12+
* Verify that your snippets are proposed on intellisense.
13+
14+
## Make changes
15+
* You can relaunch the extension from the debug toolbar after making changes to the files listed above.
16+
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
17+
18+
## Install your extension
19+
* To start using your extension with Visual Studio Code copy it into the `<user home>/.vscode/extensions` folder and restart Code.
20+
* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.

0 commit comments

Comments
 (0)