-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae32160
commit caa7937
Showing
4 changed files
with
182 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>name</key> | ||
<string>Comments</string> | ||
<key>scope</key> | ||
<string>text.html.tpl, source.tpl, custom.compiler.tpl</string> | ||
<key>settings</key> | ||
<dict> | ||
<key>shellVariables</key> | ||
<array> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_START</string> | ||
<key>value</key> | ||
<string>{{-- </string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_END</string> | ||
<key>value</key> | ||
<string> --}}</string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_START_2</string> | ||
<key>value</key> | ||
<string><!-- </string> | ||
</dict> | ||
<dict> | ||
<key>name</key> | ||
<string>TM_COMMENT_END_2</string> | ||
<key>value</key> | ||
<string> --></string> | ||
</dict> | ||
</array> | ||
</dict> | ||
<key>uuid</key> | ||
<string>157b8800-b2cb-11e4-ab27-0800200c9a66</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
# template-highlighter | ||
Nova tpl & ntp highlighter for Sublime Text | ||
# Template Highlighter for Sublime Text | ||
|
||
This package adds highlighting support for tpl view files for Nova Framework in Sublime Text. | ||
|
||
## Install manaually | ||
Clone this repo and place the directory in your Sublime Text Packages folder and restart Sublime Text. | ||
|
||
If your tpl files are not identifeid as Nova TPL then click on View -> Syntax -> Open all current extensions as then click on Nova TPL. | ||
|
||
## Install via Package Control | ||
Coming soon. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"schema_version": "1.0.0", | ||
"packages": [ | ||
{ | ||
"name": "Nova Template Highlighter", | ||
"description": "Nova template syntax highlighter support for Sublime Text.", | ||
"author": "David Carr", | ||
"homepage": "https://github.com/nova-framework/template-highlighter-sublime-text", | ||
"labels": ["php", "nova", "tpl", "language syntax"], | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
%YAML 1.2 | ||
--- | ||
name: Nova TPL | ||
file_extensions: [.tpl] | ||
scope: .tpl | ||
contexts: | ||
main: | ||
- match: '' | ||
push: | ||
- include: 'scope:text.html.basic' | ||
- meta_scope: text.html.tpl | ||
pop: true | ||
with_prototype: | ||
|
||
- match: '{{--' | ||
captures: | ||
0: punctuation.definition.comment.begin.tpl | ||
push: | ||
- meta_scope: comment.block.html.tpl | ||
- match: '--}}' | ||
scope: punctuation.definition.comment.end.tpl | ||
pop: true | ||
- match: "--" | ||
scope: invalid.illegal.bad-comments-or-CDATA.html.tpl | ||
|
||
- match: '\{(!!)|(\{\{\{?)-?' | ||
captures: | ||
0: punctuation.section.embedded.begin.tpl | ||
push: | ||
- meta_scope: entity.name.tag.tpl | ||
- meta_content_scope: source.tpl | ||
- match: '-?(\}?\}\})|(!!)\}' | ||
captures: | ||
0: punctuation.section.embedded.end.tpl | ||
1: punctuation.section.embedded.end.tpl | ||
pop: true | ||
- include: 'scope:source.tpl' | ||
|
||
- match: '@\{\{\{?-?' | ||
captures: | ||
0: punctuation.section.embedded.ignore.begin.tpl | ||
push: | ||
- meta_scope: 'scope:text.html.basic' | ||
- meta_content_scope: 'scope:text.html.basic' | ||
- match: '-?\}?\}\}' | ||
captures: | ||
0: punctuation.section.embedded.ignore.end.tpl | ||
1: punctuation.section.embedded.ignore.end.tpl | ||
pop: true | ||
|
||
- match: '((\s{0}|^)(@)(php)|<\?(?i:php|=)?)(?![^?]*\?>)' | ||
scope: punctuation.section.embedded.begin.php | ||
captures: | ||
0: punctuation.section.embedded.begin.php | ||
3: constant.other.inline-data.html | ||
4: entity.name.tag.block.any.html | ||
push: | ||
- meta_content_scope: source.php | ||
- meta_scope: meta.embedded.block.tpl.php | ||
- include: 'scope:source.php' | ||
with_prototype: | ||
- match: (?=\?>|(\s{0}|^)(@)(endphp))(\?>|(\s{0}|^)(@)(endphp)) | ||
captures: | ||
0: punctuation.section.embedded.end.php | ||
6: constant.other.inline-data.html | ||
7: entity.name.tag.block.any.html | ||
pop: true | ||
|
||
- match: '<\?(?i:php|=)?' | ||
scope: punctuation.section.embedded.begin.php | ||
push: | ||
- meta_content_scope: source.php.tpl | ||
- meta_scope: meta.embedded.line.tpl.php | ||
- include: 'scope:source.php' | ||
with_prototype: | ||
- match: (?=\?>)(\?>) | ||
captures: | ||
0: punctuation.section.embedded.end.php | ||
pop: true | ||
|
||
- match: '(\s{0}|^)(\@)\b(debug|embed|macrodef|set|unset|if|elseif|forelse|foreach|for|while|extends|unless|each|yield|lang|choice|section|include|render|block|can|cannot|inject|partial|hasSection|elsecan|elsecannot|stack|push|layout|continue|break|minify|macro|servers|task|hipchat|slack|story|wpposts|acfrepeater|component|slot)\b(?=(|\s*|)\()' | ||
captures: | ||
0: punctuation.section.embedded.php | ||
2: constant.other.inline-data.html | ||
3: entity.name.tag.block.any.html | ||
push: | ||
- meta_scope: custom.compiler.tpl.php | ||
- meta_content_scope: source.php.tpl | ||
- match: '(?<=\))' | ||
pop: true | ||
- include: 'scope:source.php' | ||
|
||
- match: '(\s{0}|^)(\@)\b(breakpoint|endmacro|endembed|empty|endif|endforelse|endforeach|endfor|endwhile|else|endunless|show|stop|endblock|endpartial|continue|break|endsection|parent|overwrite|endcan|endcannot|append|endpush|markdown|endmarkdown|endminify|endtask|setup|after|endsetup|endafter|endstory|wpquery|wpempty|wpend|acfend|endcomponent|endslot)\b' | ||
scope: custom.compiler.tpl.php | ||
captures: | ||
0: punctuation.section.embedded.php | ||
2: constant.other.inline-data.html | ||
3: entity.name.tag.block.any.html | ||
pop: false | ||
|
||
- match: '(\s{0}|^)(\@)\b([a-zA-Z_]+)\b(?=(|\s*|)\()' | ||
captures: | ||
0: support.function | ||
2: constant.other.inline-data.html | ||
push: | ||
- meta_scope: custom.compiler.tpl.php | ||
- meta_content_scope: source.php.tpl | ||
- match: '(?<=\))' | ||
pop: true | ||
- include: 'scope:source.php' | ||
|
||
- match: '(\s{0}|^)(\@)\b([a-zA-Z_]+)\b(\s?)\b' | ||
scope: custom.compiler.tpl.php | ||
captures: | ||
0: support.function | ||
2: constant.other.inline-data.html | ||
pop: false |