Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
9 changes: 9 additions & 0 deletions dot_core.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/browsersample.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h2>Here is the page with customized header template</h2>
{{=it.name}}
</script>

<script src="../doT.min.js" type="text/javascript"></script>
<script src="../doT.js" type="text/javascript"></script>
</head>

<body>
Expand Down