tools: hakyll-std updates, use pandoc 2
This commit is contained in:
parent
1fe3d7e824
commit
28f4b1a0ec
@ -14,6 +14,7 @@ import Text.Pandoc
|
|||||||
import Text.Pandoc.Walk (walk, query)
|
import Text.Pandoc.Walk (walk, query)
|
||||||
|
|
||||||
import Data.List (groupBy)
|
import Data.List (groupBy)
|
||||||
|
import Data.Text (unpack)
|
||||||
import Data.Tree (Forest, Tree(Node))
|
import Data.Tree (Forest, Tree(Node))
|
||||||
#if !(MIN_VERSION_base(4,11,0))
|
#if !(MIN_VERSION_base(4,11,0))
|
||||||
import Data.Monoid ((<>), mconcat)
|
import Data.Monoid ((<>), mconcat)
|
||||||
@ -53,9 +54,9 @@ markupHeader :: Tree Block -> H.Html
|
|||||||
markupHeader (Node (Header _ (ident, _, keyvals) inline) headers)
|
markupHeader (Node (Header _ (ident, _, keyvals) inline) headers)
|
||||||
| headers == [] = H.li $ link
|
| headers == [] = H.li $ link
|
||||||
| otherwise = H.li $ link <> (H.ol $ markupHeaders headers)
|
| otherwise = H.li $ link <> (H.ol $ markupHeaders headers)
|
||||||
where render x = writeHtmlString def (Pandoc nullMeta [(Plain x)])
|
where render x = write5HtmlString def (Pandoc nullMeta [(Plain x)])
|
||||||
section = fromMaybe (render inline) (lookup "toc" keyvals)
|
section = fromMaybe (render inline) (lookup "toc" keyvals)
|
||||||
link = H.a ! A.href (H.toValue $ "#" ++ ident) $ preEscapedToHtml section
|
link = H.a ! A.href (H.toValue $ "#" ++ ident) $ preEscapedToHtml $ unpack section
|
||||||
markupHeader _ = error "what"
|
markupHeader _ = error "what"
|
||||||
|
|
||||||
markupHeaders :: Forest Block -> H.Html
|
markupHeaders :: Forest Block -> H.Html
|
||||||
|
|||||||
@ -5,9 +5,13 @@
|
|||||||
--package pandoc
|
--package pandoc
|
||||||
-- ghc
|
-- ghc
|
||||||
-}
|
-}
|
||||||
-- Need to stick stack-ghc8.2.yaml for hakyll/pandoc. hledger and
|
-- pandoc must be >= 2
|
||||||
-- Shake use stack.yaml by default so you may end up downloading and
|
--
|
||||||
-- building two snapshots. hakyll-std will go away soon hopefully.
|
-- must use older stack-ghc8.2.yaml for hakyll/pandoc
|
||||||
|
-- (hledger and Shake use stack.yaml by default so you may
|
||||||
|
-- end up downloading and building two large snapshots)
|
||||||
|
--
|
||||||
|
-- hakyll-std will go away soon hopefully
|
||||||
|
|
||||||
{- |
|
{- |
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user