diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-11-04 18:58:37 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-11-04 18:58:37 -0800 |
commit | 7f5e2af1fb9f7eff11c50996bc6b6245ec9550ff (patch) | |
tree | f3f8fe030613f6fd94aa08d95ebe37d97d48af68 | |
parent | 9d0b011869d06be2e540feac99070683e10d33da (diff) |
EPUB writer: Improved handling of CSS.
* Code highlighting now works by default.
* Quote styles work as in pandoc's HTML writer.
-rw-r--r-- | src/Text/Pandoc/Writers/EPUB.hs | 8 | ||||
m--------- | templates | 13 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 463e2c587..4effc7b2b 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -75,7 +75,9 @@ writeEPUB version opts doc@(Pandoc meta _) = do let epub3 = version == EPUB3 epochtime <- floor `fmap` getPOSIXTime let mkEntry path content = toEntry path epochtime content - let vars = ("epub3", if epub3 then "true" else "false"):writerVariables opts + let vars = ("epub3", if epub3 then "true" else "false") + : ("css", "stylesheet.css") + : writerVariables opts let opts' = opts{ writerEmailObfuscation = NoObfuscation , writerStandalone = True , writerSectionDivs = True @@ -400,7 +402,9 @@ transformInlines (MathML _) _ _ (x@(Math _ _) : xs) = do let writeHtmlInline opts z = trimr $ writeHtmlString opts $ Pandoc (Meta [] [] []) [Plain [z]] mathml = writeHtmlInline def{writerHTMLMathMethod = MathML Nothing } x - fallback = writeHtmlInline def{writerHTMLMathMethod = PlainMath } x + -- we use mathjax to get raw latex, since readers tend to + -- fall back to using mathjax... + fallback = writeHtmlInline def{writerHTMLMathMethod = MathJax "" } x inSwitch = "<epub:switch><epub:case required-namespace=" ++ "\"http://www.w3.org/1998/Math/MathML\">" ++ mathml ++ "</epub:case><epub:default>" ++ fallback ++ diff --git a/templates b/templates -Subproject 0b394e7ccd80dbe37a18a88f383ac5a0740d5d2 +Subproject 9fae8b31dd1fc3667993a35b7db6b252b85c840 |