Update README.md

added documentation for rt-include
This commit is contained in:
Eitan Rousso 2016-02-05 10:16:02 +02:00
parent 6bc41f0113
commit 28da7538d3
1 changed files with 29 additions and 0 deletions

View File

@ -46,6 +46,7 @@ http://plugins.jetbrains.com/plugin/7648
* [rt-class](#rt-class) * [rt-class](#rt-class)
* [rt-require](#rt-require) * [rt-require](#rt-require)
* [rt-template](#rt-template) * [rt-template](#rt-template)
* [rt-include](#rt-include)
* [styles](#styles) * [styles](#styles)
* [event handlers](#event-handlers) * [event handlers](#event-handlers)
@ -269,6 +270,34 @@ define([
}); });
``` ```
## rt-include
Optionally choose to extract static contents out of rt files.<br>
rt-include is a "macro" that takes a text file (e.g svg/html/xml) and injects it into the file as if it was part of the original markup.
###### Sample:
given `main.rt`:
```html
<div>
<rt-include src="./my-icon.svg" />
</div>
```
and `my-icon.svg`:
```html
<svg xmlns="http://www.w3.org/2000/svg">
<rect height="50" width="50" style="fill: #00f"/>
</svg>
```
is equivalent to:
```html
<div>
<svg xmlns="http://www.w3.org/2000/svg">
<rect height="50" width="50" style="fill: #00f"/>
</svg>
</div>
```
## style ## style
React templates allow the settings of styles inline in HTML, optionally returning an object from the evaluation context. By default, style names will be converted from hyphen-style to camelCase-style naming. React templates allow the settings of styles inline in HTML, optionally returning an object from the evaluation context. By default, style names will be converted from hyphen-style to camelCase-style naming.