From 0eb1ccccd332d77d5c59a2d97c7aa59537f71140 Mon Sep 17 00:00:00 2001 From: Andrea Collet Date: Wed, 18 May 2016 14:00:14 +0200 Subject: [PATCH 1/4] Add gitignore --- .gitignore | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0f22315 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.svn +.sass-cache +node_modules +js/components +_vendor +site/online/**/* +!site/online/.htaccess +.DS_Store +Thumbs.db +npm-debug.log +*.sublime-* +*.zip +*.gzip +*.gz +*.tar From bb3f950be637eda9b20c17a86759fc6ebaf1b855 Mon Sep 17 00:00:00 2001 From: Andrea Collet Date: Wed, 18 May 2016 14:00:20 +0200 Subject: [PATCH 2/4] Add links --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ab1fbb3..894aae5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -# sublime-nunjucks - -A Nunjucks syntax definition specifically for Sublime Text. +# Sublime-nunjucks +A [Nunjucks](https://mozilla.github.io/nunjucks/) syntax definition specifically for Sublime Text 2 and 3. \ No newline at end of file From c7c0d5cfeeaf49cf7d17de5be6b40453f0c7d64b Mon Sep 17 00:00:00 2001 From: Andrea Collet Date: Thu, 19 May 2016 01:54:31 +0200 Subject: [PATCH 3/4] Ignored .subilme-project and .sublime-workspace files --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0f22315..a28a269 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,8 @@ site/online/**/* .DS_Store Thumbs.db npm-debug.log -*.sublime-* +*.sublime-project +*.sublime-workspace *.zip *.gzip *.gz From 09a9370cec820d502d29ef7e572a11dba8ead660 Mon Sep 17 00:00:00 2001 From: Andrea Collet Date: Thu, 19 May 2016 01:54:45 +0200 Subject: [PATCH 4/4] Converted .tmLanguage file to .sublime-syntax --- Nunjucks.sublime-syntax | 435 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 435 insertions(+) create mode 100644 Nunjucks.sublime-syntax diff --git a/Nunjucks.sublime-syntax b/Nunjucks.sublime-syntax new file mode 100644 index 0000000..df3e66a --- /dev/null +++ b/Nunjucks.sublime-syntax @@ -0,0 +1,435 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: HTML (Nunjucks) +file_extensions: + - nunjucks + - nunjs + - njk + - html +scope: text.html.nunjucks +contexts: + main: + - match: "{% comment %}" + push: + - meta_scope: comment.block.nunjucks + - match: "{% endcomment %}" + pop: true + - match: "{#" + push: + - meta_scope: comment.line.number-sign.nunjucks + - match: "#}" + pop: true + - match: "{{" + captures: + 0: entity.tag.tagbraces.nunjucks + push: + - meta_scope: storage.type.variable.nunjucks + - match: "}}" + captures: + 0: entity.tag.tagbraces.nunjucks + pop: true + - include: template_filter + - match: "{%-|{%" + captures: + 0: entity.tag.tagbraces.nunjucks + push: + - meta_scope: storage.type.templatetag.nunjucks + - match: "-%}|%}" + captures: + 0: entity.tag.tagbraces.nunjucks + pop: true + - include: template_tag + - include: template_filter + - match: '(<)([a-zA-Z0-9:]++)(?=[^>]*>)' + captures: + 1: punctuation.definition.tag.begin.html + 2: entity.name.tag.html + push: + - meta_scope: meta.tag.any.html + - match: (>)(<)(/)(\2)(>) + captures: + 1: punctuation.definition.tag.end.html + 2: punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html + 3: punctuation.definition.tag.begin.html + 4: entity.name.tag.html + 5: punctuation.definition.tag.end.html + pop: true + - include: tag-stuff + - match: (<\?)(xml) + captures: + 1: punctuation.definition.tag.html + 2: entity.name.tag.xml.html + push: + - meta_scope: meta.tag.preprocessor.xml.html + - match: (\?>) + captures: + 1: punctuation.definition.tag.html + 2: entity.name.tag.xml.html + pop: true + - include: tag-generic-attribute + - include: string-double-quoted + - include: string-single-quoted + - match: