mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Updated README.md
This commit is contained in:
parent
d6de8f0bc7
commit
f865e50575
18
README.md
18
README.md
@ -60,7 +60,7 @@ Syntax highlighting available for [Atom](https://atom.io/) by installing the [la
|
|||||||
- [Comments](#comments)
|
- [Comments](#comments)
|
||||||
- [Whitespace](#whitespace)
|
- [Whitespace](#whitespace)
|
||||||
- [Helpers](#helpers)
|
- [Helpers](#helpers)
|
||||||
[Global Properties](#global-properties)
|
- [Global Properties](#global-properties)
|
||||||
- [Custom Tags and Attributes](#custom-tags-and-attributes)
|
- [Custom Tags and Attributes](#custom-tags-and-attributes)
|
||||||
- [Async Taglib](#async-taglib)
|
- [Async Taglib](#async-taglib)
|
||||||
- [Layout Taglib](#layout-taglib)
|
- [Layout Taglib](#layout-taglib)
|
||||||
@ -74,6 +74,12 @@ Syntax highlighting available for [Atom](https://atom.io/) by installing the [la
|
|||||||
- [Nested Tags](#nested-tags)
|
- [Nested Tags](#nested-tags)
|
||||||
- [Taglib Discovery](#taglib-discovery)
|
- [Taglib Discovery](#taglib-discovery)
|
||||||
- [FAQ](#faq)
|
- [FAQ](#faq)
|
||||||
|
- [Additional Resources](#additional-resources)
|
||||||
|
- [Further Reading](#further-reading)
|
||||||
|
- [Screencasts](#screencasts)
|
||||||
|
- [Demo Apps](#demo-apps)
|
||||||
|
- [Tools](#tools)
|
||||||
|
- [Changelog](#changelog)
|
||||||
- [Discuss](#discuss)
|
- [Discuss](#discuss)
|
||||||
- [Contributors](#contributors)
|
- [Contributors](#contributors)
|
||||||
- [Contribute](#contribute)
|
- [Contribute](#contribute)
|
||||||
@ -1427,7 +1433,7 @@ Marko also supports a short-hand for declaring tags and attributes. The followin
|
|||||||
|
|
||||||
The short-hand will be used for the remaining of this documentation.
|
The short-hand will be used for the remaining of this documentation.
|
||||||
|
|
||||||
### Defining Tags
|
## Defining Tags
|
||||||
|
|
||||||
Tags can be defined by adding `"<tag_name>": <tag_def>` properties to your `marko-taglib.json`:
|
Tags can be defined by adding `"<tag_name>": <tag_def>` properties to your `marko-taglib.json`:
|
||||||
|
|
||||||
@ -1450,9 +1456,9 @@ Tags can be defined by adding `"<tag_name>": <tag_def>` properties to your `mark
|
|||||||
|
|
||||||
Every tag should be associated with a renderer or a template. When a custom tag is used in a template, the renderer (or template) will be invoked at render time to produce the HTML/output. If a `String` path to a `marko-tag.json` for a custom tag then the target `marko-tag.json` is loaded to define the tag.
|
Every tag should be associated with a renderer or a template. When a custom tag is used in a template, the renderer (or template) will be invoked at render time to produce the HTML/output. If a `String` path to a `marko-tag.json` for a custom tag then the target `marko-tag.json` is loaded to define the tag.
|
||||||
|
|
||||||
#### Defining Attributes
|
## Defining Attributes
|
||||||
|
|
||||||
If you provide attributes then the Marko compiler will do validation to make sure only the supported attributes are provided. A wildcard attribute (`"*"`) allows any attribute to be passed in. Below are sample attribute definitions:
|
If you provide attributes then the Marko compiler will do validation to make sure only the supported attributes are provided. A wildcard attribute (`"@*"`) allows any attribute to be passed in. Below are sample attribute definitions:
|
||||||
|
|
||||||
_Multiple attributes:_
|
_Multiple attributes:_
|
||||||
|
|
||||||
@ -1464,7 +1470,7 @@ _Multiple attributes:_
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Scanning for Tags
|
## Scanning for Tags
|
||||||
|
|
||||||
Marko supports a directory scanner to make it easier to maintain a taglib by introducing a few conventions:
|
Marko supports a directory scanner to make it easier to maintain a taglib by introducing a few conventions:
|
||||||
|
|
||||||
@ -1520,7 +1526,7 @@ _In `marko-tag.json`:_
|
|||||||
|
|
||||||
_NOTE: It is not necessary to declare the `renderer` since the scanner will automatically use `renderer.js` as the renderer._
|
_NOTE: It is not necessary to declare the `renderer` since the scanner will automatically use `renderer.js` as the renderer._
|
||||||
|
|
||||||
### Nested Tags
|
## Nested Tags
|
||||||
|
|
||||||
It is often necessary for tags to have a parent/child or ancestor/descendent relationship. For example:
|
It is often necessary for tags to have a parent/child or ancestor/descendent relationship. For example:
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user