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

View File

@ -46,6 +46,7 @@ module.exports = class Languages
"sql" "sql"
"swig" "swig"
"tss" "tss"
"twig"
"typescript" "typescript"
"vala" "vala"
"visualforce" "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: []
}