-
Notifications
You must be signed in to change notification settings - Fork 0
0.3.0
ivansglazunov edited this page Feb 18, 2015
·
25 revisions
- JavaScript
- Pure object model
- Sync and async data
- Inheritance simplicity
npm install -g osws-templates`
Command line interface
> osws-templates --help
OSWS Templates CLI
Usage: index [options]
Options:
-h, --help output usage information
-V, --version output the version number
-s, --source <path> Specify source files. By default - all in this directory.
-d, --dest <path> Set output directory. By default - this directory.
-w, --watch Watch to source files.
-c, --context [json] Specify context.
-a, --arguments [json] Specify arguments.
-u, --auto-exit Enable auto exit by pressing Enter.
--dirname <path> Specify gulp-rename option.
--basename <path> Specify gulp-rename option.
--prefix <path> Specify gulp-rename option.
--suffix <path> Specify gulp-rename option.
--extname <path> Specify gulp-rename option.
-
Templates
- new .Prototype()
- [new] .Renderer()
- [new] .Data()
- [new] .data()
- [new] .Tag(...arguments: Array<TSelector|TAttributes>)
- [new] .Single(...arguments: Array<TSelector|TAttributes>)
- [new] .singles[string](...arguments: Array<TSelector|TAttributes>)
- [new] .Double(...arguments: Array<TSelector|TAttributes>) => [new] (...arguments: Array)
- [new] .doubles[string](...arguments: Array<TSelector|TAttributes>) => [new] (...arguments: Array)
- [new] .Doctype(...arguments: Array<TSelector|TAttributes>)
- [new] .doctypes[string](...arguments: Array<TSelector|TAttributes>)
- [new] .xml(...arguments: Array<TSelector|TAttributes>)
- [new] .Mixin()
- .mixin(reconstructor: Function)
- [new] .mixins[string]: Templates.Mixin
- [new] .Module(data: TData) => [new] (...arguments: any[])
- .with
- 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