json-feed 0.0.0 → 0.0.1
raw patch · 2 files changed
+60/−49 lines, 2 filesdep ~aesondep ~basedep ~bytestring
Dependency ranges changed: aeson, base, bytestring, filepath, hspec, json-feed, mime-types, network-uri, tagsoup, text, time
Files
- json-feed.cabal +52/−46
- library/JsonFeed.hs +8/−3
json-feed.cabal view
@@ -1,16 +1,20 @@-name: json-feed-version: 0.0.0-cabal-version: >=1.10-build-type: Simple-license: MIT-license-file: LICENSE.markdown-maintainer: Taylor Fausak-homepage: https://github.com/tfausak/json-feed#readme-bug-reports: https://github.com/tfausak/json-feed/issues-synopsis: JSON Feed-description:- This is an implementation of the JSON Feed spec in Haskell. The spec is available at <https://jsonfeed.org>. JSON Feed is similar to the Atom and RSS feed formats, but it is serialized as JSON rather than XML.-category: Web+-- This file has been generated from package.yaml by hpack version 0.17.0.+--+-- see: https://github.com/sol/hpack++name: json-feed+version: 0.0.1+synopsis: JSON Feed+description: This is an implementation of the JSON Feed spec in Haskell. The spec is available at <https://jsonfeed.org>. JSON Feed is similar to the Atom and RSS feed formats, but it is serialized as JSON rather than XML.+category: Web+homepage: https://github.com/tfausak/json-feed#readme+bug-reports: https://github.com/tfausak/json-feed/issues+maintainer: Taylor Fausak+license: MIT+license-file: LICENSE.markdown+build-type: Simple+cabal-version: >= 1.10+ extra-source-files: feeds/allenpike.com.json feeds/daringfireball.net.json@@ -25,40 +29,42 @@ feeds/timetable.manton.org.json source-repository head- type: git- location: https://github.com/tfausak/json-feed+ type: git+ location: https://github.com/tfausak/json-feed library- exposed-modules:- JsonFeed- build-depends:- aeson >=1.0.2.1 && <1.1,- base >=4.9.1.0 && <4.10,- bytestring >=0.10.8.1 && <0.11,- mime-types >=0.1.0.7 && <0.2,- network-uri >=2.6.1.0 && <2.7,- tagsoup ==0.14.*,- text >=1.2.2.1 && <1.3,- time >=1.6.0.1 && <1.7- default-language: Haskell2010- hs-source-dirs: library- ghc-options: -Wall+ hs-source-dirs:+ library+ ghc-options: -Wall+ build-depends:+ aeson+ , base < 9+ , bytestring+ , mime-types+ , network-uri+ , tagsoup+ , text+ , time+ exposed-modules:+ JsonFeed+ default-language: Haskell2010 test-suite test- type: exitcode-stdio-1.0- main-is: test.hs- build-depends:- aeson >=1.0.2.1 && <1.1,- base >=4.9.1.0 && <4.10,- bytestring >=0.10.8.1 && <0.11,- mime-types >=0.1.0.7 && <0.2,- network-uri >=2.6.1.0 && <2.7,- tagsoup ==0.14.*,- text >=1.2.2.1 && <1.3,- time >=1.6.0.1 && <1.7,- filepath >=1.4.1.1 && <1.5,- hspec >=2.4.1 && <2.5,- json-feed >=0.0.0 && <0.1- default-language: Haskell2010- hs-source-dirs: tests- ghc-options: -Wall -rtsopts -threaded -with-rtsopts=-N+ type: exitcode-stdio-1.0+ main-is: test.hs+ hs-source-dirs:+ tests+ ghc-options: -Wall -rtsopts -threaded -with-rtsopts=-N+ build-depends:+ aeson+ , base < 9+ , bytestring+ , mime-types+ , network-uri+ , tagsoup+ , text+ , time+ , filepath+ , hspec+ , json-feed+ default-language: Haskell2010
library/JsonFeed.hs view
@@ -3,6 +3,7 @@ -- | <https://jsonfeed.org> module JsonFeed ( parseFeed+ , renderFeed -- * Types , Feed (..) , Author (..)@@ -15,7 +16,7 @@ , Url (..) ) where -import Data.Aeson (FromJSON, ToJSON)+import Data.Aeson (FromJSON, ToJSON, Value) import Data.Aeson.Types (Options) import Data.ByteString.Lazy (ByteString) import Data.Text (Text)@@ -39,6 +40,10 @@ parseFeed = Json.eitherDecode +renderFeed :: Feed -> ByteString+renderFeed = Json.encode++ data Feed = Feed { feedAuthor :: Maybe Author -- ^ The feed author. The author object has several members. These are all@@ -145,7 +150,7 @@ -- that image wouldn't otherwise appear in the content_html. A feed reader -- with a detail view may choose to show this banner image at the top of the -- detail view, possibly with the title overlaid.- , itemContentHtml :: Maybe Text+ , itemContentHtml :: Maybe Html -- ^ 'itemContentHtml' and 'itemContentText' are each optional strings --- -- but one or both must be present. This is the HTML or plain text of the -- item. Important: the only place HTML is allowed in this format is in@@ -164,7 +169,7 @@ -- ^ The URL of a page elsewhere. This is especially useful for linkblogs. If -- 'itemUrl' links to where you're talking about a thing, then -- 'itemExternalUrl' links to the thing you're talking about.- , itemId :: Json.Value+ , itemId :: Value -- ^ Unique for the item in the feed over time. If an item is ever updated, -- the ID should be unchanged. New items should never use a previously-used -- ID. If an ID is presented as a number or other type, a JSON Feed reader