mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-26 20:02:27 +03:00
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 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
|
||||
|
@ -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
|
||||
|
||||
{- |
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user