aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/EPUB.hs
AgeCommit message (Collapse)AuthorFilesLines
2020-02-07Resolve HLint warningsAlbert Krewinkel1-3/+3
All warnings are either fixed or, if more appropriate, HLint is configured to ignore them. HLint suggestions remain. * Ignore "Use camelCase" warnings in Lua and legacy code * Fix or ignore remaining HLint warnings * Remove redundant brackets * Remove redundant `return`s * Remove redundant as-pattern * Fuse mapM_/map * Use `.` to shorten code * Remove redundant `fmap` * Remove unused LANGUAGE pragmas * Hoist `not` in Text.Pandoc.App * Use fewer imports for `Text.DocTemplates` * Remove redundant `do`s * Remove redundant `$`s * Jira reader: remove unnecessary parentheses
2020-02-03Swap suboptimal uses of maybe and fromMaybe (#6111)Joseph C. Sible1-1/+1
Anywhere "maybe" is used with "id" as its second argument, using "fromMaybe" instead will simplify the code. Conversely, anywhere "fromMaybe" is used with the result of "fmap" or "<$>" as its second argument, using "maybe" instead will simplify the code.
2019-11-12Switch to new pandoc-types and use Text instead of String [API change].despresc1-25/+28
PR #5884. + Use pandoc-types 1.20 and texmath 0.12. + Text is now used instead of String, with a few exceptions. + In the MediaBag module, some of the types using Strings were switched to use FilePath instead (not Text). + In the Parsing module, new parsers `manyChar`, `many1Char`, `manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`, `mantyUntilChar` have been added: these are like their unsuffixed counterparts but pack some or all of their output. + `glob` in Text.Pandoc.Class still takes String since it seems to be intended as an interface to Glob, which uses strings. It seems to be used only once in the package, in the EPUB writer, so that is not hard to change.
2019-06-18Handle the case where the "cover" meta does not link to the manifestblmage1-2/+2
2019-06-18Add support for EPUB2 covers (fix #3992)blmage1-7/+14
2019-03-01Remove license boilerplate.John MacFarlane1-18/+0
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel1-2/+2
Quite a few modules were missing copyright notices. This commit adds copyright notices everywhere via haddock module headers. The old license boilerplate comment is redundant with this and has been removed. Update copyright years to 2019. Closes #4592.
2018-07-02Spellcheck commentsAlexander Krotov1-1/+1
2018-04-25Added licensing headers for DocBook, EPUB, JATS, OPML readers.John MacFarlane1-1/+29
See #4592.
2018-04-19EPUB reader: fix images with space in file path.John MacFarlane1-2/+2
Closes #4344.
2018-03-29Removed unused extensions (#4506)Anabra1-3/+2
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane1-0/+2
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-03-16Monoid/Semiground cleanup relying on custom Prelude.John MacFarlane1-1/+0
2017-10-29Source code reformatting.John MacFarlane1-3/+3
2017-10-27hlint suggestions.John MacFarlane1-11/+11
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-2/+2
2017-06-10Changed all readers to take Text instead of String.John MacFarlane1-1/+3
Readers: Renamed StringReader -> TextReader. Updated tests. API change.
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-31/+29
2017-02-24EPUB reader: minor refactoring, avoiding explicit MediaBag handling.John MacFarlane1-8/+6
This all works behind the scenes in CommonState plumbing.
2017-02-11Use new warnings throughout the code base.John MacFarlane1-3/+1
2017-02-10Added Text.Pandoc.Logging (exported module).John MacFarlane1-1/+2
This now contains the Verbosity definition previously in Options, as well as a new LogMessage datatype that will eventually be used instead of raw strings for warnings. This will enable us, among other things, to provide machine-readable warnings if desired. See #3392.
2017-02-06Removed --parse-raw and readerParseRaw.John MacFarlane1-1/+2
These were confusing. Now we rely on the +raw_tex or +raw_html extension with latex or html input. Thus, instead of --parse-raw -f latex we use -f latex+raw_tex and instead of --parse-raw -f html we use -f html+raw_html
2017-01-25Removed readerVerbosity and writerVerbosity.John MacFarlane1-9/+4
API change. Also added a verbosity parameter to makePDF.
2017-01-25Changes to verbosity in writer and reader options.John MacFarlane1-2/+2
API changes: Text.Pandoc.Options: * Added Verbosity. * Added writerVerbosity. * Added readerVerbosity. * Removed writerVerbose. * Removed readerTrace. pandoc CLI: The `--trace` option sets verbosity to DEBUG; the `--quiet` option sets it to ERROR, and the `--verbose` option sets it to INFO. The default is WARNING.
2017-01-25Unify Errors.Jesse Rosenthal1-1/+2
2017-01-25Working on readers.Jesse Rosenthal1-26/+24
2016-10-24Export Text.Pandoc.Error in Text.Pandoc.John MacFarlane1-3/+2
[API change]
2016-10-22EPUB reader: don't add root path to data: URIs.John MacFarlane1-1/+3
Closes #3150. Thanks to @lep for the bug report and patch.
2016-09-02Remove Text.Pandoc.Compat.ExceptJesse Rosenthal1-1/+1
2016-09-02Fix grouping of imports.Jesse Rosenthal1-1/+1
Some source files keep imports in tidy groups. Changing `Text.Pandoc.Compat.Monoid` to `Data.Monoid` could upset that. This restores tidiness.
2016-09-02Remove Compat.MonoidJesse Rosenthal1-1/+1
This was only necessary for GHC versions with base below 4.5 (i.e., ghc < 7.4).
2016-05-24EPUB Reader: normalise Link id as wellmb211-2/+4
2016-05-17EPUB reader: unescape URIs in spine.John MacFarlane1-2/+4
This should fix #2924. Testing on the epub that caused the problem originally would be welcome.
2016-05-01Binary fmts throw PandocError on zip-archive failJesse Rosenthal1-2/+4
Commit 91dc3342 made `readDocx` throw PandocError if there was an unarchiving error. This extends that fix to `readOdt` and `readEPUB`.
2016-01-11Depend on deepseq rather than deepseq-generics.John MacFarlane1-1/+1
See fpco/stackage#1096.
2015-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane1-6/+6
mb21-new-image-attributes * Bumped version to 1.16. * Added Attr field to Link and Image. * Added `common_link_attributes` extension. * Updated readers for link attributes. * Updated writers for link attributes. * Updated tests * Updated stack.yaml to build against unreleased versions of pandoc-types and texmath. * Fixed various compiler warnings. Closes #261. TODO: * Relative (percentage) image widths in docx writer. * ODT/OpenDocument writer (untested, same issue about percentage widths). * Update pandoc-citeproc.
2015-11-09Restored Text.Pandoc.Compat.Monoid.John MacFarlane1-0/+1
Don't use custom prelude for latest ghc. This is a better approach to making 'stack ghci' and 'cabal repl' work. Instead of using NoImplicitPrelude, we only use the custom prelude for older ghc versions. The custom prelude presents a uniform API that matches the current base version's prelude. So, when developing (presumably with latest ghc), we don't use a custom prelude at all and hence have no trouble with ghci. The custom prelude no longer exports (<>): we now want to match the base 4.8 prelude behavior.
2015-11-09Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane1-1/+0
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
2015-11-08Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane1-0/+1
This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
2015-10-14Use custom Prelude to avoid compiler warnings.John MacFarlane1-2/+0
- The (non-exported) prelude is in prelude/Prelude.hs. - It exports Monoid and Applicative, like base 4.8 prelude, but works with older base versions. - It exports (<>) for mappend. - It hides 'catch' on older base versions. This allows us to remove many imports of Data.Monoid and Control.Applicative, and remove Text.Pandoc.Compat.Monoid. It should allow us to use -Wall again for ghc 7.10.
2015-08-10EPUB reader: stop mangling external URLs.John MacFarlane1-8/+1
Closes #2284. Note the changes to the test suite. In each case, a mangled external link has been fixed, so these are all positive.
2015-08-07Updated readers, writers and README for link attributemb211-6/+6
2015-08-07Updated readers and writers for new image attribute parameter.John MacFarlane1-2/+2
(mb21)
2015-02-18Change return type of EPUB readerMatthew Pickering1-17/+20
2014-08-17Update Reader.EPUB to use `MimeType`.Artyom Kazak1-8/+7
2014-08-11EPUB reader: use walk instead of bottomUp.John MacFarlane1-2/+1
This should be more efficient.
2014-08-11EPUB Reader: Fixed another normalisation problem..Matthew Pickering1-1/+1
2014-08-11EPUB Reader: Can now parse multiple meta data fieldsMatthew Pickering1-2/+2
2014-08-11EPUB reader: Fixed bug where filepaths weren't sufficiently normalisedMatthew Pickering1-4/+5
2014-08-10EPUB: Fixed another mediabag related regression..Matthew Pickering1-3/+5