aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/EPUB.hs
AgeCommit message (Collapse)AuthorFilesLines
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.
2013-02-23EPUB writer: Improved behavior with `--number-sections`.John MacFarlane1-7/+24
* Headers with "unnumbered" attribute are not numbered. (Nor do they cause an increment in running numbering.) * Section numbers now work properly, even when there is material before the first numbered section.
2013-02-23EPUB writer: more transition.John MacFarlane1-6/+10
Changed toChunks to toChapters.
2013-02-23EPUB writer: Temporary step towards a better system for numbering.John MacFarlane1-5/+8
With this change, `--number-sections` won't work. This will be fixed later.
2013-02-23`--number-from` -> `--number-offset`John MacFarlane1-1/+1
Also `writerNumberFrom` -> `writeNumberOffset`. The offset is a list of numbers (0 by default). These are added to the section, subsection, etc. numbers that would have been generated automatically.
2013-02-22EPUB writer: Minor section numbering tweaks.John MacFarlane1-2/+3
* If we need to add an initial section, make it unnumbered. * Don't add extra space before unnumbered section titles in TOC.
2013-02-22EPUB writer: Use writerNumberFrom instead of ugly hack.John MacFarlane1-8/+1
2013-02-16EPUB writer: Fix section numbering.John MacFarlane1-1/+8
Previously the numbering restarted from 1 in each chapter (with `--number-sections`), though the numbers in the table of contents were correct. Note that this fix is a bit hackish and possibly fragile: if the rendering of section numbers in HTML changes in the future, it may break. But it works, without needing changes in other modules.
2013-02-12Shared: Changed type of Element.John MacFarlane1-1/+1
Sec now includes a field for Attr rather than just String (the identifier). Note, this is an API change.
2013-01-22Another fix to the CPP macro in EPUB writer.John MacFarlane1-1/+1
2013-01-22Fixed MIN_VERSION - need to sub _ for - in blaze-html.John MacFarlane1-1/+1
2013-01-22EPUB: condition Blaze Utf8 module name import on blaze-html versionJens Petersen1-0/+4
blaze-html/blaze-markup-0.5 has Text.Blaze.Html.Renderer.Utf8 whereas blaze-html-0.4 has Text.Blaze.Renderer.Utf8. So this needs to be conditional on the version for pandoc still be with blaze-html-0.4.x
2013-01-16Fixed problem with duplicate ids in epub.John MacFarlane1-12/+4
2013-01-11Revised EPUB writer given changes in header attributes.John MacFarlane1-7/+18
We need to ensure that all headers have attributes, since this is no longer guaranteed by hierarchicalize. Explicitly given headers remain the same.
2013-01-11EPUB writer: Download images at URLs.John MacFarlane1-3/+3
2013-01-11Refactoring:John MacFarlane1-0/+1
* Shared now exports fetchItem (instead of getItem) and openURL * fetchItem has different parameters than getItem and includes some logic formerly in the ODT and Docx writers * getItem still used in SelfContained
2013-01-09Added Attr field to Header.John MacFarlane1-7/+6
Previously header ids were autogenerated by the writers. Now they are generated (unless supplied explicitly) in the markdown parser, if the `header_identifiers` extension is selected. In addition, the textile reader now supports id attributes on headers.
2013-01-05EPUB changes.John MacFarlane1-12/+4
* Epub writer now exports writeEPUB, not writeEPUB2 and writeEPUB3. * Options now exports EPUBVersion * WriterOptions now includes writerEpubVersion.
2013-01-05Changed --toc-level to --toc-depth.John MacFarlane1-1/+1
2013-01-05Changed `--epub-toc-level` to `--toc-level`.John MacFarlane1-1/+1
Also writerEpubTOCLevel -> writerTOCLevel. So far this is only implemented in the EPUB writer.
2013-01-04Renamed writerEPUBMetadata -> writerEpubMetadata.John MacFarlane1-1/+1
API change for consistency.
2013-01-04Added `--epub-chapter-level` and `--epub-toc-level` options.John MacFarlane1-11/+13
Also added writerEpubChapterLevel and writerEpubTOCLevel fields to WriterOptions.
2013-01-04EPUB writer: Parameterize header level for splitting chapters.John MacFarlane1-8/+14
2012-12-29Data files changes.John MacFarlane1-3/+4
* Added `embed_data_files` flag. (not yet used) * Shared no longer exports `findDataFile`. * `readDataFile` now returns a strict bytestring. * Shared now exports `readDataFileUTF8` which returns a string like the old `readDataFile`. * Rewrote modules to use new data file functions and to avoid using functions from Paths_pandoc directly.
2012-12-19EPUB3: Don't use the switch statement for mathml.John MacFarlane1-10/+5
It is not widely implemented yet.
2012-11-04EPUB writer: Rationalized templates.John MacFarlane1-8/+3
* Previously there were three different templates involved in epub production. There is now just one template, default.epub or default.epub3. * It can now be overridden using `--template`, just like other templates.
2012-11-04EPUB: removed need for separate epub-titlepage template.John MacFarlane1-8/+3
The titlepage stuff is now folded into the epub-page template. A titlepage variable selects it.
2012-11-04EPUB writer: Removed need for separate epub-coverpage template.John MacFarlane1-11/+5
The standard epub-page template is now used.
2012-11-04EPUB writer: Improved handling of CSS.John MacFarlane1-2/+6
* Code highlighting now works by default. * Quote styles work as in pandoc's HTML writer.
2012-11-04EPUB writer: Set epub3 variable before calling templates.John MacFarlane1-1/+2
2012-11-04EPUB writer: Better TOC and footnote handling.John MacFarlane1-20/+29
* Here we go back to splitting the document at the Pandoc AST level, and converting each chapter to HTML separately. * Fixes bug in footnote processing introduced by commit 01d109e2efb880d9d2b8256d2e19ed4954076754. The bug caused all footnotes to appear in the last chapter, so that footnote links from other chapters would not work. Closes #651. * We also disable writerTableOfContents, since TOC is automatic for epub.
2012-11-04EPUB: Use section divs by default for better semantic markup.John MacFarlane1-0/+1
2012-11-04Improved support for MathML in EPUB3.John MacFarlane1-16/+26
* MathML math method now used always in EPUB3 (even if another math method specified in options). * epub:switch is used to specify a non-MathML default. This is supposed to proide a good fallback behavior in older readers, though I'm not sure how well it works in practice.
2012-11-02EPUB: Don't use opf:role in EPUB3.John MacFarlane1-1/+2
2012-11-02EPUB: Fixed invalid nesting problem in nav.xhtml.John MacFarlane1-3/+3
2012-11-02EPUB: Added properties attribute.John MacFarlane1-1/+3
2012-11-02EPUB: Use HTML5 for epub3.John MacFarlane1-1/+4
2012-11-02EPUB: Set epub3 template variable controlling doctype.John MacFarlane1-3/+5