From 28f4b1a0ec2da078ada2e3acc509621fc67b9f34 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sun, 25 Mar 2018 13:08:30 +0100 Subject: [PATCH] tools: hakyll-std updates, use pandoc 2 --- site/hakyll-std/TableOfContents.hs | 5 +++-- site/hakyll-std/hakyll-std.hs | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/site/hakyll-std/TableOfContents.hs b/site/hakyll-std/TableOfContents.hs index f43d57570..c4caeb623 100644 --- a/site/hakyll-std/TableOfContents.hs +++ b/site/hakyll-std/TableOfContents.hs @@ -14,6 +14,7 @@ import Text.Pandoc import Text.Pandoc.Walk (walk, query) import Data.List (groupBy) +import Data.Text (unpack) import Data.Tree (Forest, Tree(Node)) #if !(MIN_VERSION_base(4,11,0)) import Data.Monoid ((<>), mconcat) @@ -53,9 +54,9 @@ markupHeader :: Tree Block -> H.Html markupHeader (Node (Header _ (ident, _, keyvals) inline) headers) | headers == [] = H.li $ link | 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) - link = H.a ! A.href (H.toValue $ "#" ++ ident) $ preEscapedToHtml section + link = H.a ! A.href (H.toValue $ "#" ++ ident) $ preEscapedToHtml $ unpack section markupHeader _ = error "what" markupHeaders :: Forest Block -> H.Html diff --git a/site/hakyll-std/hakyll-std.hs b/site/hakyll-std/hakyll-std.hs index 068303eed..f337a05ce 100755 --- a/site/hakyll-std/hakyll-std.hs +++ b/site/hakyll-std/hakyll-std.hs @@ -5,9 +5,13 @@ --package pandoc -- ghc -} --- Need to stick stack-ghc8.2.yaml for hakyll/pandoc. hledger and --- Shake use stack.yaml by default so you may end up downloading and --- building two snapshots. hakyll-std will go away soon hopefully. +-- pandoc must be >= 2 +-- +-- 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 {- |