-
Notifications
You must be signed in to change notification settings - Fork 0
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.
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;
div(/* string selectors and object attributes */)(/* any content */)
div('.container[data-src="#other-element"]')('content')
.render(function(result) {
console.log(result);
});
<div class="container" data-src="#other-element">content</div>
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>
- TData: Renderer|sync|async|Mixin
- TCallback: (error, result) => void
- TSelector: string
- TInjector: () => void
- TAttributes: [name: string]: TData
- TContext: TData
Node.js:
var T = require('oswst');
Require.js:
define(['oswst'], function(T) {});
window
:
var T = window.oswst(_, async);
-
Templates
- .compile
- .include
- .render
- .renderContext
- .renderAttributes
- .renderSelector
- .sync
- .isSyncFunction
- .async
- .isAsyncFunction
- .Prototype()
- .Renderer > .Prototype
- .Data > .Renderer
- .data > .Data
- .Tag > .data
- .Single > .Tag
- .singles[string]
- .Double > .Tag
- .doubles[string]
- .Doctype > .Tag
- .doctypes[string]
- .xml > .Tag
- .Mixin > .Data
- .mixin > .Mixin
- .mixins[string]
- .Module > .Renderer
- .with