summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-06-22 12:01:33 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-06-22 12:01:33 +0200
commit24d215acf584a52ad3ea3a9a3f97c751d26e08a4 (patch)
tree6c51457e54035e228f89cd4c8490d166ecb429dc
parent379b99f63abe534c7666c8e16e0bf2e980b63d1c (diff)
Added `--epub-subdirectory` option.
This specifies the subdirectory in the OCF container that holds the EPUB specific content. Closes #3720.
-rw-r--r--MANUAL.txt6
-rw-r--r--src/Text/Pandoc/App.hs10
2 files changed, 16 insertions, 0 deletions
diff --git a/MANUAL.txt b/MANUAL.txt
index d200c2f0c..a75c6fd2a 100644
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -977,6 +977,12 @@ Options affecting specific writers
documents with few level 1 headers, one might want to use a chapter
level of 2 or 3.
+`--epub-subdirectory=`*DIRNAME*
+
+: Specify the subdirectory in the OCF container that is to hold
+ the EPUB-specific contents. The default is `EPUB`. To put
+ the EPUB contents in the top level, use an empty string.
+
`--latex-engine=pdflatex`|`lualatex`|`xelatex`
: Use the specified LaTeX engine when producing PDF output.
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index 7e9cfdd95..3c259fce7 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -355,6 +355,7 @@ convertWithOpts opts = do
writerSlideLevel = optSlideLevel opts,
writerHighlightStyle = highlightStyle,
writerSetextHeaders = optSetextHeaders opts,
+ writerEpubSubdirectory = optEpubSubdirectory opts,
writerEpubMetadata = epubMetadata,
writerEpubFonts = optEpubFonts opts,
writerEpubChapterLevel = optEpubChapterLevel opts,
@@ -553,6 +554,7 @@ data Opt = Opt
, optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
, optAbbreviations :: Maybe FilePath -- ^ Path to abbrevs file
, optReferenceDoc :: Maybe FilePath -- ^ Path of reference doc
+ , optEpubSubdirectory :: String -- ^ EPUB subdir in OCF container
, optEpubMetadata :: Maybe FilePath -- ^ EPUB metadata
, optEpubFonts :: [FilePath] -- ^ EPUB fonts to embed
, optEpubChapterLevel :: Int -- ^ Header level at which to split chapters
@@ -628,6 +630,7 @@ defaultOpts = Opt
, optHTMLMathMethod = PlainMath
, optAbbreviations = Nothing
, optReferenceDoc = Nothing
+ , optEpubSubdirectory = "EPUB"
, optEpubMetadata = Nothing
, optEpubFonts = []
, optEpubChapterLevel = 1
@@ -1243,6 +1246,13 @@ options =
"FILE")
"" -- "Path of custom reference doc"
+ , Option "" ["epub-subdirectory"]
+ (ReqArg
+ (\arg opt ->
+ return opt { optEpubSubdirectory = arg })
+ "DIRNAME")
+ "" -- "Name of subdirectory for epub content in OCF container"
+
, Option "" ["epub-cover-image"]
(ReqArg
(\arg opt ->