aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/EPUB.hs
AgeCommit message (Collapse)AuthorFilesLines
2014-08-04Clean up `mediaTypeOf` a bit.Artyom Kazak1-6/+6
2014-08-02Text.Pandoc.SelfContained changes.John MacFarlane1-2/+1
* mkSelfContained now takes just two arguments, WriterOptions and the string. * It no longer looks in data files. This only made sense when we had copies of slidy and S5 code there. * Shared.fetchItem' is used instead of the nearly duplicate getItem.
2014-07-31New module, Text.Pandoc.MediaBag.John MacFarlane1-1/+2
Moved `MediaBag` definition and functions from Shared: `lookupMedia`, `mediaDirectory`, `insertMedia`, `extractMediaBag`. Removed `emptyMediaBag`; use `mempty` instead, since `MediaBag` is a Monoid.
2014-07-31Made MediaBag a newtype, and added mime type information to media.John MacFarlane1-1/+1
Shared now exports functions for interacting with a MediaBag: - `emptyMediaBag` - `lookuMedia` - `insertMedia` - `mediaDirectory` - `extractMediaBag`
2014-07-30Allow --self-contained to get content from MediaBag.John MacFarlane1-1/+1
Added a parameter to makeSelfContained (API change).
2014-07-30PDF, Docx, EPUB, and ODT writers now automatically use MediaBag.John MacFarlane1-1/+2
The MediaBag is thread through from the reader, with no need to extract to files.
2014-07-20EPUB writer: Avoid excess whitespace in nav.xhtml.John MacFarlane1-1/+1
This should improve TOC view in iBooks. Closes #1392.
2014-07-15EPUB writer: Keep newlines between block elements.John MacFarlane1-1/+1
This allows easier diff-ability. Closes #1424.
2014-07-13EPUB writer: Use stringify instead of custom plainify.John MacFarlane1-16/+10
As far as I can tell, it does about the same thing.
2014-07-13Use renderTags' for all tag rendering.John MacFarlane1-2/+2
This properly handles tags that should be self-closing. Previously `<hr/>` would appear in EPUB output as `<hr></hr>`. Closes #1420.
2014-07-07EPUB writer: better handle HTML media tags.John MacFarlane1-1/+6
2014-05-19EPUB writer: Handle multiple dates with OPF `event` attributes.John MacFarlane1-9/+38
Note: in EPUB3 we can have only one dc:date, so only the first one is used.
2014-05-19Avoid `import Prelude hiding (catch)`.John MacFarlane1-7/+3
See #1309.
2014-05-15EPUB writer: Fixed regression on cover image.John MacFarlane1-5/+5
In 1.12.4 and 1.12.4.2, the cover image would not appear properly, because the metadata id was not correct. This was introduced by the fix to #1254. Now we derive the id from the actual cover image filename, which we preserve rather than using "cover-image."
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel1-2/+2
2014-04-24EPUB writer: Fixed some idrefs to match changes in ids.John MacFarlane1-3/+3
2014-04-23EPUB writer: include extension in epub ids.John MacFarlane1-6/+11
This fixes a problem with duplicate extensions for fonts and images with the same base name but different extensions. Closes #1254.
2014-03-14EPUB writer: Handle files linked in raw img tags.John MacFarlane1-1/+1
See #1170.
2014-03-14EPUB writer: Handle media in audio source tags.John MacFarlane1-27/+28
This should resolve the rest of #1170, but it needs extensive testing. Note that we now use a 'media' directory rather than 'images'.
2014-03-14EPUB writer: Incorporate files linked in <video> tags.John MacFarlane1-10/+46
src and poster will both be incorporated into content.opf and the epub container. This partially address #1170. Still need to do something similar for <audio>.
2014-01-06EPUB writer: Strip out footnotes from toc entries.John MacFarlane1-5/+6
2014-01-06EPUB writer: Avoid duplicate notes when headings contain notes.John MacFarlane1-1/+7
This arose because the headings are copied into the metadata "title" field, and the note gets rendered twice. We strip the note now before putting the heading in "title".
2013-12-19HLint: use fromMaybeHenry de Valence1-6/+6
Replace uses of `maybe x id` with `fromMaybe x`.
2013-12-13EPUB writer: Fixed bug with `--epub-stylesheet`.John MacFarlane1-2/+1
Now the contents of `writerEpubStylesheet` (set by `--epub-stylesheet`) should again work, and take precedence over a stylesheet specified in the metadata.
2013-12-03EPUB writer: Allow 'stylesheet' in metadata.John MacFarlane1-11/+22
The value is a path to the stylesheet.
2013-12-01EPUB writer: Allow partial dates: YYYY, YYYY-MM.John MacFarlane1-3/+14
Improves on #1074, since now we don't default to January 1.
2013-11-30EPUB writer: Insert "svg" property as needed in opf (EPUB 3).John MacFarlane1-3/+9
2013-11-30EPUB writer: Simplify imageTypeOf using getMimeType.John MacFarlane1-9/+3
2013-11-30EPUB writer: Add properties attribute to cover-image item for EPUB v3.John MacFarlane1-1/+6
2013-11-30Fixed `cover-image` in EPUB YAML metadata.John MacFarlane1-1/+2
2013-11-30Allow specification of epub-cover-image in YAML metadata.John MacFarlane1-9/+8
2013-11-30EPUB writer: Improved metadata handling.John MacFarlane1-51/+591
* Metadata may now be included in YAML blocks in a markdown document. For example, --- title: - type: main text: My Book - type: subtitle text: An investigation of metadata creator: - role: author text: John Smith - role: editor text: Sarah Jones identifier: - scheme: DOI text: doi:10.234234.234/33 publisher: My Press rights: (c) 2007 John Smith, CC BY-NC ... * Metadata may still be provided using `--epub-metadata`; it will be merged with the metadata in YAML blocks. * meta tags are used instead of opf attributes for EPUB3.
2013-11-22EPUB writer: Don't include node for cover.xhtml if no cover!John MacFarlane1-2/+3
2013-11-22EPUB writer: Ensure that same identifier is used throughout.John MacFarlane1-9/+13
If dc:identifier is given in metadata, we use that; otherwise we use a random uuid. Closes #1044.
2013-11-19Epub Writer: Add cover reference to guide element (v2)Shaun Attfield (shaun@victor)1-4/+5
Avoiding an unnecessary list concatenation. Fixes an issue with calibre http://calibre-ebook.com/ putting the cover at the end of the book if the spine has linear="no". Apparently this is best practice for other converters as well. http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.6
2013-11-18Epub Writer: Add cover reference to guide elementShaun Attfield (shaun@victor)1-2/+4
Fixes an issue with calibre http://calibre-ebook.com/ putting the cover at the end of the book if the spine has linear="no". Apparently this is best practice for other converters as well. http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.6
2013-08-11Options: Changed `writerSourceDir` to `writerSourceURL` (now a Maybe).John MacFarlane1-14/+7
Previously we used to store the directory of the first input file, even if it was local, and used this as a base directory for finding images in ODT, EPUB, Docx, and PDF. This has been confusing to many users. It seems better to look for images relative to the current working directory, even if the first file argument is in another directory. writerSourceURL is set to 'Just url' when the first command-line argument is an absolute URL. (So, relative links will be resolved in relation to the first page.) Otherwise, 'Nothing'. The ODT, EPUB, Docx, and PDF writers have been modified accordingly. Note that this change may break some existing workflows. If you have been assuming that relative links will be interpreted relative to the directory of the first file argument, you'll need to make that the current directory before running pandoc. Closes #942.
2013-08-10Use walk, walkM in place of bottomUp, bottomUpM when possible.John MacFarlane1-3/+3
They are significantly faster.
2013-08-10Adjustments for new Format newtype.John MacFarlane1-3/+3
2013-08-04Remove CPP from default-extensions; add pragmas to modules as needed.John MacFarlane1-5/+1
2013-07-18Fixed warning.John MacFarlane1-1/+1
2013-07-18Improved fetching of external resources.John MacFarlane1-4/+9
* In Shared, openURL and fetchItem now return an Either, for better error handling. (API change.) * Better error message when fetching a URL fails with `--self-contained`. * EPUB writer: If resource not found, skip it, as in Docx writer. * Closes #916.
2013-06-24Use new flexible metadata type.John MacFarlane1-6/+9
* Depend on pandoc 1.12. * Added yaml dependency. * `Text.Pandoc.XML`: Removed `stripTags`. (API change.) * `Text.Pandoc.Shared`: Added `metaToJSON`. This will be used in writers to create a JSON object for use in the templates from the pandoc metadata. * Revised readers and writers to use the new Meta type. * `Text.Pandoc.Options`: Added `Ext_yaml_title_block`. * Markdown reader: Added support for YAML metadata block. Note that it must come at the beginning of the document. * `Text.Pandoc.Parsing.ParserState`: Replace `stateTitle`, `stateAuthors`, `stateDate` with `stateMeta`. * RST reader: Improved metadata. Treat initial field list as metadata when standalone specified. Previously ALL fields "title", "author", "date" in field lists were treated as metadata, even if not at the beginning. Use `subtitle` metadata field for subtitle. * `Text.Pandoc.Templates`: Export `renderTemplate'` that takes a string instead of a compiled template.. * OPML template: Use 'for' loop for authors. * Org template: '#+TITLE:' is inserted before the title. Previously the writer did this.
2013-05-29Added CPP directives to avoid warnings.John MacFarlane1-0/+3
For 'import Prelude hiding (catch)'. catch is no longer in Prelude starting with base 4.6.
2013-05-22EPUB writer: math with `--webtex` is automatically made self-contained.John MacFarlane1-17/+16
And some code cleanup.
2013-05-22EPUB writer: Download webtex images and include as data URLs.John MacFarlane1-25/+32
This allows you to use `--webtex` in creating EPUBs.
2013-03-24EPUB writer: Don't put blank title page in reading sequence.John MacFarlane1-1/+4
Set linear="no" if no title block. Addresses #797.
2013-03-24EPUB writer: Add `id="toc-title"` to h1 in nav.xhtml.John MacFarlane1-1/+1
Closes #799.
2013-03-20EPUB writer: Don't add dc:creator tags if present in epub metadata.John MacFarlane1-1/+1
2013-03-03EPUB writer: Include html TOC even in epub2.John MacFarlane1-15/+23
* The TOC is included in `<spine>`, but `linear` is set to `no` unless the `--toc` option is specified. * Include `<guide>` element in OPF. * This should allow the TOC to be useable in Kindles when converted with kindlegen. * Results validate with epubcheck 3.0 for both epub and epub3 output. * Closes #773.