-
Notifications
You must be signed in to change notification settings - Fork 0
0.3.0
Ivan S Glazunov edited this page Feb 23, 2015
·
25 revisions
- JavaScript
- Pure object model
- Sync and async data
- Inheritance simplicity
npm install -g oswst
Command line interface
> oswst --help
OSWS Templates CLI
Usage: oswst [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.
-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.
-e, --extname <path> Specify gulp-rename option.
- 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(filebody: string, filepath: string)
- .include(id: string)
- .render(data: TData, callback: TCallback, context?: TContext)
- .renderContext(string: string, context: Object, callback: TCallback)
- .renderAttributes(attributes: TAttributes, callback: TCallback, context?: TContext)
- [.renderSelector(attributes: TAttributes, selector: TSelector)](0.3.0-Templates#renderSelector)
- .sync(argument: Function)
- .isSyncFunction(argument: Function)
- .async(argument: Function)
- .isAsyncFunction(argument: Function)
- new .Prototype()
- [new] .Renderer() > .Prototype
- [new] .Data() > .Renderer
- [new] .data() > .Data
-
[new] .Tag(...arguments: Array<TSelector|TAttributes>) > .data
- ._name: TData
- .name(name: TData) => this
- ._attributes: TAttributes
- .attributes(attributes: TAttributes) => this
- .selector(selector: TSelector) => this
- ._renderTag(name: string, data: TData, attributes: TAttributes, callback: TCallback) => void
- ._render(callback: TCallback, context: TContext) => void
- [new] .Single(...arguments: Array<TSelector|TAttributes>) > .Tag
- [new] .singles[string](...arguments: Array<TSelector|TAttributes>)
- [new] .Double(...arguments: Array<TSelector|TAttributes>) => [new] (...arguments: Array) > .Tag
- [new] .doubles[string](...arguments: Array<TSelector|TAttributes>) => [new] (...arguments: Array)
- [new] .Doctype(...arguments: Array<TSelector|TAttributes>) > .Tag
- [new] .doctypes[string](...arguments: Array<TSelector|TAttributes>)
- [new] .xml(...arguments: Array<TSelector|TAttributes>) > .Tag
- [new] .Mixin() > .Data
- .mixin(reconstructor: Function) > .Mixin
- [new] .mixins[string]: Templates.Mixin
- [new] .Module(data: TData) => [new] (...arguments: any[]) > .Renderer
- .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