aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/ICML.hs
AgeCommit message (Collapse)AuthorFilesLines
2017-06-20Writers: adjusted for renderTemplate' changes.John MacFarlane1-3/+3
Now we raise a proper error on template failure.
2017-06-17Use Control.Monad.State.Strict throughout.John MacFarlane1-1/+1
This gives 20-30% speedup and reduction of memory usage in most of the writers.
2017-06-11Switched Writer types to use Text.John MacFarlane1-1/+3
* 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.
2017-05-23Shared: Provide custom isURI that rejects unknown schemes [isURI]Albert Krewinkel1-2/+1
We also export the set of known `schemes`. The new function replaces the function of the same name from `Network.URI`, as the latter did not check whether a scheme is well-known. E.g. MediaWiki wikis frequently feature pages with names like `User:John`. These links were interpreted as URIs, thus turning internal links into global links. This is prevented by also checking whether the scheme of a URI is frequently used (i.e. is IANA registered or an otherwise well-known scheme). Fixes: #2713 Update set of well-known URIs from IANA list All official IANA schemes (as of 2017-05-22) are included in the set of known schemes. The four non-official schemes doi, isbn, javascript, and pmid are kept.
2017-05-13Update dates in copyright noticesAlbert Krewinkel1-1/+1
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-05-02Added PandocResourceNotFound error.John MacFarlane1-5/+1
Use this instead of PandocIOError when a resource is not found in path. This improves the error message in this case, see #3629.
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-23/+25
2017-02-24Use catchError instead of runExceptT.John MacFarlane1-9/+11
2017-02-22imageSize interface changemb211-1/+1
`imageSize img` is now `imageSize opts img`
2017-02-17Added warnings for non-rendered blocks to some writers.John MacFarlane1-4/+8
2017-02-11Use new warnings throughout the code base.John MacFarlane1-4/+4
2017-01-25Revert "Added page breaks into Pandoc."John MacFarlane1-1/+0
This reverts commit f02a12aff638fa2339192231b8f601bffdfe3e14.
2017-01-25Text.Pandoc.Shared: Removed fetchItem, fetchItem'.John MacFarlane1-3/+5
Made changes where these are used, so that the version of fetchItem from PandocMonad can be used instead.
2017-01-25Class: rename addWarning[WithPos] to warning[WithPos].John MacFarlane1-2/+2
There's already a function addWarning in Parsing! Maybe we can dispense with that now, but I still like 'warning' better as a name.
2017-01-25Class: Renamed 'warn' to 'addWarning' and consolidated RTF writer.John MacFarlane1-2/+2
* 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]
2017-01-25Refactored math conversion in writers.John MacFarlane1-2/+3
* Remove exported module `Text.Pandoc.Readers.TeXMath` * Add exported module `Text.Pandoc.Writers.Math` * The function `texMathToInlines` now lives in `Text.Pandoc.Writers.Math` * Export helper function `convertMath` from `Text.Pandoc.Writers.Math` * Use these functions in all writers that do math conversion. This ensures that warnings will always be issued for failed math conversions.
2017-01-25Fixes to compile after rebase.John MacFarlane1-2/+2
2017-01-25Convert writers to use PandocMonad typeclass.Jesse Rosenthal1-20/+16
Instead of Free Monad with runIO
2017-01-25Implement runTest functions.Jesse Rosenthal1-5/+3
These work with a State monad and a Reader monad to produce deterministic results. It can probably be simplified somewhat.
2017-01-25Introduce pure versions of IO Writers.Jesse Rosenthal1-6/+13
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.
2017-01-25Adds support for pagebreaks (when it makes sense)Hubert Plociniczak1-0/+1
Update all writers to take into account page breaks. A straightforwad, far from complete, implementation of page breaks in selected writers. Readers will have to follow in the future as well.
2016-11-30Options: Removed writerStandalone, made writerTemplate a Maybe.John MacFarlane1-3/+3
Previously setting writerStandalone = True did nothing unless a template was provided in writerTemplate. Now a fragment will be generated if writerTemplate is Nothing; otherwise, the specified template will be used and standalone output generated. [API change]
2016-11-22Put 'warn' in MonadIO. Add warnings for math conversions in docx.John MacFarlane1-2/+2
2016-10-23ICML writer: replace partial function (!!) in table handling (#3175)Mauro Bieg1-5/+5
2016-10-13Add support for the LineBlock element to writersAlbert Krewinkel1-2/+4
The following markup features are used to output the lines of the `LineBlock` element: - AsciiDoc: a `[verse]` block, - ConTeXt: text surrounded by `\startlines` and `\endlines`, - HTML: `div` with an per-element style setting to interpret the content as pre-wrapped, - Markdown: line blocks if the `line_blocks` extension is enabled, a simple paragraph with hard linebreaks otherwise, - Org: VERSE block, - RST: a line block, and - all other formats: a paragraph, containing hard linebreaks between lines. Custom lua writers should be updated to use the `LineBlock` element.
2015-12-17ICML writer: intersperse line breaksmb211-12/+17
instead of appending them to every ParagraphStyleRange closes #2501
2015-12-16ICML writer: added figure handling, closes #2590mb211-3/+12
2015-12-13ICML writer: removed redundant import.John MacFarlane1-1/+0
2015-12-13Fixed ICML image syntax for local files.John MacFarlane1-1/+1
`file:filename` rather than `file://./filename`. I think this is right; it matches what we had before with people actually using the ICML writer, and seems to match examples in the spec. I don't have a copy of InDesign I can test on, though. @DigitalPublishingToolkit and @mb21, can you have a look?
2015-12-13Use posix path separators in ICML link URIs.John MacFarlane1-1/+1
Closes #2589.
2015-12-11Implemented SoftBreak and new `--wrap` option.John MacFarlane1-4/+15
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.
2015-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane1-41/+54
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-16ICML writer: better handling of math.John MacFarlane1-1/+3
Instead of just printing the raw tex, we now try to fake it with unicode characters.
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-1/+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-07Updated readers, writers and README for link attributemb211-1/+1
2015-08-05ICML writer: changed type of `writeICML`.John MacFarlane1-39/+50
API change: It is now `WriterOptions -> Pandoc -> IO String`. Also handle new image attributes. (mb21)
2015-08-05ICML writer: Add Cite style to citations.John MacFarlane1-1/+3
(mb21)
2015-06-09Fix InDesign crash with URLs containing more than one colon charactergohai1-2/+9
Colons are valid characters in URLs, and used e.g. by the Internet Archive's Wayback Machine - a popular resource amongst researchers. When InDesign encounters a HyperlinkURLDestination with more than one colon character in it, it crashes when placing the ICML. (This was tested against CS6.) The IDML specification hints at this requirement in section 6.4.1: "The colon apppears in the Name attribute of the style, but is encoded as %3a when it appears in the Self attribute". Follow this example for all colon characters in URLs.
2015-05-11Fix image URIs in ICML output (v2)gohai1-1/+3
InDesign expects LinkResourceURI to start with "file:" for local filenames, and won't render/link the image without.
2015-02-17ICML writer: Better handling of raw blocks and inlines.John MacFarlane1-4/+6
Previously these were always escaped and printed verbatim. Now they are ignored unless the format is "icml", in which case they are passed through unescaped. Closes #1951.
2015-01-05ghc 7.10.1 RC1 requires FlexibleContexts ↵Mark Wright1-1/+1
https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#Inferredtype-signaturesnowmayrequiretoenableFlexibleContextsGADTsorTypeFamilies
2014-11-30ICML writer: Don't force all citations into footnotes.John MacFarlane1-1/+1
2014-07-12Removed space at ends of lines in source.John MacFarlane1-4/+4
2014-02-28InDesign ICML Writermb211-0/+525