BlogLiterately 0.7.1.11 → 0.8
raw patch · 4 files changed
+30/−14 lines, 4 filesdep ~highlighting-katedep ~pandocPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: highlighting-kate, pandoc
API changes (from Hackage documentation)
- Text.BlogLiterately.Transform: xformDoc :: BlogLiterately -> [Transform] -> String -> IO (BlogLiterately, String)
+ Text.BlogLiterately.Transform: xformDoc :: BlogLiterately -> [Transform] -> String -> IO (Either PandocError (BlogLiterately, String))
Files
- BlogLiterately.cabal +3/−3
- CHANGES.md +11/−0
- src/Text/BlogLiterately/Run.hs +7/−5
- src/Text/BlogLiterately/Transform.hs +9/−6
BlogLiterately.cabal view
@@ -1,5 +1,5 @@ Name: BlogLiterately-Version: 0.7.1.11+Version: 0.8 Synopsis: A tool for posting Haskelly articles to blogs Description: Write blog posts in Markdown format, then use BlogLiterately to do syntax highlighting, format ghci sessions, and upload@@ -57,10 +57,10 @@ blaze-html >= 0.5 && < 0.9, cmdargs >= 0.9.5 && < 0.11, haxr >= 3000.9 && < 3000.11,- pandoc >= 1.12 && < 1.14,+ pandoc >= 1.14 && < 1.15, pandoc-types >= 1.12 && < 1.13, pandoc-citeproc >= 0.1.2 && < 0.8,- highlighting-kate >= 0.5 && < 0.6,+ highlighting-kate >= 0.5 && < 0.7, data-default >= 0.5 && < 0.6, lens >= 3.8 && < 4.12 Exposed-modules: Text.BlogLiterately
CHANGES.md view
@@ -1,3 +1,14 @@+0.8 (28 May 2015)+-----------------++ * Require `pandoc-1.14`+ * Allow `highlighting-kate-0.6`+ * With the introduction of `Either` results for `pandoc`'s reader+ functions, the type of `Text.BlogLiterately.Transform.xformDoc`+ has changed. It now yields `IO (Either PandocError+ (BlogLiterately, String))` instead of `IO (BlogLiterately,+ String)`.+ 0.7.1.11 (26 May 2015) ----------------------
src/Text/BlogLiterately/Run.hs view
@@ -56,8 +56,10 @@ -- orders of the standard transforms and your own, to exclude some -- or all of the standard transforms, etc. blogLiteratelyCustom :: [Transform] -> IO ()-blogLiteratelyCustom ts =- cmdArgs blOpts- >>= \bl -> readFile (file' bl)- >>= xformDoc bl ts- >>= uncurry postIt+blogLiteratelyCustom ts = do+ bl <- cmdArgs blOpts+ doc <- readFile (file' bl)+ res <- xformDoc bl ts doc+ case res of+ Left err -> putStrLn $ "Pandoc error: " ++ show err+ Right (bl',doc') -> postIt bl' doc'
src/Text/BlogLiterately/Transform.hs view
@@ -56,6 +56,7 @@ import Data.Monoid (mappend) import Data.Monoid (mempty, (<>)) import qualified Data.Set as S+import Data.Traversable (traverse) import System.Directory (doesFileExist, getAppUserDataDirectory) import System.Exit (exitFailure)@@ -64,6 +65,7 @@ import Text.Blaze.Html.Renderer.String (renderHtml) import Text.CSL.Pandoc (processCites') import Text.Pandoc+import Text.Pandoc.Error (PandocError) import Text.Parsec (ParseError) import Text.BlogLiterately.Block (onTag)@@ -330,16 +332,17 @@ -- | Transform a complete input document string to an HTML output -- string, given a list of transformation passes.-xformDoc :: BlogLiterately -> [Transform] -> String -> IO (BlogLiterately, String)+xformDoc :: BlogLiterately -> [Transform] -> String -> IO (Either PandocError (BlogLiterately, String)) xformDoc bl xforms = fixLineEndings >>> parseFile parseOpts-- >>> runTransforms xforms bl-- >=> (\(bl', p) -> return $ (bl', writeHtml (writeOpts bl') p) )- >=> _2 (return . renderHtml)+ >>> traverse+ ( runTransforms xforms bl+ >=> (\(bl', p) -> return $ (bl', writeHtml (writeOpts bl') p) )+ >=> _2 (return . renderHtml)+ ) where+ parseFile :: ReaderOptions -> String -> Either PandocError Pandoc parseFile opts = case bl^.format of Just "rst" -> readRST opts