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
1
vote
1 answer

Snap: rendering table with compiled splices

Well, this is another obstacle with compiled splices that I struggle to overcome. I had some trouble when I first did it with the original interpreted splices and now I am stuck translating it to compiled variant. The original problem is described…
r.sendecky
  • 9,933
  • 9
  • 34
  • 62
1
vote
1 answer

Snap: compiled splice dependent on runtime decision and URL variable

I have a situation where I have to construct compiled splices and feed data into them which depends on the URL variable. I struggle to solve the problem. So there is simple file name list that needs to be rendered in a table. Simple. Files belong to…
r.sendecky
  • 9,933
  • 9
  • 34
  • 62
1
vote
1 answer

How to show utf8 text with snap and heist?

I have used writeBS writeText from Snap and renderTemplate from heist but none of them seems to support unicode. site :: Snap () site = do ifTop (writeBS "你好世界") <|> route [("test", testSnap)] testSnap :: Snap () testSnap = do fromJust…
Lynton
  • 257
  • 5
  • 12
1
vote
1 answer

What is the default AttrSplices for Heist-0.13?

I am working on a project using Heist, and since it recently upgrade to 0.13 version, I tried it out and find the original HeistConfig changed a lot. data HeistConfig m = HeistConfig { hcInterpretedSplices :: Splices (I.Splice m) -- ^…
Lynton
  • 257
  • 5
  • 12
1
vote
1 answer

Haskell Snap Framework - Dynamic hyperlinks with Heist

I am trying to create dynamic links using the Heist templating system. The problem is that the links are appearing as text rather than being interpreted as html. Is there a specific method to create dyamic lists like this with Heist? The function…
user1156995
1
vote
1 answer

How to use a single per-request computation in multiple splices with Heist?

Say I have a single Heist template with two custom tags and . Each tag is bound to a Heist.Compiled.Splice. Now the template is rendered at each GET request for a specific route. How can I have be replaced by the first value of a pair,…
noteed
  • 310
  • 2
  • 6
1
vote
1 answer

How do you update code using loadTemplates for the new Heist API?

This code was working with Heist prior to the 0.10.0 change main = do Right ts <- loadTemplates "templates" $ bindSplices mySplices defaultHeistState etc.. Now I get the error testdb.hs:59:33: Not in scope:…
dan
  • 43,914
  • 47
  • 153
  • 254
1
vote
1 answer

cabal install errors-1.3.1 fails

I'm trying to install the newest version of Heist, but errors-1.3.1 which is a dependency fails to install. Any suggestions for how to get past this? $ cabal install errors-1.3.1 Resolving dependencies... Configuring errors-1.3.1... Building…
dan
  • 43,914
  • 47
  • 153
  • 254
0
votes
1 answer

Heist digestible form tags are not expanded

I looking for ideas what could go wrong with Snap Heist digestible forms. I copy pasted templates and handler. Most of the page is rendered correctly, but digestible form tags are left intact i.e instead form tag there is dfForm, input dfInputText…
Daniil Iaitskov
  • 5,525
  • 8
  • 39
  • 49
0
votes
1 answer

Rendering a heist template returns nothing

import Data.String.Conversions import Data.Maybe (isJust) import qualified Heist import qualified Heist.Interpreted as I import qualified Heist.Compiled as HeistCom import Heist.Internal.Types import qualified Text.XmlHtml as X import Data.List…
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
0
votes
1 answer

Does heist support substituting (strings / JSON) into an arbitrary location within a template?

Regarding heist, I've got a template such as:

Example

Is there a way to substitute the ??? string with another string? I think the following function might be the solution…
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
0
votes
1 answer

HTML doctype rendered with Snap / Heist template

I'm having issues with https://hackage.haskell.org/package/snap-1.0.0.1/docs/Snap-Snaplet-Heist-Interpreted.html#v:render when trying to render a template. The issue only occurs if I have the following as the contents of the template:
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
0
votes
1 answer

In Compiled Heist (Haskell), why must splices be created beforehand?

I can understand why HTML templates (.tpl files) must be processed beforehand (with loadTemplates) and put into the HeistConfig. This allow Heist to process the HTML into a more efficient format beforehand. However, I don't understand why splices…
haskellHQ
  • 1,027
  • 6
  • 15
0
votes
1 answer

Snap: Database access with compiled splices

I am trying to get my head around compiled splices. With previouse help I can compile and render some usefull results. I don't fully understand the way it works though. In interpreted mode, the algorithm is simple: construct root, call handler…
r.sendecky
  • 9,933
  • 9
  • 34
  • 62
0
votes
1 answer

How can I embed a raw html string into a Text.XmlHtml node structure

This is kind of a corner case. I'm running Haskell, Text.XmlHtml (version 0.2.3). I'm getting my source data from Pandoc (version 1.12). My source files are all in Markdown format. The corner deals with when I have raw Html directly in my…
Savanni D'Gerinel
  • 2,379
  • 17
  • 27