packages feed

servius 1.2.0.3 → 1.2.1.0

raw patch · 4 files changed

+58/−39 lines, 4 filesdep +cmark-gfmdep −markdowndep ~base

Dependencies added: cmark-gfm

Dependencies removed: markdown

Dependency ranges changed: base

Files

ChangeLog.md view
@@ -1,3 +1,9 @@+# ChangeLog for servius++## 1.2.1.0++* Move to cmark-gfm+ ## 1.2.0.3  * Remove an upper bound
README.md view
@@ -1,5 +1,7 @@ ## servius  [![Build Status](https://travis-ci.org/snoyberg/servius.svg)](https://travis-ci.org/snoyberg/servius)+[![Build status](https://ci.appveyor.com/api/projects/status/8vk8et8smqsosvko/branch/master?svg=true)](https://ci.appveyor.com/project/snoyberg/servius/branch/master)+  Warp web server with some template rendering functionality
app/servius.hs view
@@ -5,10 +5,11 @@ module Main (main) where  import           Blaze.ByteString.Builder.Char.Utf8 (fromLazyText)+import           CMarkGFM                           (extAutolink, extTable, extStrikethrough, optSmart, commonmarkToHtml) import qualified Data.ByteString.Char8              as S8 import           Data.Text                          (Text) import qualified Data.Text                          as T-import           Data.Text.Encoding                 (decodeUtf8With)+import           Data.Text.Encoding                 (encodeUtf8Builder, decodeUtf8With) import           Data.Text.Encoding.Error           (lenientDecode) import qualified Data.Text.Lazy                     as TL import           Network.HTTP.Types                 (status200)@@ -19,7 +20,6 @@ import           Text.Hamlet.RT                     (parseHamletRT,                                                      renderHamletRT) import           Text.Lucius                        (luciusRT)-import           Text.Markdown                      (def, msXssProtect, msAddHeadingId, markdown) import           WaiAppStatic.CmdLine               (docroot, runCommandLine)  main :: IO ()@@ -68,10 +68,8 @@ markdown' fp = do     bs <- S8.readFile $ T.unpack fp     let t = decodeUtf8With lenientDecode bs-        html = markdown settings $ TL.fromStrict t-    return $ responseBuilder status200 [("Content-Type", "text/html; charset=utf-8")] $ renderHtmlBuilder html-  where-    settings = def-        { msXssProtect = False-        , msAddHeadingId = True-        }+        html = commonmarkToHtml+          [optSmart]+          [extStrikethrough, extTable, extAutolink]+          t+    return $ responseBuilder status200 [("Content-Type", "text/html; charset=utf-8")] $ encodeUtf8Builder html
servius.cabal view
@@ -1,34 +1,47 @@-name:                servius-version:             1.2.0.3-synopsis:            Warp web server with template rendering-description:         Please see README.md-homepage:            http://github.com/snoyberg/servius#readme-license:             MIT-license-file:        LICENSE-author:              Michael Snoyman-maintainer:          michael@snoyman.com-copyright:           2015 Michael Snoyman-category:            Web-build-type:          Simple-cabal-version:       >=1.10-extra-source-files:  README.md ChangeLog.md+-- This file has been generated from package.yaml by hpack version 0.28.2.+--+-- see: https://github.com/sol/hpack+--+-- hash: 1151ed11829ab6be6a43e6e0c30b14f49cb96da7378208df5b8716ef34fa095c -executable servius-  hs-source-dirs:      app-  main-is:             servius.hs-  ghc-options:         -threaded -rtsopts -with-rtsopts=-N-  build-depends:       base >= 4 && < 5-                     , blaze-builder-                     , blaze-html-                     , bytestring-                     , http-types-                     , markdown-                     , shakespeare-                     , text-                     , wai-                     , wai-app-static-  default-language:    Haskell2010+name:           servius+version:        1.2.1.0+synopsis:       Warp web server with template rendering+description:    Please see README.md at https://www.stackage.org/package/servius+category:       Web+homepage:       https://github.com/snoyberg/servius#readme+bug-reports:    https://github.com/snoyberg/servius/issues+author:         Michael Snoyman+maintainer:     michael@snoyman.com+copyright:      2015-2018 Michael Snoyman+license:        MIT+license-file:   LICENSE+build-type:     Simple+cabal-version:  >= 1.10+extra-source-files:+    ChangeLog.md+    README.md  source-repository head-  type:     git+  type: git   location: https://github.com/snoyberg/servius++executable servius+  main-is: servius.hs+  other-modules:+      Paths_servius+  hs-source-dirs:+      app+  ghc-options: -threaded -rtsopts -with-rtsopts=-N+  build-depends:+      base >=4.9.1 && <5+    , blaze-builder+    , blaze-html+    , bytestring+    , cmark-gfm+    , http-types+    , shakespeare+    , text+    , wai+    , wai-app-static+  default-language: Haskell2010