Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ To start using cool-helpers you can:
* [Download the last release](https://github.com/bq/cool-helpers/releases/tag/v0.0.2)
* [Install with bower](http://bower.io/): `bower install cool-helpers --save-dev`

###Build the project
### Build the project

If you want to build the project locally, you have to run the [Grunt](http://gruntjs.com/) task `grunt build`. This task will concat and minify the sources and create the README.md. Before all this, you do not forget to run `npm install` and `bower install`.

####Contribute
#### Contribute

If you want to keep growing cool-helpers up, send us a pull request with your new helpers. You must follow this steps:

Expand Down Expand Up @@ -56,25 +56,25 @@ If you want to keep growing cool-helpers up, send us a pull request with your ne

> Commons

###data
### data

> Generates data-attribute from context.type and context.value

{{#data attribute}}{{/data}}

###datas
### datas

> Generates data-attributes from context.type and context.value

{{#datas attributes}}{{/datas}}

###attributes
### attributes

> Generates data-attribute from context.type and context.value

{{#attributes attributes}}{{/attributes}}

###macro
### macro

> Generates a new helper with name key

Expand All @@ -85,19 +85,19 @@ If you want to keep growing cool-helpers up, send us a pull request with your ne

{{mymacro options=options}

###nl2br
### nl2br

> Changes each nl to a br tag

{{#nl2br title}}{{/nl2br}}

###log
### log

> Log one or multiple values to the console:

{{#log title}}{{/log}}

###debug
### debug

> Log one or multiple values to the console, with the current context:

Expand All @@ -109,119 +109,119 @@ If you want to keep growing cool-helpers up, send us a pull request with your ne

> Comparison

###contains
### contains

Conditionally render a block if string matches pattern

{{#contains title "pattern"}}
text
{{/contains}}

###isEmpty
### isEmpty

Conditionally render a block if array list is empty

{{#isEmpty list }}
text
{{/isEmpty}}

###isntEmpty
### isntEmpty

Conditionally render a block if array list inst empty

{{#isntEmpty list }}
text
{{/isntEmpty}}

###isUndefined
### isUndefined

Conditionally render a block if if obj is undefined

{{#isUndefined obj }}
text
{{/isUndefined}}

###exists
### exists

Conditionally render a block if obj exists

{{#exists obj }}
text
{{/exists}}

###and
### and

Conditionally render a block if both a and b properties exists and are not null or undefined

{{#and title name}}
text
{{/and}}

###gt
### gt

Conditionally render a block if value > test

{{#gt 5 2}}
text
{/gt}}

###gte
### gte

Conditionally render a block if value >= test

{{#gte 5 2}}
text
{/gte}}

###is
### is

Conditionally render a block if value === test

{{#is 5 5}}
text
{/is}}

###isnt
### isnt

Conditionally render a block if value !== test

{{#isnt 5 5}}
text
{/isnt}}

###lt
### lt

Conditionally render a block if value < test

{{#lt 5 2}}
text
{/lt}}

###lte
### lte

Conditionally render a block if value <= test

{{#lte 5 2}}
text
{/lte}}

###or
### or

Conditionally render a block if a || b

{{#or a b}}
text
{/or}}

###ifNth
### ifNth

Conditionally render a block if nr%v === 0

{{#ifNth 10 2}}
text
{{/ifNth}}

###compare
### compare

Compares two values with given operator. Operators are: ==, ===, !=, !==, <, >, <=, >=, typeof. Operator must be between quotes "";

Expand Down Expand Up @@ -254,49 +254,49 @@ Compares two values with given operator. Operators are: ==, ===, !=, !==, <, >,

> Math

###add
### add

> Returns value + adition

{{add 5 1}}

###substract
### substract

> Returns value - substraction

{{substract 5 1}}

###divide
### divide

> Returns value % divisor

{{divide 6 3}}

###multiply
### multiply

> Returns value * multiplier

{{multiply 5 2}}

###floor
### floor

Returns Math.floor(value)

{{floor 3.2222}}

###ceil
### ceil

Returns Math.ceil(value)

{{ceil 3.2222}}

###round
### round

Returns Math.round(value)

{{round 3.2222}}

###sum
### sum

Returns sum of each argument

Expand All @@ -312,13 +312,13 @@ Returns sum of each argument

> Date

###formatDate
### formatDate

> Formats date in given format

{{formatDate date 'yyyy/mm/dd'}}

###subtractDate
### subtractDate

> Returns the difference between two dates in given format

Expand All @@ -329,4 +329,4 @@ Returns sum of each argument


--------
<small>_This readme has been automatically generated by [readme generator](https://github.com/aponxi/grunt-readme-generator) on Sun Mar 22 2015 17:38:16 GMT+0100 (Hora estándar romance)._</small>
<small>_This readme has been automatically generated by [readme generator](https://github.com/aponxi/grunt-readme-generator) on Sun Mar 22 2015 17:38:16 GMT+0100 (Hora estándar romance)._</small>