packages feed

BlogLiterately 0.8.5 → 0.8.6

raw patch · 6 files changed

+59/−13 lines, 6 filesdep ~lensdep ~pandoc-citeprocPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: lens, pandoc-citeproc

API changes (from Hackage documentation)

+ Text.BlogLiterately.LaTeX: rawTeXify :: Pandoc -> Pandoc
+ Text.BlogLiterately.Options: [_rawlatex] :: BlogLiterately -> Maybe Bool
+ Text.BlogLiterately.Options: rawlatex :: Lens' BlogLiterately (Maybe Bool)
+ Text.BlogLiterately.Options: rawlatex' :: BlogLiterately -> Bool
+ Text.BlogLiterately.Transform: rawtexifyXF :: Transform
- Text.BlogLiterately.Options: BlogLiterately :: Maybe String -> Maybe HsHighlight -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe String -> Maybe Bool -> Maybe Bool -> [String] -> [String] -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> [String] -> BlogLiterately
+ Text.BlogLiterately.Options: BlogLiterately :: Maybe String -> Maybe HsHighlight -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe String -> Maybe Bool -> Maybe Bool -> [String] -> [String] -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe String -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> [String] -> BlogLiterately

Files

BlogLiterately.cabal view
@@ -1,5 +1,5 @@ Name:           BlogLiterately-Version:        0.8.5+Version:        0.8.6 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@@ -60,10 +60,10 @@                    haxr >= 3000.11 && < 3000.12,                    pandoc >= 2.0 && < 2.2,                    pandoc-types >= 1.16 && < 1.20,-                   pandoc-citeproc >= 0.1.2 && < 0.13,+                   pandoc-citeproc >= 0.1.2 && < 0.15,                    highlighting-kate >= 0.5 && < 0.7,                    data-default >= 0.5 && < 0.8,-                   lens >= 3.8 && < 4.16,+                   lens >= 3.8 && < 4.17,                    tagsoup >= 0.13.4 && < 0.15,                    HTTP >= 4000.3 && < 4000.4   Exposed-modules: Text.BlogLiterately
CHANGES.md view
@@ -1,3 +1,10 @@+0.8.6 (31 January 2018)+-----------------------++  - allow `lens-4.16`+  - allow `pandoc-citeproc-0.14`+  - new `rawlatex` option for passing LaTeX code through unchanged+ 0.8.5 (10 January 2018) ----------------------- 
src/Text/BlogLiterately/LaTeX.hs view
@@ -12,11 +12,26 @@  module Text.BlogLiterately.LaTeX     (-      wpTeXify+      rawTeXify+    , wpTeXify     ) where  import           Data.List   (isPrefixOf) import           Text.Pandoc++-- | Pass LaTeX through unchanged.+rawTeXify :: Pandoc -> Pandoc+rawTeXify = bottomUp formatDisplayTex . bottomUp formatInlineTex+  where formatInlineTex :: [Inline] -> [Inline]+        formatInlineTex (Math InlineMath tex : is)+          = (RawInline (Format "html") ("$" ++ tex ++ "$")) : is+        formatInlineTex is = is++        formatDisplayTex :: [Block] -> [Block]+        formatDisplayTex (Para [Math DisplayMath tex] : bs)+          = RawBlock (Format "html") ("\n\\[" ++ tex ++ "\\]\n")+          : bs+        formatDisplayTex bs = bs  -- | WordPress can render LaTeX, but expects it in a special non-standard --   format (@\$latex foo\$@).  The @wpTeXify@ function formats LaTeX code
src/Text/BlogLiterately/Options.hs view
@@ -25,6 +25,7 @@     , otherHighlight     , litHaskell     , toc+    , rawlatex     , wplatex     , math     , ghci@@ -54,6 +55,7 @@     , otherHighlight'     , litHaskell'     , toc'+    , rawlatex'     , wplatex'     , math'     , ghci'@@ -93,6 +95,7 @@                                            --   non-Haskell?   , _litHaskell     :: Maybe Bool          -- ^ Parse as literate Haskell?   , _toc            :: Maybe Bool          -- ^ Generate a table of contents?+  , _rawlatex       :: Maybe Bool          -- ^ Pass LaTeX through unchanged?   , _wplatex        :: Maybe Bool          -- ^ Format LaTeX for WordPress?   , _math           :: Maybe String        -- ^ Indicate how to format math   , _ghci           :: Maybe Bool          -- ^ Automatically process ghci sessions?@@ -138,6 +141,7 @@     , _otherHighlight = Nothing     , _litHaskell     = Nothing     , _toc            = Nothing+    , _rawlatex       = Nothing     , _wplatex        = Nothing     , _math           = Nothing     , _ghci           = Nothing@@ -167,6 +171,7 @@     , _otherHighlight = combine _otherHighlight     , _litHaskell     = combine _litHaskell     , _toc            = combine _toc+    , _rawlatex       = combine _rawlatex     , _wplatex        = combine _wplatex     , _math           = combine _math     , _ghci           = combine _ghci@@ -213,6 +218,9 @@ toc' :: BlogLiterately -> Bool toc'            = fromMaybe False . view toc +rawlatex' :: BlogLiterately -> Bool+rawlatex'        = fromMaybe False . view rawlatex+ wplatex' :: BlogLiterately -> Bool wplatex'        = fromMaybe False . view wplatex @@ -308,6 +316,8 @@          &= help "generate a table of contents"          &= explicit        ]+     , _rawlatex = def &= help "pass inline/display LaTeX through unchanged"+                       &= name "rawlatex" &= name "r" &= explicit      , _wplatex = def &= help "reformat inline LaTeX the way WordPress expects"                   &= name "wplatex" &= name "w" &= explicit      , _math    = def &= help "how to layout math, where --math=<pandoc-option>[=URL]"
src/Text/BlogLiterately/Options/Parse.hs view
@@ -53,6 +53,7 @@ parseBLOption =       parseField style        "style"         parseStr   <|> parseField toc          "toc"           parseBool+  <|> parseField rawlatex     "rawlatex"      parseBool   <|> parseField wplatex      "wplatex"       parseBool   <|> parseField math         "math"          parseStr   <|> parseField litHaskell   "lit-haskell"   parseBool
src/Text/BlogLiterately/Transform.hs view
@@ -28,6 +28,7 @@     , highlightOptsXF     , passwordXF     , titleXF+    , rawtexifyXF     , wptexifyXF     , ghciXF     , uploadImagesXF@@ -93,7 +94,7 @@                                                     getStylePrefs,                                                     _HsColourInline) import           Text.BlogLiterately.Image         (uploadAllImages)-import           Text.BlogLiterately.LaTeX         (wpTeXify)+import           Text.BlogLiterately.LaTeX         (rawTeXify, wpTeXify) import           Text.BlogLiterately.Options import           Text.BlogLiterately.Options.Parse (readBLOptions) import           Text.BlogLiterately.Post          (findTitle, getPostURL)@@ -167,6 +168,10 @@ -- These transforms are enabled by default in the standard -- @BlogLiterately@ executable. +-- | Pass LaTeX (inline or display) through unchanged (if the @rawlatex@ flag is set).+rawtexifyXF :: Transform+rawtexifyXF = pureTransform (const rawTeXify) rawlatex'+ -- | Format embedded LaTeX for WordPress (if the @wplatex@ flag is set). wptexifyXF :: Transform wptexifyXF = pureTransform (const wpTeXify) wplatex'@@ -479,6 +484,8 @@ -- --   * 'titleXF': extract the title from a special title block --+--   * 'rawtexifyXF': pass LaTeX through unchanged+-- --   * 'wptexifyXF': turn LaTeX into WordPress format if requested -- --   * 'ghciXF': run and typeset ghci sessions if requested@@ -508,6 +515,7 @@     -- much, except highlightOptsXF should go before highlightXF.   , passwordXF   , titleXF+  , rawtexifyXF   , wptexifyXF   , ghciXF   , uploadImagesXF@@ -546,14 +554,19 @@             ".txt"  -> readRST opts             _       -> readMarkdown opts -    parseOpts = def-                { readerExtensions =-                    enableExtension Ext_smart $-                    case bl^.litHaskell of-                      Just False -> readerExtensions def-                      _          -> enableExtension Ext_literate_haskell-                                    (readerExtensions def)-                }+    parseOpts = let e0 = enableExtension Ext_smart $+                         case bl^.litHaskell of+                           Just False -> readerExtensions def+                           _          -> enableExtension Ext_literate_haskell+                                              (readerExtensions def)+                    e1 = case bl^.rawlatex of+                           Just True -> enableExtension Ext_tex_math_dollars $+                                        enableExtension Ext_tex_math_single_backslash $+                                        readerExtensions def+                           _         -> readerExtensions def++                 in def { readerExtensions = e0 <> e1 }+     writeOpts bl = def                    { writerReferenceLinks = True                    , writerTableOfContents = toc' bl