dixi 0.6.0.5 → 0.6.9.0
raw patch · 3 files changed
+31/−31 lines, 3 filesdep ~aesondep ~pandocdep ~servantPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: aeson, pandoc, servant, servant-blaze, servant-docs, servant-server
API changes (from Hackage documentation)
- Dixi.Page: body :: Lens (Page b_arBl) (Page b_at1X) b_arBl b_at1X
+ Dixi.Page: body :: Lens (Page b_attr) (Page b_auVv) b_attr b_auVv
- Dixi.Page: comment :: Lens' (Page b_arBl) (Last Text)
+ Dixi.Page: comment :: Lens' (Page b_attr) (Last Text)
- Dixi.Page: time :: Lens' (Page b_arBl) (Last UTCTime)
+ Dixi.Page: time :: Lens' (Page b_attr) (Last UTCTime)
Files
- Dixi/Server.hs +6/−6
- api-docs/Docs.hs +14/−14
- dixi.cabal +11/−11
Dixi/Server.hs view
@@ -12,7 +12,7 @@ module Dixi.Server where import Control.Monad.IO.Class-import Control.Monad.Trans.Either+import Control.Monad.Trans.Except import Data.Acid import Data.Default import Data.Time@@ -47,7 +47,7 @@ diffPages (Just v1) (Just v2) = liftIO (query db (GetDiff key (v1, v2))) >>= \case Left e -> handle e Right x -> return $ DP renders key v1 v2 x- diffPages _ _ = left err400+ diffPages _ _ = throwE err400 history = liftIO (H renders key <$> query db (GetHistory key)) |: version@@ -62,10 +62,10 @@ updateVersion v (NB t c) = do _ <- liftIO (getCurrentTime >>= update db . Amend key v t c) latestQ pp - latestQ :: (Key -> Version -> Page Text -> IO a) -> EitherT ServantErr IO a+ latestQ :: (Key -> Version -> Page Text -> IO a) -> ExceptT ServantErr IO a latestQ p = liftIO (uncurry (p key) =<< query db (GetLatest key)) - versionQ :: (Key -> Version -> Page Text -> IO a) -> Version -> EitherT ServantErr IO a+ versionQ :: (Key -> Version -> Page Text -> IO a) -> Version -> ExceptT ServantErr IO a versionQ p v = liftIO (query db (GetVersion key v)) >>= \case Left e -> handle e Right x -> liftIO (p key v x)@@ -79,8 +79,8 @@ rp k v p = return (RP renders k v p) - handle :: DixiError -> EitherT ServantErr IO a- handle e = left err404 { errBody = dixiError (headerBlock renders) e }+ handle :: DixiError -> ExceptT ServantErr IO a+ handle e = throwE err404 { errBody = dixiError (headerBlock renders) e } server :: AcidState Database -> Renders -> Server Dixi
api-docs/Docs.hs view
@@ -27,29 +27,29 @@ import Data.Attoparsec.ByteString.Lazy import Data.Aeson.Encode.Pretty import qualified Data.ByteString.Lazy as LBS-instance ToSample RevReq RevReq where- toSample _ = Just $ DR 5 7 (Just "Revert changes 5-6, 6-7")+instance ToSample RevReq where+ toSamples _ = just $ DR 5 7 (Just "Revert changes 5-6, 6-7") -instance ToSample RawPage RawPage where- toSample _ = Just $ RP defaultRenders "Page_Title" 3 $ Page "Some page content, in input format (e.g org mode)"+instance ToSample RawPage where+ toSamples _ = just $ RP defaultRenders "Page_Title" 3 $ Page "Some page content, in input format (e.g org mode)" (Last (Just "An optional comment")) (Last (Just (UTCTime (ModifiedJulianDay 0) 0)))-instance ToSample PrettyPage PrettyPage where- toSample _ = Just $ PP defaultRenders "Page_Title" 3 $ Page [shamlet|Some page content, in <b>HTML</b> from Pandoc.|]+instance ToSample PrettyPage where+ toSamples _ = just $ PP defaultRenders "Page_Title" 3 $ Page [shamlet|Some page content, in <b>HTML</b> from Pandoc.|] (Last (Just "An optional comment")) (Last (Just (UTCTime (ModifiedJulianDay 0) 0)))-instance ToSample NewBody NewBody where- toSample _ = Just $ NB "Some new content, in input format (e.g org mode)" (Just "An optional comment")+instance ToSample NewBody where+ toSamples _ = just $ NB "Some new content, in input format (e.g org mode)" (Just "An optional comment") -instance ToSample History History where- toSample _ = Just $ H defaultRenders "Page_Title"+instance ToSample History where+ toSamples _ = just $ H defaultRenders "Page_Title" [ Page (4, 9, 14) (Last (Just "Change 1")) (Last (Just (UTCTime (ModifiedJulianDay 0) 0))) , Page (12, 3, 1) (Last (Just "Change 2")) (Last (Just (UTCTime (ModifiedJulianDay 1) 0))) , Page (12, 0, 0) (Last (Just "Change 3")) (Last (Just (UTCTime (ModifiedJulianDay 2) 0))) ] -instance ToSample DiffPage DiffPage where- toSample _ = Just $ DP defaultRenders "Page_Title" 5 7+instance ToSample DiffPage where+ toSamples _ = just $ DP defaultRenders "Page_Title" 5 7 (Page [ (V.fromList "This is the ", Unchanged) , (V.fromList "new", Replaced) , (V.fromList "ginal", Deleted)@@ -57,7 +57,7 @@ ] (Last (Just "An optional comment")) (Last (Just (UTCTime (ModifiedJulianDay 0) 0))))-+just x = [("",x)] instance ToParam (QueryParam "from" Int) where toParam _ = DocQueryParam "from" [] "Version to diff from, starting from 0 to N-1" Normal instance ToParam (QueryParam "to" Int) where@@ -70,7 +70,7 @@ main :: IO () main = do filename <- fmap (\x -> if null x then "docs.md" else head x) getArgs- writeFile filename (markdown $ postprocess $ docsWith intro extra dixi)+ writeFile filename (markdown $ postprocess $ docsWith defaultDocOptions intro extra dixi) postprocess :: API -> API postprocess = over (apiEndpoints . traverse . rqbody) (filter ((== contentType (Proxy :: Proxy JSON)) . view _1) . fmap (over _2 prettify))
dixi.cabal view
@@ -2,7 +2,7 @@ -- see http://haskell.org/cabal/users-guide/ name: dixi-version: 0.6.0.5+version: 0.6.9.0 synopsis: A wiki implemented with a firm theoretical foundation. description: This project is a simple wiki developed based on a firm theoretical foundation.@@ -59,13 +59,13 @@ else build-depends: base >= 4.8 && < 4.10 build-depends: composition-tree >= 0.2.0.1 && < 0.3, patches-vector >= 0.1.2 && < 0.2- , pandoc >= 1.16 && < 1.17 , pandoc-types >= 1.16 && < 1.17+ , pandoc >= 1.16 && < 1.18 , pandoc-types >= 1.16 && < 1.17 , base-orphans >= 0.5.0 && < 0.6- , servant >= 0.4 && < 0.5- , servant-server >= 0.4 && < 0.5+ , servant >= 0.5 && < 0.6+ , servant-server >= 0.5 && < 0.6 , acid-state >= 0.12 && <0.15 , safecopy >= 0.8.3 && < 0.10 , lens >= 4.7 && < 4.14- , blaze-html >= 0.8 && < 0.9 , servant-blaze >= 0.4 && < 0.5, blaze-markup >= 0.7 && <0.8+ , blaze-html >= 0.8 && < 0.9 , servant-blaze >= 0.5 && < 0.6, blaze-markup >= 0.7 && <0.8 , shakespeare >= 2.0 && < 2.1 , containers >= 0.5 && < 0.6 , text >= 1.2 && < 1.3 , vector >= 0.10 && <0.12@@ -73,7 +73,7 @@ , data-default >= 0.5 && <0.6 , either >= 4.3 && <4.5 , template-haskell- , aeson >= 0.8 && < 0.11+ , aeson >= 0.8 && < 0.12 , time >= 1.4 && < 1.6 , time-locale-compat >= 0.1 && < 0.2 , bytestring >= 0.10 && < 0.11@@ -97,7 +97,7 @@ else build-depends: base >= 4.8 && < 4.10 build-depends: warp >= 3.0 && <3.3- , servant-server >= 0.4 && < 0.5+ , servant-server >= 0.5 && < 0.6 , directory >= 1.0 && < 1.3 , yaml >= 0.8 && < 0.9 , base-orphans >= 0.5.0 && < 0.6@@ -117,18 +117,18 @@ cpp-options: -DOLDBASE else build-depends: base >= 4.8 && < 4.10- build-depends: dixi, servant-docs >= 0.4 && < 0.5+ build-depends: dixi, servant-docs >= 0.5 && < 0.6 , text >= 1.2 && < 1.3- , servant >= 0.4 && < 0.5+ , servant >= 0.5 && < 0.6 , time >= 1.4 && < 1.6 , lens >= 4.7 && < 4.14 , aeson-pretty >= 0.7 && < 0.8- , aeson >= 0.8 && < 0.11+ , aeson >= 0.8 && < 0.12 , attoparsec >= 0.12 && < 0.14 , base-orphans >= 0.5.0 && < 0.6 , bytestring >= 0.10 && < 0.11 , shakespeare >= 2.0 && < 2.1 , vector >= 0.10 && <0.12 , patches-vector >= 0.1.2 && < 0.2- , servant-blaze >= 0.4 && <0.5+ , servant-blaze >= 0.5 && <0.6 default-language: Haskell2010