summaryrefslogtreecommitdiff
path: root/pandoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-05-08 23:46:02 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-05-08 23:47:50 -0700
commit1c2951dfd9ee72e5270cb974a06098adb9178f89 (patch)
tree8bd06bd47431b6de127d19f401986dea1882fd72 /pandoc.hs
parent41a457a649cb981c703375181964314523546d72 (diff)
EPUB writer: stylesheet changes. Closes #2040.
* Allow `--css` to be used to specify stylesheets. * Deprecated `--epub-stylesheet` and made it a synoynym of `--css`. * If a code block with class "css" is given as contents of the `stylesheet` metadata field, use its literal code as contents of the epub stylesheet. Otherwise, treat it as a filename and read the file. * Note: `--css` and `stylesheet` in metadata are not compatible. `stylesheet` takes precedence.
Diffstat (limited to 'pandoc.hs')
-rw-r--r--pandoc.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/pandoc.hs b/pandoc.hs
index 9023b2625..45e5de5f2 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -689,8 +689,10 @@ options =
, Option "" ["epub-stylesheet"]
(ReqArg
(\arg opt -> do
- text <- UTF8.readFile arg
- return opt { optEpubStylesheet = Just text })
+ warn "--epub-stylesheet is deprecated. Use --css or stylesheet in metadata."
+ let newvars = optVariables opt ++ [("css",arg)]
+ return opt { optVariables = newvars,
+ optStandalone = True })
"FILENAME")
"" -- "Path of epub.css"