aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2014-07-30 00:57:20 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2014-07-31 21:39:50 +0100
commit8460ea417f3bcd4599f1ba4877dd4c6e2a373ed1 (patch)
tree19c8d40ec10efbf9ea1056ecaabab7e094ede2c0
parent51051e9953f97c35178eded5d3959394a184baf4 (diff)
downloadpandoc-8460ea417f3bcd4599f1ba4877dd4c6e2a373ed1.tar.gz
EPUB Reader: Integrated into program
-rw-r--r--pandoc.cabal6
-rw-r--r--pandoc.hs1
-rw-r--r--src/Text/Pandoc.hs3
3 files changed, 8 insertions, 2 deletions
diff --git a/pandoc.cabal b/pandoc.cabal
index 47bdb6587..991398f24 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -231,7 +231,7 @@ Library
xml >= 1.3.12 && < 1.4,
random >= 1 && < 1.1,
extensible-exceptions >= 0.1 && < 0.2,
- pandoc-types >= 1.12.3.3 && < 1.13,
+ pandoc-types >= 1.12.3.4 && < 1.13,
aeson >= 0.7 && < 0.8,
tagsoup >= 0.13.1 && < 0.14,
base64-bytestring >= 0.1 && < 1.1,
@@ -248,7 +248,8 @@ Library
binary >= 0.5 && < 0.8,
SHA >= 1.6 && < 1.7,
haddock-library >= 1.1 && < 1.2,
- old-time
+ old-time,
+ deepseq-generics >= 0.1 && < 0.2
if flag(https)
Build-Depends: http-client >= 0.3.2 && < 0.4,
http-client-tls >= 0.2 && < 0.3,
@@ -287,6 +288,7 @@ Library
Text.Pandoc.Readers.Native,
Text.Pandoc.Readers.Haddock,
Text.Pandoc.Readers.Docx,
+ Text.Pandoc.Readers.EPUB,
Text.Pandoc.Writers.Native,
Text.Pandoc.Writers.Docbook,
Text.Pandoc.Writers.OPML,
diff --git a/pandoc.hs b/pandoc.hs
index 2563afc9c..de41b38cb 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -891,6 +891,7 @@ defaultReaderName fallback (x:xs) =
".json" -> "json"
".docx" -> "docx"
".t2t" -> "t2t"
+ ".epub" -> "epub"
_ -> defaultReaderName fallback xs
-- Returns True if extension of first source is .lhs
diff --git a/src/Text/Pandoc.hs b/src/Text/Pandoc.hs
index 77eb3e82f..589a6af98 100644
--- a/src/Text/Pandoc.hs
+++ b/src/Text/Pandoc.hs
@@ -79,6 +79,7 @@ module Text.Pandoc
, readJSON
, readTxt2Tags
, readTxt2TagsNoMacros
+ , readEPUB
-- * Writers: converting /from/ Pandoc format
, Writer (..)
, writeNative
@@ -134,6 +135,7 @@ import Text.Pandoc.Readers.Native
import Text.Pandoc.Readers.Haddock
import Text.Pandoc.Readers.Docx
import Text.Pandoc.Readers.Txt2Tags
+import Text.Pandoc.Readers.EPUB
import Text.Pandoc.Writers.Native
import Text.Pandoc.Writers.Markdown
import Text.Pandoc.Writers.RST
@@ -233,6 +235,7 @@ readers = [ ("native" , StringReader $ \_ s -> return $ readNative s)
,("haddock" , mkStringReader readHaddock)
,("docx" , mkBSReader readDocx)
,("t2t" , mkStringReader readTxt2TagsNoMacros)
+ ,("epub" , mkBSReader readEPUB)
]
data Writer = PureStringWriter (WriterOptions -> Pandoc -> String)