Closes #309. Add language Twig and use Pretty Diff beautifier.

This commit is contained in:
Glavin Wiechert 2015-06-06 15:10:35 -03:00
parent 1fb211199e
commit 52d0538f41
5 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>My Webpage</title>
</head>
<body>
<ul id="navigation">
{% for item in navigation %}
<li><a href="{{ item.href }}">{{ item.caption }}</a></li>
{% endfor %}
</ul>
<h1>My Webpage</h1>
{{ a_variable }}
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<title>My Webpage</title>
</head>
<body>
<ul id="navigation">
{% for item in navigation %}
<li><a href="{{ item.href }}">{{ item.caption }}</a></li>
{% endfor %}
</ul>
<h1>My Webpage</h1>
{{ a_variable }}
</body>
</html>

View File

@ -28,6 +28,7 @@ module.exports = class PrettyDiff extends Beautifier
Sass: true
JSON: true
TSS: true
Twig: true
LESS: true
Swig: true
Visualforce: true
@ -44,7 +45,7 @@ module.exports = class PrettyDiff extends Beautifier
switch language
when "CSV"
lang = "csv"
when "EJS"
when "EJS", "Twig"
lang = "ejs"
when "ERB"
lang = "html_ruby"

View File

@ -46,6 +46,7 @@ module.exports = class Languages
"sql"
"swig"
"tss"
"twig"
"typescript"
"vala"
"visualforce"

24
src/languages/twig.coffee Normal file
View File

@ -0,0 +1,24 @@
module.exports = {
name: "Twig"
description: "Twig"
namespace: "twig"
fallback: ['html', 'js', 'php']
###
Supported Grammars
###
grammars: [
"HTML (Twig)"
]
###
Supported extensions
###
extensions: [
'twig'
]
options: []
}