Templating packages for Haskell

前端 未结 5 1455
孤城傲影
孤城傲影 2020-12-24 03:13

What are some preferred packages for templating in Haskell. Something similar to Django Templates, or PHP.

I don\'t want to always use it with HTML. It can be any ot

相关标签:
5条回答
  • 2020-12-24 03:34

    There is also karver (github) package, not mentioned in other answers. Author says “its syntax is heavily inspired by Jinja2”, but “it isn't as full featured or production ready as Jinja is”.

    0 讨论(0)
  • 2020-12-24 03:38

    Some related packages:

    • Bravo - Static text template generation library
    • chunks - Simple template library with static safety
    • halipeto - Haskell Static Web Page Generator
    • hamlet - Haml-like template files that are compile-time checked
    • hastache - Haskell implementation of Mustache templates
    • heist - An xhtml templating system
    • HStringTemplate - StringTemplate implementation in Haskell.
    • Interpolation - Multiline strings, interpolation and templating.
    • PCLT - Extension to Show: templating, catalogizing, languages, parameters, etc.
    • press - Text template library targeted at the web / HTML generation
    • template - Simple string substitution
    • twine - very simple template language
    0 讨论(0)
  • 2020-12-24 03:50

    hastache seems rather well designed imo. Bravo is a cool idea, but suited for what I want (loops, etc.), and it assumes all parameters are, in some way or another, strings.

    0 讨论(0)
  • 2020-12-24 03:58

    interpolatedstring-perl6 provides a simple and well designed Quasiquoter to produce interpolated String/Text from Templates containing arbitrary Haskell expressions.

    0 讨论(0)
  • 2020-12-24 03:59

    According to the Hackage popularity statistics, the top three packages, by far, are (2014):

    1. (29,000 downloads) shakespeare -- replacement for hamlet.
    2. (27,816 downloads) hamlet -- yesod framework templating
    3. (10,625 downloads) heist -- snap framework templating
    4. (7099 downloads) HStringTemplate -- general purpose templating

    You can see more about these two systems in this question.

    0 讨论(0)
提交回复
热议问题