diff --git a/README.md b/README.md index 602a6e3..2f63c4f 100644 --- a/README.md +++ b/README.md @@ -252,6 +252,9 @@ It requires `optimist` module, so install it before use. **HAML!** If you have `haml` executable in your PATH `.haml` files will be passed through it before compilation! +####Creating Browser side dot.js file +`coffee --join dot.js --compile dot_core.coffee settings\original.coffee do_t.coffee` + ##License: - doT is an open source component of http://bebedo.com - doT is licensed under the MIT License. (See LICENSE-DOT) diff --git a/dot_core.coffee b/dot_core.coffee index 8880a30..4955a5a 100644 --- a/dot_core.coffee +++ b/dot_core.coffee @@ -8,11 +8,20 @@ class DotCore compile: (tmpl, compileParams = {}) -> compileParams.def ||= {} compileParams.doT ||= @ + + # Compatibility with original dot.template command(templ,,def) + if arguments.length == 3 && arguments[2]? + compileParams.def = arguments[2] + mangles_list = Object.keys(@mangles).sort() for m_id, m_name of mangles_list tmpl = @mangles[m_name].call compileParams, tmpl, compileParams tmpl + # Compatibilty shim for older doT + template: DotCore::compile + + # cache functions getCached: (tmpl) -> return @cache unless tmpl diff --git a/examples/browsersample.html b/examples/browsersample.html index 2feb3a3..20540e7 100644 --- a/examples/browsersample.html +++ b/examples/browsersample.html @@ -25,7 +25,7 @@

Here is the page with customized header template

{{=it.name}} - +