Safe Haskell | None |
---|
A Shakespearean module for CoffeeScript, introducing type-safe,
compile-time variable and url interpolation. It is exactly the same as
Text.Julius, except that the template is first compiled to Javascript with
the system tool coffee
.
To use this module, coffee
must be installed on your system.
#{...}
is the Shakespearean standard for variable interpolation, but
CoffeeScript already uses that sequence for string interpolation. Therefore,
Shakespearean interpolation is introduced with %{...}
.
Further reading:
- Shakespearean templates: http://www.yesodweb.com/book/templates
- CoffeeScript: http://coffeescript.org/
- coffee :: QuasiQuoter
- coffeeFile :: FilePath -> Q Exp
- coffeeFileReload :: FilePath -> Q Exp
- coffeeFileDebug :: FilePath -> Q Exp
Functions
Template-Reading Functions
These QuasiQuoter and Template Haskell methods return values of
type
. See the Yesod book for details.
JavascriptUrl
url
Read inline, quasiquoted CoffeeScript.
coffeeFile :: FilePath -> Q ExpSource
Read in a CoffeeScript template file. This function reads the file once, at compile time.
coffeeFileReload :: FilePath -> Q ExpSource
Read in a CoffeeScript template file. This impure function uses unsafePerformIO to re-read the file on every call, allowing for rapid iteration.
coffeeFileDebug :: FilePath -> Q ExpSource
Deprecated synonym for coffeeFileReload