Merge pull request #2689 from edendramis/master

Add FreeMarker syntax highlighting
This commit is contained in:
Arfon Smith
2015-10-19 12:00:38 +01:00
6 changed files with 79 additions and 0 deletions

3
.gitmodules vendored
View File

@@ -680,3 +680,6 @@
[submodule "vendor/grammars/Stata.tmbundle"]
path = vendor/grammars/Stata.tmbundle
url = https://github.com/pschumm/Stata.tmbundle
[submodule "vendor/grammars/FreeMarker.tmbundle"]
path = vendor/grammars/FreeMarker.tmbundle
url = https://github.com/freemarker/FreeMarker.tmbundle

View File

@@ -42,6 +42,8 @@ vendor/grammars/Docker.tmbundle:
- source.dockerfile
vendor/grammars/Elm.tmLanguage:
- source.elm
vendor/grammars/FreeMarker.tmbundle:
- text.html.ftl
vendor/grammars/G-Code/:
- source.LS
- source.MCPOST

View File

@@ -1037,6 +1037,16 @@ Frege:
tm_scope: source.haskell
ace_mode: haskell
FreeMarker:
type: programming
color: "#0050b2"
aliases:
- ftl
extensions:
- .ftl
tm_scope: text.html.ftl
ace_mode: ftl
G-code:
type: data
extensions:

View File

@@ -0,0 +1,31 @@
<#import "layout.ftl" as layout>
<#assign results = [
{
"title": "Example Result",
"description": "Lorem ipsum dolor sit amet, pede id pellentesque, sollicitudin turpis sed in sed sed, libero dictum."
}
] />
<@layout.page title="FreeMarker Example">
<#if results?size == 0>
There were no results.
<#else>
<ul>
<#list results as result>
<li>
<strong>${result.title}</strong>
<p>${result.description}</p>
</li>
</#list>
</ul>
</#if>
<#-- This is a FreeMarker comment -->
<@currentTime />
</@layout.page>
<#macro currentTime>
${.now?string.full}
</#macro>

View File

@@ -0,0 +1,32 @@
<#ftl strip_text=true />
<#macro page title>
<!doctype html>
<html lang="${.lang}">
<head>
<title>${title}</title>
<@metaTags />
</head>
<body>
<#nested />
<@footer />
</body>
</html>
</#macro>
<#---
Default meta tags
-->
<#macro metaTags>
<#compress>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="format-detection" content="telephone=no">
</#compress>
</#macro>
<#macro footer>
<p>This page is using FreeMarker v${.version}</p>
</#macro>