summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/ODT.hs
Commit message (Collapse)AuthorAge
* improve formatting of formulas in OpenDocumentoltolm2017-12-28
|
* hlintAlexander Krotov2017-11-01
|
* hlint suggestions.John MacFarlane2017-10-29
|
* Automatic reformating by stylish-haskell.John MacFarlane2017-10-27
|
* Removed writerSourceURL, add source URL to common state.John MacFarlane2017-09-30
| | | | | | | | | | | | | | | | | | Removed `writerSourceURL` from `WriterOptions` (API change). Added `stSourceURL` to `CommonState`. It is set automatically by `setInputFiles`. Text.Pandoc.Class now exports `setInputFiles`, `setOutputFile`. The type of `getInputFiles` has changed; it now returns `[FilePath]` instead of `Maybe [FilePath]`. Functions in Class that formerly took the source URL as a parameter now have one fewer parameter (`fetchItem`, `downloadOrRead`, `setMediaResource`, `fillMediaBag`). Removed `WriterOptions` parameter from `makeSelfContained` in `SelfContained`.
* Added support for translations (localization) (see #3559).John MacFarlane2017-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | * readDataFile, readDefaultDataFile, getReferenceDocx, getReferenceODT have been removed from Shared and moved into Class. They are now defined in terms of PandocMonad primitives, rather than being primitve methods of the class. * toLang has been moved from BCP47 to Class. * NoTranslation and CouldNotLoudTranslations have been added to LogMessage. * New module, Text.Pandoc.Translations, exporting Term, Translations, readTranslations. * New functions in Class: translateTerm, setTranslations. Note that nothing is loaded from data files until translateTerm is used; setTranslation just sets the language to be used. * Added two translation data files in data/translations. * LaTeX reader: Support `\setmainlanguage` or `\setdefaultlanguage` (polyglossia) and `\figurename`.
* Removed datadir param from readDataFile and getDefaultTemplate.John MacFarlane2017-08-10
| | | | | In Text.Pandoc.Class and Text.Pandoc.Template, resp. We now get the datadir from CommonState.
* BCP47: split toLang from getLang, rearranged types.John MacFarlane2017-06-25
|
* Moved BCP47 specific functions from Writers.Shared to new module.John MacFarlane2017-06-25
| | | | | Text.Pandoc.BCP47 (unexported, internal module). `getLang`, `Lang(..)`, `parseBCP47`.
* Writers.Shared: improve type of Lang and bcp47 parser.John MacFarlane2017-06-25
| | | | Use a real parsec parser for BCP47, include variants.
* Writers.Shared: refactored getLang, splitLang...John MacFarlane2017-06-25
| | | | into `Lang(..)`, `getLang`, `parceBCP47`.
* Support `lang` attribute in OpenDocument and ODT writers.John MacFarlane2017-06-25
| | | | | | | | | | This adds the required attributes to the temporary styles, and also replaces existing language attributes in styles.xml. Support for lang attributes on Div and Span has also been added. Closes #1667.
* Use Control.Monad.State.Strict throughout.John MacFarlane2017-06-17
| | | | | This gives 20-30% speedup and reduction of memory usage in most of the writers.
* Switched Writer types to use Text.John MacFarlane2017-06-11
| | | | | | | | | | | * XML.toEntities: changed type to Text -> Text. * Shared.tabFilter -- fixed so it strips out CRs as before. * Modified writers to take Text. * Updated tests, benchmarks, trypandoc. [API change] Closes #3731.
* Update dates in copyright noticesAlbert Krewinkel2017-05-13
| | | | | This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
* Added PandocResourceNotFound error.John MacFarlane2017-05-02
| | | | | | | Use this instead of PandocIOError when a resource is not found in path. This improves the error message in this case, see #3629.
* Stylish-haskell automatic formatting changes.John MacFarlane2017-03-04
|
* ODT writer: calculate aspect ratio for percentage-sized images (#3478)Mauro Bieg2017-03-01
| | | closes #3239
* Use catchError instead of runExceptT.John MacFarlane2017-02-24
|
* imageSize interface changemb212017-02-22
| | | | `imageSize img` is now `imageSize opts img`
* Use new warnings throughout the code base.John MacFarlane2017-02-11
|
* Text.Pandoc.Shared: Removed fetchItem, fetchItem'.John MacFarlane2017-01-25
| | | | | Made changes where these are used, so that the version of fetchItem from PandocMonad can be used instead.
* Class: Removed getDefaultReferenceDocx/ODT from PandocMonad.John MacFarlane2017-01-25
| | | | | We don't need these, since the default docx and odt can be retrieved using `readDataFile datadir "reference.docx"` (or odt).
* Simplified reference-docx/reference-odt to reference-doc.John MacFarlane2017-01-25
| | | | | | | | | | | | * Text.Pandoc.Options.WriterOptions: removed writerReferenceDocx and writerReferenceODT, replaced them with writerReferenceDoc. This can hold either an ODT or a Docx. In this way, writerReferenceDoc is like writerTemplate, which can hold templates of different formats. [API change] * Removed `--reference-docx` and `--reference-odt` options. * Added `--reference-doc` option.
* Class: rename addWarning[WithPos] to warning[WithPos].John MacFarlane2017-01-25
| | | | | | | There's already a function addWarning in Parsing! Maybe we can dispense with that now, but I still like 'warning' better as a name.
* Class: Renamed 'warn' to 'addWarning' and consolidated RTF writer.John MacFarlane2017-01-25
| | | | | | | | * Renaming Text.Pandoc.Class.warn to addWarning avoids conflict with Text.Pandoc.Shared.warn. * Removed writeRTFWithEmbeddedImages from Text.Pandoc.Writers.RTF. This is no longer needed; we automatically handle embedded images using the PandocM functions. [API change]
* Convert all writers to use PandocMonad.Jesse Rosenthal2017-01-25
| | | | | | | | | | | | | | | Since PandocMonad is an instance of MonadError, this will allow us, in a future commit, to change all invocations of `error` to `throwError`, which will be preferable for the pure versions. At the moment, we're disabling the lua custom writers (this is temporary). This requires changing the type of the Writer in Text.Pandoc. Right now, we run `runIOorExplode` in pandoc.hs, to make the conversion easier. We can switch it to the safer `runIO` in the future. Note that this required a change to Text.Pandoc.PDF as well. Since running an external program is necessarily IO, we can be clearer about using PandocIO.
* Convert writers to use PandocMonad typeclass.Jesse Rosenthal2017-01-25
| | | | Instead of Free Monad with runIO
* ODT Writer: fix compiler complaint.Jesse Rosenthal2017-01-25
|
* Implement runTest functions.Jesse Rosenthal2017-01-25
| | | | | These work with a State monad and a Reader monad to produce deterministic results. It can probably be simplified somewhat.
* Remove IORef from ODT writer.Jesse Rosenthal2017-01-25
| | | | | | | We want pure writers, so IORef shouldn't be in there. We switch to using a normal State Monad. If this produces performance problems, we can look into trying STRefs, but that seems like unnecessary complication at the moment.
* Introduce pure versions of IO Writers.Jesse Rosenthal2017-01-25
| | | | | | | Using Text.Pandoc.Free, introduce pure versions of Docx, EPUB, ICML, and ODT writers. Each of the pure versions is exported along with the IO version (produced by running `runIO` on the pure reader). Ideally, this should make the writers easier to test.
* 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`.