shakebook 0.7.3.0 → 0.8.0.0
raw patch · 4 files changed
+53/−10 lines, 4 filesdep +binary-instancesdep +http-conduitdep ~aesondep ~ixset-typeddep ~pandoc
Dependencies added: binary-instances, http-conduit
Dependency ranges changed: aeson, ixset-typed, pandoc, path-extensions, shake-plus
Files
- ChangeLog.md +8/−0
- shakebook.cabal +15/−10
- src/Shakebook.hs +2/−0
- src/Shakebook/Conduit.hs +28/−0
ChangeLog.md view
@@ -1,5 +1,13 @@ # Changelog for Shakebook +## (v0.7.4.0)++* Strengthen bounds on `aeson`, `ixset-typed` and `shake-plus`.+* Add [binary-instances](https://hackage.haskell.org/package/sitemap-gen) for `Value` binary instance.+* Add [http-conduit](https://hackage.haskell.org/package/http-conduit).+* Add new module `Shakebook.Conduit` containing `addRemoteJSONOracleCache` and `RemoteJSONCache` data+ type for remote JSON caching.+ ## (v0.7.3.0) * Add `Shakebook.Sitemap` module using [sitemap-gen](https://hackage.haskell.org/package/sitemap-gen).
shakebook.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 8329d59b395ffc986184520fdaba6387a2cc9eea83117581a5d9fe2a8cf8144f+-- hash: 6523604d89e517cd4ab0a0d00d6594a71c32af8a6cbdc8397daaf52434cb7fe7 name: shakebook-version: 0.7.3.0+version: 0.8.0.0 synopsis: Shake-based technical documentation generator; HTML & PDF description: Shakebook is a documentation generator aimed at covering all the bases for mathematical, technical and scientific diagrams and typesetting. Shakebook provides combinators for taking markdown files and combining them into documents, but allowing the user to control how. Shakebook provides general combinators for templating single pages, cofree comonads for representing tables of contents, and zipper comonads for representing pagers. category: Web@@ -24,6 +24,7 @@ library exposed-modules: Shakebook+ Shakebook.Conduit Shakebook.Conventions Shakebook.Defaults Shakebook.Feed@@ -40,20 +41,22 @@ aeson , aeson-with >=0.1.1.0 , base >=4.7 && <5+ , binary-instances , comonad , comonad-extras , doctemplates , feed , free- , ixset-typed+ , http-conduit+ , ixset-typed >=0.5 , lens , lens-aeson , mustache- , pandoc >=2.9.2.1+ , pandoc >=2.10 , pandoc-types- , path-extensions >=0.0.1.0+ , path-extensions >=0.1.0.1 , rio- , shake-plus >=0.1.7.0+ , shake-plus >=0.1.9.0 , sitemap-gen , slick >=1.0.1.1 , split@@ -74,20 +77,22 @@ aeson , aeson-with >=0.1.1.0 , base >=4.7 && <5+ , binary-instances , comonad , comonad-extras , doctemplates , feed , free- , ixset-typed+ , http-conduit+ , ixset-typed >=0.5 , lens , lens-aeson , mustache- , pandoc >=2.9.2.1+ , pandoc >=2.10 , pandoc-types- , path-extensions >=0.0.1.0+ , path-extensions >=0.1.0.1 , rio- , shake-plus >=0.1.7.0+ , shake-plus >=0.1.9.0 , shakebook , sitemap-gen , slick >=1.0.1.1
src/Shakebook.hs view
@@ -5,6 +5,7 @@ , module Control.Comonad.Zipper.Extra , module Data.Aeson , module Development.Shake.Plus+, module Shakebook.Conduit , module Shakebook.Conventions , module Shakebook.Defaults , module Shakebook.Feed@@ -20,6 +21,7 @@ import Control.Comonad.Zipper.Extra import Data.Aeson import Development.Shake.Plus+import Shakebook.Conduit import Shakebook.Conventions import Shakebook.Defaults import Shakebook.Feed
+ src/Shakebook/Conduit.hs view
@@ -0,0 +1,28 @@+module Shakebook.Conduit (+ RemoteJSONLookup(..)+, addRemoteJSONOracleCache+) where++import Data.Aeson+import Data.Binary.Instances.Aeson()+import Development.Shake.Plus+import RIO+import qualified RIO.Text as T+import Network.HTTP.Simple++-- | Remote json lookup for an oracle, this should contain a URL as Text.+newtype RemoteJSONLookup = RemoteJSONLookup Text+ deriving (Show, Typeable, Eq)++type instance RuleResult RemoteJSONLookup = Value++deriving instance Hashable RemoteJSONLookup+deriving instance Binary RemoteJSONLookup+deriving instance NFData RemoteJSONLookup++-- | Adds an oracle cache for looking up json from a remote server.+addRemoteJSONOracleCache :: (MonadReader r m, MonadRules m) => m (RemoteJSONLookup -> RAction r Value)+addRemoteJSONOracleCache = addOracleCache $ \(RemoteJSONLookup x) -> do+ initReq <- parseRequest $ T.unpack x+ (y :: Response Value) <- httpJSON initReq+ return $ getResponseBody y