Skip to content

Commit

Permalink
update & bugfixes
Browse files Browse the repository at this point in the history
## Bug Fixes
- Refactoring in `{include}` tag.
- Remove if-end (not usable).
- Remove foreach-end (not usable).

## New Features
- Add `{insert}` tag.
- Add `{cycle}` tag.
- Add `{extends}` tag.
- Add `{block}` tag.
- Add `{use}` tag.

## Changes
- Update Fenom.tpl (example file).
  • Loading branch information
pafnuty committed Aug 31, 2015
1 parent 8fe14dc commit 26b760a
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 27 deletions.
23 changes: 13 additions & 10 deletions Examples/Fenom.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,6 @@
Remove all HTML <b>tags</b> and truncate {$text} to 20 symbols
{/filter}

{for $counter=<start> to=<end> [step=<step>] [index=$index] [first=$first] [last=$last]}
{* ...code... *}
{break}
{* ...code... *}
{continue}
{* ...code... *}
{forelse}
{* ...code... *}
{/for}

{foreach $list as [$key =>] $value [index=$index] [first=$first] [last=$last]}
{* ...code... *}
{break}
Expand All @@ -203,6 +193,12 @@
var data = {"time": obj.ts};
{/ignore}

{if:ignore $cdn.yandex}
var item = {cdn: "//yandex.st/"};
{/if}
{script:ignore} ... {/script}
{foreach:ignore ...} ... {/foreach}

{include "about.tpl" page=$item limit=50}

{insert 'b.tpl'}
Expand All @@ -225,6 +221,13 @@
...
{/autoescape}

{autoescape true}
...
{my_func page=5} {* escape *}
{my_func:raw page=5} {* unescape *}
...
{/autoescape}

{switch $type}
{case 'new'}
It is new item
Expand Down
7 changes: 7 additions & 0 deletions Snippets/cycle.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<snippet>
<content><![CDATA[
${FENOM_LDELIM:\{}cycle [${1:'odd', 'even'}]${2: index=\$i}${FENOM_RDELIM:\}}$0
]]></content>
<tabTrigger>cycle</tabTrigger>
<scope>text.html.fenom,source.fenom</scope>
</snippet>
10 changes: 10 additions & 0 deletions Snippets/extends.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[
${FENOM_LDELIM:\{}block '${1:blockName}'${FENOM_RDELIM:\}}
${2}
${FENOM_LDELIM:\{}/block${FENOM_RDELIM:\}}
${0}
]]></content>
<tabTrigger>block</tabTrigger>
<scope>text.html.fenom,source.fenom</scope>
</snippet>
9 changes: 9 additions & 0 deletions Snippets/filter.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<snippet>
<content><![CDATA[
${FENOM_LDELIM:\{}filter|${1:strip_tags}${FENOM_RDELIM:\}}
$0
${FENOM_LDELIM:\{}/filter${FENOM_RDELIM:\}}
]]></content>
<tabTrigger>filter</tabTrigger>
<scope>text.html.fenom,source.fenom</scope>
</snippet>
7 changes: 0 additions & 7 deletions Snippets/foreach-end.sublime-snippet

This file was deleted.

7 changes: 0 additions & 7 deletions Snippets/if-end.sublime-snippet

This file was deleted.

2 changes: 1 addition & 1 deletion Snippets/include.sublime-snippet
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[
${FENOM_LDELIM:\{}include file="${1:file}"${3: assign=${2:name}}${6: ${4:var1}=${5:value}}${FENOM_RDELIM:\}}$0
${FENOM_LDELIM:\{}include '${1:file.tpl}'${3: var='${2:value}'}${6: ${4:var1}='${5:value1}'}${FENOM_RDELIM:\}}$0
]]></content>
<tabTrigger>include</tabTrigger>
<scope>text.html.fenom,source.fenom</scope>
Expand Down
7 changes: 7 additions & 0 deletions Snippets/insert.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<snippet>
<content><![CDATA[
${FENOM_LDELIM:\{}insert '${1:file.tpl}'${FENOM_RDELIM:\}}$0
]]></content>
<tabTrigger>insert</tabTrigger>
<scope>text.html.fenom,source.fenom</scope>
</snippet>
7 changes: 7 additions & 0 deletions Snippets/use.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<snippet>
<content><![CDATA[
${FENOM_LDELIM:\{}use '${1:file.tpl}'${FENOM_RDELIM:\}}$0
]]></content>
<tabTrigger>use</tabTrigger>
<scope>text.html.fenom,source.fenom</scope>
</snippet>
5 changes: 3 additions & 2 deletions messages.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"install": "README.md",
"2014.09.13.00.00.00": "messages/2014.09.13.md"
"2015.02.13.00.00.00": "messages/2015.02.13.md"
"2014.09.13.00.00.00": "messages/2014.09.13.md",
"2015.02.13.00.00.00": "messages/2015.02.13.md",
"2015.08.31.00.00.00": "messages/2015.08.31.md"
}
19 changes: 19 additions & 0 deletions messages/2015.08.31.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Fenom plugin Changelog

Your Fenom plugin is updated. Enjoy new version. For any type of feedback you can use [GitHub issues][issues].

## Bug Fixes
- Refactoring in `{include}` tag.
- Remove if-end (not usable).
- Remove foreach-end (not usable).

## New Features
- Add `{insert}` tag.
- Add `{cycle}` tag.
- Add `{extends}` tag.
- Add `{block}` tag.
- Add `{use}` tag.

## Changes
- Update Fenom.tpl (example file).
[issues]: https://github.com/pafnuty/sublime-fenom/issues

0 comments on commit 26b760a

Please sign in to comment.