aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README3
-rw-r--r--pandoc.cabal2
-rw-r--r--src/Text/Pandoc/Templates.hs2
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs11
m---------templates10
5 files changed, 10 insertions, 18 deletions
diff --git a/README b/README
index 0d79c05a2..de2cf72e2 100644
--- a/README
+++ b/README
@@ -660,8 +660,7 @@ the system default templates for a given output format `FORMAT`
by putting a file `templates/default.FORMAT` in the user data
directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
customize the `default.opendocument` template. For `pdf` output,
-customize the `default.latex` template. For `epub` and `epub3` output,
-customize the `epub-page.html` template.
+customize the `default.latex` template.
Templates may contain *variables*. Variable names are sequences of
alphanumerics, `-`, and `_`, starting with a letter. A variable name
diff --git a/pandoc.cabal b/pandoc.cabal
index 5b7f65b94..4af2a2e68 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -49,7 +49,7 @@ Data-Files:
templates/default.slideous,
templates/default.dzslides, templates/default.asciidoc,
templates/default.textile, templates/default.org,
- templates/epub-page.html,
+ templates/default.epub, templates/default.epub3,
-- data for ODT writer
reference.odt,
-- data for docx writer
diff --git a/src/Text/Pandoc/Templates.hs b/src/Text/Pandoc/Templates.hs
index 4e43160ba..75c133101 100644
--- a/src/Text/Pandoc/Templates.hs
+++ b/src/Text/Pandoc/Templates.hs
@@ -93,8 +93,6 @@ getDefaultTemplate user writer = do
"native" -> return $ Right ""
"json" -> return $ Right ""
"docx" -> return $ Right ""
- "epub" -> return $ Right ""
- "epub3" -> return $ Right ""
"odt" -> getDefaultTemplate user "opendocument"
"markdown_strict" -> getDefaultTemplate user "markdown"
"multimarkdown" -> getDefaultTemplate user "markdown"
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index ec51253e7..f1ae41d2f 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -33,7 +33,7 @@ import Data.Maybe ( fromMaybe, isNothing )
import Data.List ( isPrefixOf, isInfixOf, intercalate )
import System.Environment ( getEnv )
import Text.Printf (printf)
-import System.FilePath ( (</>), (<.>), takeBaseName, takeExtension, takeFileName )
+import System.FilePath ( (</>), takeBaseName, takeExtension, takeFileName )
import qualified Data.ByteString.Lazy as B
import qualified Data.ByteString.Lazy.Char8 as B8
import Text.Pandoc.UTF8 ( fromStringLazy )
@@ -74,15 +74,12 @@ writeEPUB :: EPUBVersion
writeEPUB version opts doc@(Pandoc meta _) = do
let epub3 = version == EPUB3
epochtime <- floor `fmap` getPOSIXTime
- pageTemplate <- readDataFile (writerUserDataDir opts)
- $ "templates" </> "epub-page" <.> "html"
let mkEntry path content = toEntry path epochtime content
let vars = ("epub3", if epub3 then "true" else "false")
: ("css", "stylesheet.css")
: writerVariables opts
let opts' = opts{ writerEmailObfuscation = NoObfuscation
, writerStandalone = True
- , writerTemplate = pageTemplate
, writerSectionDivs = True
, writerHtml5 = epub3
, writerTableOfContents = False -- we always have one in epub
@@ -102,7 +99,7 @@ writeEPUB version opts doc@(Pandoc meta _) = do
Just img -> do
let coverImage = "cover-image" ++ takeExtension img
let cpContent = renderHtml $ writeHtml opts'
- (Pandoc meta [RawBlock "html" $ "<div id=\"cover-image\">\n<img src=\"" ++ coverImage ++ " alt=\"cover image\" />\n</div"])
+ (Pandoc meta [RawBlock "html" $ "<div id=\"cover-image\">\n<img src=\"" ++ coverImage ++ "\" alt=\"cover image\" />\n</div>"])
imgContent <- B.readFile img
return ( [mkEntry "cover.xhtml" cpContent]
, [mkEntry coverImage imgContent] )
@@ -149,9 +146,7 @@ writeEPUB version opts doc@(Pandoc meta _) = do
let chapToEntry :: Int -> [Block] -> Entry
chapToEntry num bs = mkEntry (showChapter num)
$ renderHtml
- $ writeHtml opts'{ writerStandalone = True
- , writerTemplate = pageTemplate
- }
+ $ writeHtml opts'
$ case bs of
(Header 1 xs : _) -> Pandoc (Meta xs [] []) bs
_ -> Pandoc (Meta [] [] []) bs
diff --git a/templates b/templates
-Subproject 1709949ce52424737549c365cf549995df0435e
+Subproject ba97adf746a5573a822f9f5d744d46364814d61