Questions tagged [heist]

Heist is a Haskell template system supporting both HTML5 and XML.

Heist is a Haskell template system supporting both HTML5 and XML. It is commonly used with the Snap Framework, but it can be used standalone as well.

Links

47 questions
10
votes
2 answers

Digestive Functors with a variable number of subforms (Snap/Heist)

I'm working on porting a site from PHP to Snap w/ Heist. I've ported some of the simpler forms to using Digestive Functors successfully, but now I have to do the tricky ones that require the use of subforms. This application manages producing…
cimmanon
  • 67,211
  • 17
  • 165
  • 171
7
votes
1 answer

Using values not from the application monad with Heist templates

I'm trying to write an application server using Happstack, Heist, and web-routes, but am having trouble figuring out how to let splices access values that don't originate from my application's monad stack. There are two situations where this comes…
Paul Kuliniewicz
  • 2,711
  • 18
  • 24
6
votes
3 answers

Heist: How do I insert a dynamic list of sub-templates into a template?

I am writing a site for online surveys. I have a list of questions that all go on one html page and the list is of unknown length. Each question has the form stored in template qu1.tpl and the page is qu.tpl. Now I want to: replace some names in…
maf
  • 71
  • 2
5
votes
1 answer

Why does my "apply" tag no longer work in Heist 0.11.0.1?

I recently upgraded the version of Heist I'm using. It was mostly an arbitrary decision and I'm still seeing the consequences of that action, mostly in terms of more pleasing code structure. But, I was relying pretty heavily on the "apply" tag…
Savanni D'Gerinel
  • 2,379
  • 17
  • 27
4
votes
1 answer

Snap: compiled splices code example

I think I did asked a similar question some time ago but it was not answered due to unstable API. So I was waiting for the 0.13 to pass by. I am not sure if it is correct to bring up a similar question...? What is the alternative to interpreted…
r.sendecky
  • 9,933
  • 9
  • 34
  • 62
4
votes
1 answer

Does Splice support Unicode?

This is my code : testSplice :: C.Splice Handler testSplice = return $ C.yieldRuntimeText $ do return "中文" And I bind it to a tag: splices :: Splices (C.Splice Handler) splices = "testSplice" ## testSplice And used it on…
Lynton
  • 257
  • 5
  • 12
3
votes
1 answer

Form library suited for Snap and Heist

I am looking for a library that helps me create forms using Snap and Heist. There is no "blessed" form library for Snap that I know of, and none of the stray ones on Hackage seem to be particularly suited for the declarative nature of Heist…
dflemstr
  • 25,947
  • 5
  • 70
  • 105
3
votes
1 answer

Adding OnLoad hooks for Heist templates using the Snap Web Framework

I wish to add some hooks for pre-processing Heist templates in a web application using Snap. My naïve approach so far has been to use the following code in my application initializer: app :: SnapletInit App App app = makeSnaplet "app" "The main web…
dflemstr
  • 25,947
  • 5
  • 70
  • 105
3
votes
1 answer

Static files in a Snaplet

I'd like to serve some static files from a Snaplet in the Snap framework. How do I do that? The documentation is not exactly clear. I know how to add routes and stuff, but I'm stuck at two problems: What would I need to pass to serveDirectory to…
user355252
3
votes
1 answer

Embedding a Heist tag inside of a javascript

Due to some library incompatibilities, I'm not able to use both Pandoc and Heist in the same application. As such, I decided to go with Markdown.JS to handle converting from Markdown format data into HTML in the client's browser. This could have…
Savanni D'Gerinel
  • 2,379
  • 17
  • 27
2
votes
2 answers

How to preserve javascript in heist template from escaping?

I'm using Snap framework with Heist templating engine. The problem is that Heist corrupts javascript code inlined into html: Transformed into:
max taldykin
  • 12,459
  • 5
  • 45
  • 64
2
votes
1 answer

Is there an alternative to textSplice that does not escape the content?

https://hackage.haskell.org/package/heist-1.0.1.0/docs/Heist-Interpreted.html#v:textSplice textSplice appears to escape the contents. It replaces < to < for example. How can I avoid this escaping behaviour?
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
2
votes
1 answer

How to use Snap/Heist without creating routes automatically for every template

Is it possible to use Snap/Heist in such a way that not every template has an auto-generated route? For example, suppose I have a template called "outline" with an tag, and a template called "index" which calls
scottmsul
  • 119
  • 1
  • 2
  • 5
2
votes
1 answer

Working with routes and html (Heist) in Snap

I have templates (*.tpl) in my-snap-app/snaplets/heist/templates (main.tpl, page1.tpl, page2.tpl, page3.tpl). And here's my Main.hs: import Snap.Http.Server import Snap.Core import Snap.Snaplet import Snap.Snaplet.Heist import…
user266003
2
votes
1 answer

Type names prefixed with package name and version

I'm pretty new to Haskell, and I'm trying to follow along with the Happstack Crash Course. I've done some of the examples, but when I tried the happstack-heist example, I got a strange compilation error. The file that I'm compiling looks like…
Rose Kunkel
  • 3,102
  • 2
  • 27
  • 53
1
2 3 4