Navigation Menu

Skip to content

Commit

Permalink
Bump version bounds for time, pandoc, blaze-html, aeson.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Feb 14, 2017
1 parent 1b1f598 commit 92fa947
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 14 deletions.
8 changes: 4 additions & 4 deletions gitit.cabal
Expand Up @@ -139,7 +139,7 @@ Library
directory,
mtl,
old-time,
pandoc >= 1.12.4 && < 1.19,
pandoc >= 1.12.4 && < 1.20,
pandoc-types >= 1.12.3 && < 1.18,
highlighting-kate >= 0.5.0.1 && < 0.7,
bytestring,
Expand All @@ -150,7 +150,7 @@ Library
HTTP >= 4000.0 && < 4000.4,
HStringTemplate >= 0.6 && < 0.9,
old-locale >= 1,
time >= 1.1 && < 1.7,
time >= 1.1 && < 1.8,
recaptcha >= 0.1,
filestore >= 0.6 && < 0.7,
zlib >= 0.5 && < 0.7,
Expand All @@ -163,14 +163,14 @@ Library
feed >= 0.3.6 && < 0.4,
xss-sanitize >= 0.3 && < 0.4,
tagsoup >= 0.13 && < 0.15,
blaze-html >= 0.4 && < 0.9,
blaze-html >= 0.4 && < 0.10,
json >= 0.4 && < 0.10,
uri >= 0.1 && < 0.2,
split,
hoauth2 >= 0.4.2 && < 0.6,
http-conduit >= 2.1.4 && < 2.3,
http-client-tls >= 0.2.2 && < 0.4,
aeson >= 0.7 && < 1.1,
aeson >= 0.7 && < 1.2,
uuid >= 1.3 && < 1.4
if impl(ghc >= 6.10)
build-depends: base >= 4, syb
Expand Down
7 changes: 6 additions & 1 deletion src/Network/Gitit/ContentTransformer.hs
Expand Up @@ -529,11 +529,16 @@ pandocToHtml pandocContents = do
toc <- liftM ctxTOC get
bird <- liftM ctxBirdTracks get
cfg <- lift getConfig
let tpl = "$if(toc)$<div id=\"TOC\">\n$toc$\n</div>\n$endif$\n$body$"
return $ primHtml $ T.unpack .
(if xssSanitize cfg then sanitizeBalance else id) . T.pack $
writeHtmlString def{
#if MIN_VERSION_pandoc(1,19,0)
writerTemplate = Just tpl
#else
writerStandalone = True
, writerTemplate = "$if(toc)$<div id=\"TOC\">\n$toc$\n</div>\n$endif$\n$body$"
, writerTemplate = tpl
#endif
, writerHTMLMathMethod =
case mathMethod cfg of
MathML -> Pandoc.MathML Nothing
Expand Down
26 changes: 21 additions & 5 deletions src/Network/Gitit/Export.hs
Expand Up @@ -48,7 +48,7 @@ import Text.Highlighting.Kate (styleToCss, pygments)
import Paths_gitit (getDataFileName)

defaultRespOptions :: WriterOptions
defaultRespOptions = def { writerStandalone = True, writerHighlight = True }
defaultRespOptions = def { writerHighlight = True }

respond :: String
-> String
Expand All @@ -73,7 +73,13 @@ respondX templ mimetype ext fn opts page doc = do
doc' <- if ext `elem` ["odt","pdf","beamer","epub","docx","rtf"]
then fixURLs page doc
else return doc
respond mimetype ext (fn opts{writerTemplate = template
respond mimetype ext (fn opts{
#if MIN_VERSION_pandoc(1,19,0)
writerTemplate = Just template
#else
writerTemplate = template
,writerStandalone = True
#endif
,writerUserDataDir = pandocUserData cfg})
page doc'

Expand Down Expand Up @@ -102,8 +108,7 @@ respondSlides templ slideVariant page doc = do
-- needed for the slides.) We then pass the body into the
-- slide template using the 'body' variable.
Pandoc meta blocks <- fixURLs page doc
let body' = writeHtmlString opts'{writerStandalone = False}
(Pandoc meta blocks) -- just body
let body' = writeHtmlString opts' (Pandoc meta blocks) -- just body
let body'' = T.unpack
$ (if xssSanitize cfg then sanitizeBalance else id)
$ T.pack body'
Expand All @@ -128,7 +133,12 @@ respondSlides templ slideVariant page doc = do
let opts'' = opts'{
writerVariables =
("body",body''):("dzslides-core",dzcore):("highlighting-css",pygmentsCss):variables'
#if MIN_VERSION_pandoc(1,19,0)
,writerTemplate = Just template
#else
,writerTemplate = template
,writerStandalone = True
#endif
,writerUserDataDir = pandocUserData cfg
}
let h = writeHtmlString opts'' (Pandoc meta [])
Expand Down Expand Up @@ -239,7 +249,13 @@ respondPDF useBeamer page old_pndc = fixURLs page old_pndc >>= \pndc -> do
template <- liftIO $ either throwIO return template'
let toc = tableOfContents cfg
res <- liftIO $ makePDF "pdflatex" writeLaTeX
defaultRespOptions{writerTemplate = template
defaultRespOptions{
#if MIN_VERSION_pandoc(1,19,0)
writerTemplate = Just template
#else
writerTemplate = template
,writerStandalone = True
#endif
,writerSourceURL = Just $ baseUrl cfg
,writerTableOfContents = toc
,writerBeamer = useBeamer} pndc
Expand Down
3 changes: 1 addition & 2 deletions src/Network/Gitit/Initialize.hs
Expand Up @@ -127,8 +127,7 @@ createDefaultPages conf = do
let fs = filestoreFromConfig conf
pt = defaultPageType conf
toPandoc = handleError . readMarkdown def{ readerSmart = True }
defOpts = def{ writerStandalone = False
, writerHTMLMathMethod = JsMath
defOpts = def{ writerHTMLMathMethod = JsMath
(Just "/js/jsMath/easy/load.js")
, writerExtensions = if showLHSBirdTracks conf
then Set.insert
Expand Down
4 changes: 2 additions & 2 deletions stack.yaml
Expand Up @@ -5,7 +5,7 @@ flags:
packages:
- '.'
extra-deps:
- filestore-0.6.2
- filestore-0.6.3.1
- recaptcha-0.1.0.3
- uri-0.1.6.4
resolver: lts-7.8
resolver: lts-8.0

0 comments on commit 92fa947

Please sign in to comment.