BlogLiterately 0.8.6 → 0.8.6.1
raw patch · 4 files changed
+46/−22 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- BlogLiterately.cabal +1/−1
- CHANGES.md +8/−0
- doc/BlogLiteratelyDoc.lhs +12/−2
- src/Text/BlogLiterately/Transform.hs +25/−19
BlogLiterately.cabal view
@@ -1,5 +1,5 @@ Name: BlogLiterately-Version: 0.8.6+Version: 0.8.6.1 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
CHANGES.md view
@@ -1,3 +1,11 @@+0.8.6.1 (31 January 2018)+-------------------------++ - bug fix: a lot of options got turned off by default in pandoc 2.x!+ Restore default pandoc Markdown parsing options. This bug means+ that 0.8.5 and 0.8.6 did not parse various things correctly such+ as LaTeX math, citations, and YAML header blocks.+ 0.8.6 (31 January 2018) -----------------------
doc/BlogLiteratelyDoc.lhs view
@@ -235,6 +235,10 @@ Note that an extra `$latex...` won't be added to the beginning of LaTeX expressions which already appear to be in WordPress format. +Finally, to simply pass LaTeX math through unchanged (for example, if+your blog hosting software will do LaTeX processing), you can use the+`--rawlatex` option.+ Special links ------------- @@ -336,7 +340,7 @@ length txt (And yes, of course, the above output really *was* generated by-BlogLiterately!) Additionally, lines indented by one or more spaces+`BlogLiterately`!) Additionally, lines indented by one or more spaces are interpreted as *expected outputs* instead of inputs. Consecutive indented lines are interpreted as one multi-line expected output, with a number of spaces removed from the beginning of each line equal to@@ -452,13 +456,18 @@ --kate highlight non-Haskell code with highlighting-kate (default) --no-kate don't highlight non-Haskell code+ --lit-haskell parse as literate Haskell (default)+ --no-lit-haskell do not parse as literate Haskell+ --no-toc don't generate a table of contents (default)+ --toc generate a table of contents+ -r --rawlatex pass inline/display LaTeX through unchanged -w --wplatex reformat inline LaTeX the way WordPress expects -m --math=ITEM how to layout math, where --math=<pandoc-option>[=URL] -g --ghci run [ghci] blocks through ghci and include output -I --upload-images upload local images -C --category=ITEM post category (can specify more than one)- -T --tag=ITEM tag (can specify more than one)+ -T --tag=ITEM ---tags tag (can specify more than one) --blogid=ID Blog specific identifier -P --profile=STRING profile to use -b --blog=URL blog XML-RPC url (if omitted, HTML goes to stdout)@@ -475,6 +484,7 @@ -x --xtra=ITEM extension arguments, for use with custom extensions -? --help Display help message -V --version Print version information+ --numeric-version Print just the version number Profiles --------
src/Text/BlogLiterately/Transform.hs view
@@ -554,28 +554,34 @@ ".txt" -> readRST opts _ -> readMarkdown opts - 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+ parseOpts = def+ { readerExtensions = pandocExtensions &+ foldr (.) id+ [ enableExtension Ext_tex_math_single_backslash+ , case bl^.litHaskell of+ Just False -> id+ _ -> enableExtension Ext_literate_haskell+ ] - in def { readerExtensions = e0 <> e1 }+ -- Relevant extensions enabled by default in pandocExtensions:+ -- (see https://hackage.haskell.org/package/pandoc-2.1.1/docs/src/Text-Pandoc-Extensions.html#pandocExtensions): + -- Ext_smart+ -- Ext_yaml_metadata_block+ -- Ext_tex_math_dollars+ -- Ext_pandoc_title_block+ -- Ext_citations+ } writeOpts bl = def- { writerReferenceLinks = True- , writerTableOfContents = toc' bl- , writerHTMLMathMethod =- case math' bl of- "" -> PlainMath- opt -> mathOption opt- , writerTemplate = Just blHtmlTemplate- }+ { writerReferenceLinks = True+ , writerTableOfContents = toc' bl+ , writerHTMLMathMethod =+ case math' bl of+ "" -> PlainMath+ opt -> mathOption opt+ , writerTemplate = Just blHtmlTemplate+ }+ mathOption opt | opt `isPrefixOf` "latexmathml" || opt `isPrefixOf` "asciimathml" = LaTeXMathML (mathUrlMaybe opt)