File: README.md

package info (click to toggle)
haskell-js-dgtable 0.5.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 296 kB
  • sloc: javascript: 2,990; haskell: 24; makefile: 6
file content (31 lines) | stat: -rw-r--r-- 1,588 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# js-dgtable [![Hackage version](https://img.shields.io/hackage/v/js-dgtable.svg?label=Hackage)](https://hackage.haskell.org/package/js-dgtable) [![Stackage version](https://www.stackage.org/package/js-dgtable/badge/nightly?label=Stackage)](https://www.stackage.org/package/js-dgtable) [![Build Status](https://img.shields.io/travis/ndmitchell/js-dgtable/master.svg)](https://travis-ci.org/ndmitchell/js-dgtable)

This package bundles the minified [jquery.dgtable](https://github.com/danielgindi/jquery.dgtable) code into a Haskell package,
so it can be depended upon by Cabal packages. The first three components of
the version number match the upstream jQuery version. The package is designed
to meet the redistribution requirements of downstream users (e.g. Debian).
As an example:

```haskell
import qualified Language.Javascript.DGTable as DGTable

main = do
    putStrLn $ "jquery.dgtable version " ++ show DGTable.version ++ " source:"
    putStrLn =<< readFile =<< DGTable.file
```

This package installs data files containing the jquery.dgtable sources, which must be available at runtime. If you want to produce an executable with no dependency on associated data files, you can use the [`file-embed`](https://hackage.haskell.org/package/file-embed) library:

```haskell
{-# LANGUAGE TemplateHaskell #-}

import Data.FileEmbed
import qualified Data.ByteString as BS
import qualified Language.Javascript.DGTable as DGTable
import Language.Haskell.TH.Syntax

main = print dgTableContents

dgTableContents :: BS.ByteString
dgTableContents = $(embedFile =<< runIO DGTable.file)
```