summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/ODT.hs
Commit message (Collapse)AuthorAge
* ODT/OpenDocument writer: improved image attributesmb212015-12-13
| | | | | - support for percentage widths/heights - use Attr instead of title to get dimensions from ODT walker to writeOpenDocument
* Restore no wrapping of XML in Docx, ODT.John MacFarlane2015-12-12
| | | | | It's possible that wrapping causes problems; safer to turn it off.
* Implemented SoftBreak and new `--wrap` option.John MacFarlane2015-12-11
| | | | | | | | | | | | | | | | Added threefold wrapping option. * Command line option: deprecated `--no-wrap`, added `--wrap=[auto|none|preserve]` * Added WrapOption, exported from Text.Pandoc.Options * Changed type of writerWrapText in WriterOptions from Bool to WrapOption. * Modified Text.Pandoc.Shared functions for SoftBreak. * Supported SoftBreak in writers. * Updated tests. * Updated README. Closes #1701.
* Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane2015-11-19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Updated readers and writers for new image attribute parameter.John MacFarlane2015-08-07
| | | | | | | | (mb21)
* | Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane2015-11-09
| | | | | | | | This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
* | Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane2015-11-08
| | | | | | | | | | | | | | This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
* | Use custom Prelude to avoid compiler warnings.John MacFarlane2015-10-14
|/ | | | | | | | | | | | | - 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.
* Removed unneeded import.John MacFarlane2015-06-28
|
* Let reference.docx/odt behave as if they are virtual data files.John MacFarlane2015-06-28
| | | | | | | | | | | | | | | Now they are constructed on the fly from their components, but we now allow them to be printed with `--print-default-data-file` and to override the defaults if placed in the user data directory. Shared now exports getDefaultReferenceDocx and getDefaultReferenceODT (API change). These functions have been removed from the Docx and ODT writers. Shared.readDataFile has been modified so that requests to read a reference.odt or reference.docx will use these functions to generate the files.
* Better fix for #2187.John MacFarlane2015-05-28
| | | | | | | | | | | | | | | | | | | | | | * Reverted kludgy change to make-windows-installer.bat. * Removed make-reference-fiels.hs. * Moved the individual ingredients of reference.docx and reference.odt to the data directory. * Removed reference.docx and reference.odt from data directory. * We now build the reference archives from their ingredient pieces in the docx and odt writers, instead of having a reference.docx or reference.odt intermediary. This should fix #2187. It also simplifies the bulid procedure. The one thing users may notice is different is that you can no longer get the reference.docx or reference.odt using `--print-default-data-file`. Instead, simply generate a docx or odt using pandoc with a blank or minimal input, and use that (or a customized version) with `--reference-docx` or `--reference-odt`.
* Improved warnings when image size can't be determined.John MacFarlane2015-05-09
| | | | Closes #1834.
* ImageSize: make imageSize return an Either, not a Maybe.John MacFarlane2015-05-09
| | | | | This will give us better error reporting options. This is part of a fix for #1834.
* Updated copyright notices to -2015. Closes #2111.John MacFarlane2015-04-26
|
* ODT Writer: Figure captionsNikolay Yakimov2015-04-12
| | | | | | | | | | | | | | | Works pretty much the same as Word writer. Following styles are used for figures: Figure -- for figure with empty caption FigureWithCaption (based on Figure) -- for figure with caption FigureCaption (based on Caption) -- for figure captions Also, TableCaption (based on Caption) is used for table captions. We need FigureWithCaption to set keepWithNext, in order to keep caption with figure.
* ODT writer: Correctly handle images without extensions.John MacFarlane2014-10-30
| | | | Closes #1729.
* Strip querystring in ODT writeTodd Sifleet2014-10-28
| | | | | | * Resolve #1682 * Strip querystring from filename before rendering ODT files, ODT cannot handle querystrings in files.
* MIME cleanup.Artyom Kazak2014-08-17
| | | | | | | * Create a type synonym for MIME type (instead of `String`). * Add `getMimeTypeDef` function. * Avoid recreating MIME type `Map`s every time. * Move “Formula-...” case handling into `getMimeType`.
* Use texmath 0.7 interface.John MacFarlane2014-08-04
|
* PDF, Docx, EPUB, and ODT writers now automatically use MediaBag.John MacFarlane2014-07-30
| | | | | The MediaBag is thread through from the reader, with no need to extract to files.
* Update copyright notices for 2014, add missing noticesAlbert Krewinkel2014-05-09
|
* ODT writer: Use mathml for proper rendering of formulas.John MacFarlane2014-01-02
| | | | | Note: LibreOffice's support for this seems a bit buggy. But it should be better than what we had before.
* HLint: use fromMaybeHenry de Valence2013-12-19
| | | | Replace uses of `maybe x id` with `fromMaybe x`.
* ODT/OpenDocument writer: Minor changes for ODF 1.2 conformance.John MacFarlane2013-08-11
| | | | | See #939. We leave the nonconforming contextual-spacing attribute, which is provided by LibreOffice itself and seems to be supported.
* Options: Changed `writerSourceDir` to `writerSourceURL` (now a Maybe).John MacFarlane2013-08-11
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Use walk, walkM in place of bottomUp, bottomUpM when possible.John MacFarlane2013-08-10
| | | | They are significantly faster.
* Improved fetching of external resources.John MacFarlane2013-07-18
| | | | | | | | | * 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.
* Use new flexible metadata type.John MacFarlane2013-06-24
| | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Fixed regression in ODT writer.John MacFarlane2013-03-15
| | | | | | | This was due to a change in the Show instance for Text.Pandoc.Pretty.Doc, which led 1.11 to produce corrupt ODTs. Closes #780.
* Refactoring:John MacFarlane2013-01-11
| | | | | | | * 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
* ODT, Docx writers: Properly handle URL refs for images.John MacFarlane2013-01-11
| | | | | | These images are now downloaded instead of being ignored (as used to happen in the docx reader) or causing an error (as used to happen in the odt reader).
* Data files changes.John MacFarlane2012-12-29
| | | | | | | | | | * 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.
* Removed need for utf8-string package.John MacFarlane2012-09-25
| | | | | | | | * Depend on text. * Expose Text.Pandoc.UTF8. * Text.Pandoc.UTF8 now exports toString, fromString, toStringLazy, fromStringLazy. * These are used instead of the old utf8-string functions.
* Merge commit 'd25656571a4662a4e67b195daed69e77d80c4c2c'John MacFarlane2012-08-23
|\ | | | | | | | | Conflicts: src/Text/Pandoc/Writers/ODT.hs
| * Set ODT title propertyArlo O'Keeffe2012-07-13
| |
* | Moved WriterOptions and associated types Shared -> Options.John MacFarlane2012-07-26
| |
* | Use catch from Control.Exception to avoid warnings.John MacFarlane2012-07-24
| |
* | Changed signatures of writeODT, writeDocx, writeEPUB.John MacFarlane2012-07-24
|/ | | | | | | | | These now take WriterOptions and Pandoc only. The extra parameters for epub stylesheet, epub fonts, reference Docx, and reference ODT have been removed, since these things are now in WriterOptions. Note: breaking API change!
* Remove dependency on old-time.John MacFarlane2012-01-28
|
* ImageSize: extract dpi information from PNG and JPEG.John MacFarlane2012-01-15
| | | | | * ImageSize record now includes dpiX, dpiY, pxX, pxY. * New functions sizeInPixels and sizeInPoints.
* ODT writer now sizes images appropriately.John MacFarlane2012-01-14
| | | | | | | | | | | | | OpenDocument writer: a title like "123x467" is interpreted as size in *points*. ODT writer: while adding images to the archive, computes their sizes and inserts a title attribute with the size before calling opendocument writer. Size is computed as follows: size in points = size in pixels * 96 / 72
* Added unexported Text.Pandoc.MIME.John MacFarlane2011-07-19
| | | | | Moved getMimeType from Text.Pandoc.Shared to Text.Pandoc.MIME, so we won't have an API change.
* ODT writer: Construct META-INF/manifest.xml based on archive contents.John MacFarlane2011-07-17
| | | | | | This fixes a bug in ODTs containing images. LibreOffice would signal that these ODTs were corrupt, because the manifest.xml did not contain a reference to the image files.
* Un-URI-escape image filenames in LaTeX, ConTeXt, RTF, Texinfo.John MacFarlane2011-07-16
| | | | | | Also do this when copying image files into EPUBs and ODTs. Closes #263.
* Use functions from Text.Pandoc.Generic instead of processWith(M).John MacFarlane2010-12-24
|
* ODT writer: Don't wrap text in opendocument.John MacFarlane2010-12-22
|
* Added writerUserDataDir to WriterOptions.John MacFarlane2010-07-08
|
* Added writerSourceDirectory to WriterOptions.John MacFarlane2010-07-08
| | | | | This allows us to remove an argument from the ODT and EPUB writers.
* Made a proper ODT writer.John MacFarlane2010-07-05
+ Transformed the old Text.Pandoc.ODT module into a proper writer module, Text.Pandoc.Writers.ODT. + Instead of saveOpenDocumentAsODT, we now have writeODT, which takes a Pandoc document and produces a bytestring. saveOpenDocumentAsODT has been removed. + To extract the images and insert them into the ODT, we now use processPandocM on the Pandoc document rather than a custom XML parser. + Handle the case where the image is remote (or not found) by converting the Image element into an Emph with the label. + Plumbing in pandoc.hs changed slightly to accomodate this, and to allow other writers that live in the IO monad.