Skip to content

Commit

Permalink
removed all jinja references and added django references
Browse files Browse the repository at this point in the history
  • Loading branch information
Bibhas committed Aug 29, 2016
1 parent e2e3dc5 commit e977007
Show file tree
Hide file tree
Showing 12 changed files with 197 additions and 199 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# Jinja for Visual Studio Code
# Django Templates for Visual Studio Code

[![Join the chat at https://gitter.im/wholroyd/vscode-jinja](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/wholroyd/vscode-jinja?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
This extension adds language colorization support and user snippets for the Django template language to VS Code.

This extension adds language colorization support for the Jinja template language to VS Code.
This is based on the [Jinja extension](https://marketplace.visualstudio.com/items?itemName=wholroyd.jinja) by the awesome [wholroyd](https://github.com/wholroyd/vscode-jinja/).

![IDE](https://raw.githubusercontent.com/wholroyd/vscode-jinja/master/example.png)
![IDE](https://raw.githubusercontent.com/iambibhas/vscode-django-template/master/example.png)

## Using

First, you will need to install Visual Studio Code `0.10`. In the command palette (`cmd-shift-p`) select `Install Extension` and choose `Jinja`.

The downside of the Jinja language is that there is no defined file extension and as such, there is no way to detect it automatically in all cases. This extension will look for it in two file extensions - .html and .j2. The .j2 file extension is heavily used with Ansible which uses the Jinja2 engine underneath.
In the command palette (`ctrl-shift-p`) select `Install Extension` and choose `Django Template`.

## Contributing

Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "layout.html" %}
{% block body %}
<ul>
{% for user in users %}
<li><a href="{% url 'user-profile' user.username %}">{{ user.username }}</a></li>
{% endfor %}
</ul>
{% endblock body %}
9 changes: 0 additions & 9 deletions example.j2

This file was deleted.

Binary file modified example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions jinja-yaml.configuration.json

This file was deleted.

10 changes: 0 additions & 10 deletions jinja.configuration.json

This file was deleted.

62 changes: 21 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,54 @@
{
"name": "jinja",
"version": "0.0.7",
"publisher": "wholroyd",
"name": "django-html",
"version": "1.0.0",
"publisher": "bibhasdn",
"author": {
"name": "William Holroyd"
"name": "Bibhas Debnath"
},
"license": "MIT",
"icon": "icon.png",
"description": "Jinja template language support for Visual Studio Code",
"displayName": "Jinja",
"description": "Django template language support for Visual Studio Code",
"displayName": "Django Template",
"repository": {
"type": "git",
"url": "https://github.com/wholroyd/vscode-jinja.git"
"url": "https://github.com/iambibhas/vscode-django-template.git"
},
"bugs": {
"url": "https://github.com/wholroyd/vscode-jinja/issues"
"url": "https://github.com/iambibhas/vscode-django-template/issues"
},
"categories": [
"Languages",
"Snippets",
"Linters"
],
"engines": {
"vscode": "0.10.x"
"vscode": "^1.0.0"
},
"contributes": {
"languages": [
{
"id": "jinja",
"aliases": [
"Jinja"
],
"extensions": [".j2"],
"configuration": "./jinja.configuration.json"
},
{
"id": "html",
"aliases": [
"Jinja",
"Django Template",
"HTML"
],
"extensions": [".j2", ".html", ".htm"],
"extensions": [".html", ".htm"],
"configuration": "./jinja-html.configuration.json"
},
{
"id": "yaml",
"aliases": [
"Jinja",
"YAML"
],
"extensions": [".j2", ".eyaml", ".eyml", ".yaml", ".yml", ".sls"],
"configuration": "./jinja-yaml.configuration.json"
}
],
"grammars": [
{
"language": "jinja",
"scopeName": "source.jinja",
"path": "./syntaxes/jinja.json"
},
{
"language": "html",
"scopeName": "text.html.jinja",
"path": "./syntaxes/jinja-html.json"
},
{
"language": "yaml",
"scopeName": "text.yaml.jinja",
"path": "./syntaxes/jinja-yaml.json"
"scopeName": "text.html.django",
"path": "./syntaxes/django-html.json"
}
]
],
"snippets": [
{
"language": "html",
"scopeName": "text.html.django",
"path": "./snippets/django-snippets.json"
}
]
}
}
89 changes: 89 additions & 0 deletions snippets/django-snippets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"Comment": {
"prefix": "comment",
"description": "Comment block",
"body": [
"{% comment \"$1\" %}",
"$2",
"{% endcomment %}"
]
},
"For loop": {
"prefix": "for",
"description": "For loop",
"body": [
"{% for $1 in $2 %}",
"$3",
"{% endfor %}"
]
},
"For-Empty loop": {
"prefix": "forempty",
"description": "For-Empty loop",
"body": [
"{% for $1 in $2 %}",
"$3",
"{% empty %}",
"$4",
"{% endfor %}"
]
},
"If condition": {
"prefix": "if",
"description": "IF condition",
"body": [
"{% if $1 %}",
"$2",
"{% else %}",
"{% endif %}"
]
},
"Include": {
"prefix": "include",
"description": "Include other templates",
"body": [
"{% include \"$1\" %}"
]
},
"Lorem": {
"prefix": "lorem",
"description": "Generate Lorem Text Block",
"body": [
"{% lorem ${how_many_paragraphs} %}"
]
},
"Spaceless": {
"prefix": "spaceless",
"description": "Removes whitespaces in between",
"body": [
"{% spaceless %}",
"$1",
"{% endspaceless %}"
]
},
"Template Block": {
"prefix": "block",
"description": "Creates a block",
"body": [
"{% block $1 %}",
"$2",
"{% endblock $1 %}"
]
},
"URL": {
"prefix": "url",
"description": "URL tag",
"body": [
"{% url '${some-url-name}' ${arg} %}"
]
},
"With": {
"prefix": "with",
"description": "With block",
"body": [
"{% with ${local_var}=${context_var} %}",
"$1",
"{% endwith %}"
]
}
}
Loading

0 comments on commit e977007

Please sign in to comment.