The hakyll-contrib-csv package

[ Tags: bsd3, library, web ] [ Propose Tags ]

A Hakyll extension for incorporating Csv data into your static site.

[Skip to Readme]


Dependencies base (>=4.8 && <5), blaze-html (>=0.5 && <0.9), bytestring (>=0.9 && <0.11), cassava (==0.4.*), hakyll (>=4.7 && <4.9), vector (==0.11.*) [details]
License BSD3
Copyright 2016 Erik Stevenson
Author Erik Stevenson
Category Web
Home page
Bug tracker
Uploaded Thu May 19 19:43:41 UTC 2016 by narrative
Distributions NixOS:
Downloads 147 total (4 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-05-19 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for hakyll-contrib-csv-

[back to package description]

Csv to Html table generator for Hakyll

Turns this

1997,Ford,E350,"ac, abs, moon",3000.00
1999,Chevy,"Venture ""Extended Edition""","",4900.00
1999,Chevy,"Venture ""Extended Edition, Very Large""",,5000.00
1996,Jeep,Grand Cherokee,"MUST SELL!
air, moon roof, loaded",4799.00

Into this

            <td>ac, abs, moon</td>
            <td>Venture &quot;Extended Edition&quot;</td>
            <td>Venture &quot;Extended Edition, Very Large&quot;</td>
            <td>Grand Cherokee</td>
            <td>MUST SELL! air, moon roof, loaded</td>


{-# LANGUAGE OverloadedStrings #-}

import Hakyll
import Hakyll.Contrib.Csv

main :: IO ()
main = hakyll $ do

  match "csv/*.csv" $ do
    route $ setExtension "html" `composeRoutes` gsubRoute "csv/" (const "")
    compile $
      >>= loadAndApplyTemplate "templates/layout.html" defaultContext
      >>= relativizeUrls

  match "templates/*" $ compile templateCompiler