Skip to content
Simple text templating (mustache/handlebars style) for Racket.
Racket Makefile HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Dali Template Engine

GitHub release Travis Status Coverage Status raco pkg install dali Documentation GitHub stars MIT License

Dali is a Racket implementation of a language similar to Mustache and Handlebars. It tries to be as faithful as possible to Mustache, providing a simple and high-level idiomatic module for callers. Not all features of Handlebars are implemented, or implemented in the same manner, as they are more JavaScript focused.


  • dali - template engine module, provides compile-string, expand-string, and expand-file functions for template expansion. The expand functions rely on the compile function to read the template and convert it into a Racket function for performance and re-use.


The following example expands a very simple template with a nested list. Note that the context provided to the expansion function is simply comprised of hash? and list? structures.

(require dali)
(define template "a list: {{#items}} {{item}}, {{/items}}and that's all")
(define context (hash "items" (list (hash "item" "one")
                                    (hash "item" "two")
                                    (hash "item" "three"))))
(expand-string template context)

The module also provides a cache for loaded and compiled partial to support greater performance.


  • To install (from within the package directory): raco pkg install
  • To install (once uploaded to raco pkg install dali
  • To uninstall: raco pkg remove dali
  • To view documentation: raco docs dali


  • 1.1 - Feature Stable Release

    • Completed documentation, using Mustache flow and examples.
    • Refactored the compiled code for sections, it's now much faster and cleaner.
    • Updated escaping to match the Mustache spec.
    • Support more simple value options, numbers, symbols, booleans, and characters.
    • Added error-missing-value-handler.
  • 1.0 - Initial Version

Racket Language

You can’t perform that action at this time.