Skip to content

0.2.1 theory doubles

Ivan S Glazunov edited this page Feb 20, 2015 · 2 revisions

theory about doubles

Ready-to-use double tags. Full documentation.

Available double tags

html body head h1 h2 h3 h4 h5 h6 hgroup div p address blockquote pre ul ol li dl dt dd fieldset legend form noscript object table thead tbody tfoot tr td th col colgroup caption span b big strong i var cite em q del s strike tt code kbd samp small sub sup dfn bdo abbr acronym a button textarea select option article aside figcaption figure footer header section main nav menu audio video embed canvas output details summary mark meter progress template comment title script

Getting from the collection Templates.doubles:
var div = Templates.doubles.div, span = Templates.doubles.span;
Independent use involves the complete syntax:
div(/* string selectors and object attributes */)(/* any content */)
Example:
div('.container[data-src="#other-element"]')('content')
.render(function(result) {
	console.log(result);
});
<div class="container" data-src="#other-element">content</div>
In the content of another element, tags can be used in short:
div('.container')(
	div, // short
	div('.item'), // not complete
	div('.data')('content') // full
).render(console.log);
<div class="container">
	<div></div>
	<div class="item"></div>
	<div class="data">content</div>
</div>
Clone this wiki locally