Skip to content

Commit 2a3745c

Browse files
committed
Update README.md
cleaned up the spacing between the headers for the helpers.
1 parent 88bc3b8 commit 2a3745c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ There are a number of variables that are set by default to these helpers and are
1515
- `_collection` - when using a `collection` attribute, the `_collection` variable will be set to the instance of the Rendr collection.
1616
- `_block` - when passing a block to the `view` or `partial` helper, the `_block` variable will be available. This `_block` variable will be the HTML passed in.
1717

18+
1819
#### view
1920
------
20-
2121
The view helper is used to insert a new Rendr view. This is done on the server-side by generating the html and inserting it inline. On the client-side it creates a placeholder, and then in Rendr it will call the `attach` function to create a view instance and insert the HTML. If you don't pass any attributes to the helper, it sets the context (or scope) of the helper to the same as the parents.
2222

2323
You can also pass a block into the helper and it will be available inside of the created view as `_block`. This is helpful when you want to have a chunk of HTML differ in a view, but have the majority of it stay the same.
@@ -35,9 +35,9 @@ Example:
3535
{{/view}}
3636
```
3737

38+
3839
#### partial
3940
------
40-
4141
A partial is HTML only, and it is inserted at compile time of the templates, making them more performant than a view. These are good to use in cases where you don't have any view interaction and just want to reduce the amount of copied HTML. This will inherit the parents context if no attributes are passed into the helper.
4242

4343
Again, you can pass a block into the partial and access the `_block` variable inside of the partial. This is helpful when you want to set a variable chunk of HTML inside of a partial
@@ -55,9 +55,9 @@ Example:
5555
{{/partial}}
5656
```
5757

58+
5859
#### json
5960
------
60-
6161
This helper simply takes an object and runs `JSON.stringify` on the object. You can also pass the [spacing](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#space_argument) into the helper.
6262

6363
Example:
@@ -68,9 +68,9 @@ Example:
6868
{{ json myObject " " }}
6969
```
7070

71+
7172
#### each
7273
------
73-
7474
Iterates an array setting the context to the value of the array element. Works as you would expect the Handlebars [each](http://handlebarsjs.com/builtin_helpers.html#iteration) helper to work, but this adds Rendr specific options set in the context (`_app`, `_model`, `_collection`, `_block`)
7575

7676
Example:
@@ -82,9 +82,9 @@ Example:
8282
</ul>
8383
```
8484

85+
8586
#### forEach
8687
------
87-
8888
Another helper to iterate items in the template, this has a bit more included though. You can iterate objects, arrays, or Collections with this, setting the value and the key attributes in the scope.
8989

9090
Always available in the `forEach` helper

0 commit comments

Comments
 (0)