packages feed

cmark-0.3.3: cmark.cabal

name:                cmark
version:             0.3.3
synopsis:            Fast, accurate CommonMark (Markdown) parser and renderer
description:
  This package provides Haskell bindings for
  <https://github.com/jgm/cmark libcmark>, the reference
  parser for <http://commonmark.org CommonMark>, a fully
  specified variant of Markdown. It includes sources for
  libcmark (0.19.0) and does not require prior installation of the
  C library.
  .
  cmark provides the following advantages over existing
  Markdown libraries for Haskell:
  .
  -   Speed: Conversion speed is on par with the
      <https://hackage.haskell.org/package/sundown sundown>
      library. We were unable to measure precisely
      against
      <https://hackage.haskell.org/package/sundown sundown>,
      which raised a malloc error when compiled into our
      benchmark suite. Relative to other implementations:
      cmark was 82 times faster than
      <https://hackage.haskell.org/package/cheapskate cheapskate>,
      59 times faster than
      <https://hackage.haskell.org/package/markdown markdown>,
      105 times faster than
      <https://hackage.haskell.org/package/pandoc pandoc>,
      and 2.8 times faster than
      <https://hackage.haskell.org/package/discount discount>.
  .
  -   Memory footprint: Memory footprint is on par with
      <https://hackage.haskell.org/package/sundown sundown>.
      On one sample, the library uses a fourth the memory that
      <https://hackage.haskell.org/package/markdown markdown>
      uses, and less than a tenth the memory that
      <https://hackage.haskell.org/package/pandoc pandoc>
      uses.
  .
  -   Robustness: cmark can handle whatever is thrown
      at it, without the exponential blowups in parsing
      time one can sometimes get with other libraries.
      (The input @bench\/full-sample.md@, for example,
      causes both
      <https://hackage.haskell.org/package/pandoc pandoc>
      and
      <https://hackage.haskell.org/package/markdown markdown>
      to grind to a halt.)
  .
  -   Accuracy: cmark passes the CommonMark spec\'s
      suite of over 500 conformance tests.
  .
  -   Standardization: Since there is a spec and a
      comprehensive suite of tests, we can have a high
      degree of confidence that any two CommonMark
      implementations will behave the same. Thus, for
      example, one could use this library for server-side
      rendering and
      <http://github.com/jgm/commonmark.js commonmark.js>
      for client-side previewing.
  .
  -   Ease of installation: cmark is portable and has
      minimal dependencies.
  .
  cmark does not provide Haskell versions of the whole
  <http://github.com/jgm/cmark libcmark> API, which is
  built around mutable @cmark_node@ objects. Instead, it
  provides functions for converting CommonMark to HTML
  (and other formats), and a function for converting
  CommonMark to a @Node@ tree that can be processed
  further using Haskell.
  .
  A note on security: This library does not attempt
  to sanitize HTML output. We recommend using
  <https://hackage.haskell.org/package/xss-sanitize xss-sanitize>
  to filter the output.
  .
  A note on stability: There is a good chance the API
  will change significantly after this early release.

homepage:            https://github.com/jgm/commonmark-hs
license:             BSD3
license-file:        LICENSE
author:              John MacFarlane
maintainer:          jgm@berkeley.edu
copyright:           (C) 2015 John MacFarlane
category:            Text
tested-with:         GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.2
build-type:          Simple
extra-source-files:  README.md
                     changelog
                     cbits/bench.h
                     cbits/chunk.h
                     cbits/cmark_export.h
                     cbits/debug.h
                     cbits/inlines.h
                     cbits/cmark.h
                     cbits/houdini.h
                     cbits/references.h
                     cbits/utf8.h
                     cbits/parser.h
                     cbits/cmark_version.h
                     cbits/html_unescape.h
                     cbits/iterator.h
                     cbits/node.h
                     cbits/buffer.h
                     cbits/cmark_ctype.h
                     cbits/config.h
                     cbits/scanners.h
                     cbits/case_fold_switch.inc
                     bench/sample.md
                     bench/full-sample.md
cabal-version:       >=1.14

Source-repository head
  type:              git
  location:          git://github.com/jgm/cmark-hs.git

library
  exposed-modules:     CMark
  build-depends:       base >=4.5 && < 4.9,
                       text >= 1.0 && < 1.3,
                       bytestring
  if impl(ghc < 7.6)
    build-depends:     ghc-prim >= 0.2
  default-language:    Haskell2010
  ghc-options:         -Wall -fno-warn-unused-do-bind
  cc-options:          -Wall -std=c99
  Include-dirs:        cbits
  Includes:            cmark.h
  c-sources:           cbits/houdini_html_u.c
                       cbits/references.c
                       cbits/utf8.c
                       cbits/inlines.c
                       cbits/blocks.c
                       cbits/cmark.c
                       cbits/iterator.c
                       cbits/node.c
                       cbits/buffer.c
                       cbits/cmark_ctype.c
                       cbits/houdini_html_e.c
                       cbits/houdini_href_e.c
                       cbits/scanners.c
                       cbits/html.c
                       cbits/man.c
                       cbits/commonmark.c
                       cbits/xml.c

benchmark bench-cmark
  type:             exitcode-stdio-1.0
  hs-source-dirs:   bench
  main-is:          Bench.hs
  build-depends:    base, text, criterion, cmark,
                    sundown >= 0.6 && < 0.7,
                    pandoc >= 1.13.2 && < 1.14,
                    cheapskate >= 0.1 && < 0.2,
                    markdown >= 0.1 && < 0.2,
                    discount >= 0.1 && < 0.2,
                    blaze-html >= 0.7 && < 0.8
  ghc-options:      -O2
  default-language: Haskell2010

Test-Suite test-cmark
  type:           exitcode-stdio-1.0
  main-is:        test-cmark.hs
  hs-source-dirs: test
  build-depends:  base, cmark, text, HUnit >= 1.2 && < 1.3
  ghc-options:    -Wall -fno-warn-unused-do-bind -threaded
  default-language: Haskell98