HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Moduleshakespeare-2.2.0Haskell2010

Text.Julius

A Shakespearean module for Javascript templates, introducing type-safe, compile-time variable and url interpolation.--

You might consider trying Text.Typescript or Text.Coffee which compile down to Javascript.

Further reading: http://www.yesodweb.com/book/shakespearean-templates

Contents
  1. Functions
  2. Template-Reading Functions
  3. Datatypes
  4. Typeclass for interpolated variables
  5. Rendering Functions
  6. internal, used by Text.Coffee
  7. internal
Synopsis

Functions

Template-Reading Functions

These QuasiQuoter and Template Haskell methods return values of type JavascriptUrl url. See the Yesod book for details.

Datatypes

Typeclass for interpolated variables

classclass ToJavascript a where

A typeclass for types that can be interpolated in CoffeeScript templates.

Methods

Instances6ToJavascript

Rendering Functions

valuerenderJavascriptUrl
  1. :: url -> [(Text, Text)] -> Text
  2. -> JavascriptUrl url
  3. -> Text

render with route interpolation. If using this module standalone, apart from type-safe routes, a dummy renderer can be used:

renderJavascriptUrl (\_ _ -> undefined) javascriptUrl

When using Yesod, a renderer is generated for you, which can be accessed within the GHandler monad: Yesod.Core.Handler.getUrlRenderParams.

internal, used by Text.Coffee

internal