git.iko.soy/typeable/pandoc
on master help sign in
EPUB writer: Improved handling of CSS.

* Code highlighting now works by default. * Quote styles work as in pandoc's HTML writer.

commit7f5e2af1fb9f7eff11c50996bc6b6245ec9550ff authorJohn MacFarlane <fiddlosopher@gmail.com> dateSun 4 Nov 2012, 18:58 (14 years ago) parent9d0b011
2 files changed+7−3
src/Text/Pandoc/Writers/EPUB.hs+6−2 templates+1−1
src/Text/Pandoc/Writers/EPUB.hs+6−2
@@ -75,7 +75,9 @@ writeEPUB version opts doc@(Pandoc meta _) = do
7575 let epub3 = version == EPUB3
7676 epochtime <- floor `fmap` getPOSIXTime
7777 let mkEntry path content = toEntry path epochtime content
78− let vars = ("epub3", if epub3 then "true" else "false"):writerVariables opts
78+ let vars = ("epub3", if epub3 then "true" else "false")
79+ : ("css", "stylesheet.css")
80+ : writerVariables opts
7981 let opts' = opts{ writerEmailObfuscation = NoObfuscation
8082 , writerStandalone = True
8183 , writerSectionDivs = True
@@ -400,7 +402,9 @@ transformInlines (MathML _) _ _ (x@(Math _ _) : xs) = do
400402 let writeHtmlInline opts z = trimr $
401403 writeHtmlString opts $ Pandoc (Meta [] [] []) [Plain [z]]
402404 mathml = writeHtmlInline def{writerHTMLMathMethod = MathML Nothing } x
403− fallback = writeHtmlInline def{writerHTMLMathMethod = PlainMath } x
405+ -- we use mathjax to get raw latex, since readers tend to
406+ -- fall back to using mathjax...
407+ fallback = writeHtmlInline def{writerHTMLMathMethod = MathJax "" } x
404408 inSwitch = "<epub:switch><epub:case required-namespace=" ++
405409 "\"http://www.w3.org/1998/Math/MathML\">" ++ mathml ++
406410 "</epub:case><epub:default>" ++ fallback ++
templates+1−1

Submodule changed.