aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2017-02-01Reduce state in Org writer (#3404)Alexander Krotov1-8/+3
2017-01-30`--mathml` and MathML in HTMLMathMethod longer take an argument.John MacFarlane4-13/+9
The argument was for a bridge javascript that used to be necessary in 2004. We have removed the script already.
2017-01-28LaTeX writer: export writeBeamer.John MacFarlane1-25/+50
Removed writerBeamer from WriterOptions.
2017-01-27HTML: export separate functions for slide formats.John MacFarlane1-53/+111
writeS5, writeSlideous, writeRevealJs, writeDZSlides, writeSlidy. Removed writerSlideVariant from WriterOptions.
2017-01-27HTML writer: export writeHtmlStringForEPUB.John MacFarlane2-26/+42
Options: Remove writerEPUBVersion.
2017-01-26Split writeDocbook into writeDocbook4, writeDocbook5.John MacFarlane1-22/+40
Removed writerDocbookVersion in WriterOptions. Renamed default.docbook template to default.docbook4. Allow docbook4 as an output format. But alias docbook = docbook4.
2017-01-26EPUB writer: split writeEPUB into writeEPUB2, writeEPUB3.John MacFarlane1-7/+24
Also include explicit epub2 output format in CLI tool.
2017-01-25Provide explicit separate functions for HTML 4 and 5.John MacFarlane5-56/+88
* Text.Pandoc.Writers.HTML: removed writeHtml, writeHtmlString, added writeHtml4, writeHtml4String, writeHtml5, writeHtml5String. * Removed writerHtml5 from WriterOptions. * Renamed default.html template to default.html4. * "html" now aliases to "html5"; to get the old HTML4 behavior, you must now specify "-t html4".
2017-01-25Cleanups for rebase.John MacFarlane1-2/+2
2017-01-25Removed writerHighlight; made writerHighlightStyle a Maybe.John MacFarlane3-35/+32
API change. For no highlighting, set writerHighlightStyle to Nothing.
2017-01-25Revert "Added page breaks into Pandoc."John MacFarlane23-53/+3
This reverts commit f02a12aff638fa2339192231b8f601bffdfe3e14.
2017-01-25Fixed shadowing warnings.John MacFarlane1-3/+3
2017-01-25Removed writerIgnoreNotes.John MacFarlane3-15/+9
Instead, just temporarily remove notes when generating TOC lists in HTML and Markdown (as we already did in LaTeX). Also export deNote from Text.Pandoc.Shared. API change in Shared and Options.WriterOptions.
2017-01-25Removed writerTeXLigatures.John MacFarlane2-4/+4
Make `smart` extension work in LaTeX/ConTeXt writers instead. Instead of `-t latex --no-tex-ligatures`, do `-t latex-smart`.
2017-01-25Make the `smart` extension affect the Markdown writer.John MacFarlane1-6/+29
Thus, to "unsmartify" something that has been parsed as smart by pandoc, you can use `-t markdown+smart`, and straight quotes will be produced instead of curly quotes, etc. Example: % pandoc -f latex -t markdown+smart ``hi''---ok ^D "hi"---ok
2017-01-25Fixed something small that broke in rebase.John MacFarlane1-1/+1
2017-01-25Text.Pandoc.Shared: Removed fetchItem, fetchItem'.John MacFarlane6-36/+46
Made changes where these are used, so that the version of fetchItem from PandocMonad can be used instead.
2017-01-25Removed `--normalize` option and normalization functions from Shared.John MacFarlane2-6/+13
* Removed normalize, normalizeInlines, normalizeBlocks from Text.Pandoc.Shared. These shouldn't now be necessary, since normalization is handled automatically by the Builder monoid instance. * Remove `--normalize` command-line option. * Don't use normalize in tests. * A few revisions to readers so they work well without normalize.
2017-01-25Class: Removed getDefaultReferenceDocx/ODT from PandocMonad.John MacFarlane2-3/+5
We don't need these, since the default docx and odt can be retrieved using `readDataFile datadir "reference.docx"` (or odt).
2017-01-25Class: removed 'fail' from PandocMonad.John MacFarlane1-1/+1
Do we need this? I don't see why. There's a name clash which would better be avoided.
2017-01-25Simplified reference-docx/reference-odt to reference-doc.John MacFarlane2-2/+2
* 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.
2017-01-25Remove now-unnecessary lifts in Markdown writer.John MacFarlane1-9/+6
Other writers still TBD.
2017-01-25Class: rename addWarning[WithPos] to warning[WithPos].John MacFarlane6-15/+15
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 MacFarlane6-24/+28
* 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-25Make sure texMathToInlines issues warning.John MacFarlane1-1/+3
2017-01-25Refactored math conversion in writers.John MacFarlane10-368/+488
* 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-25Fix rebasing errors.Jesse Rosenthal2-2/+2
2017-01-25Unify Errors.Jesse Rosenthal8-8/+16
2017-01-25Deleted whitespace at end of source lines.John MacFarlane3-4/+4
2017-01-25Fixed regression in OPML writer.John MacFarlane1-1/+1
OPML writer should note include `_notes` attribute when there's no content.
2017-01-25Texinfo writer: restore former behavior for headers level > 4.John MacFarlane1-19/+21
The recent changes made the writer fail with an error if it encountered a header with level 5. Better to do as we did before and just print a paragraph in that case. Eventually we should emit a warning here.
2017-01-25Fixes to compile after rebase.John MacFarlane2-3/+4
2017-01-25Implement Errors in PandocMonadJesse Rosenthal8-127/+168
Errors can be thrown purely with `throwError`. At the moment there are only three kinds of errors: 1. PandocFileReadError FilePath (for problems reading a file from the filesystem) 2. PandocShouldNeverHappenError String (for stuff that should never happen but we need to pattern-match anyway) 3. PandocSomeError String (a grab bag of everything else) Of course, we need to subdivide the third item in this list.
2017-01-25Convert all writers to use PandocMonad.Jesse Rosenthal22-186/+222
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.
2017-01-25Convert writers to use PandocMonad typeclass.Jesse Rosenthal6-142/+122
Instead of Free Monad with runIO
2017-01-25Free: Remove readFileUTF8.Jesse Rosenthal1-1/+1
This is just defined in term of a bytestring, so we convert when necessary.
2017-01-25Remove readFileStrict.Jesse Rosenthal1-1/+1
We only used it once, and then immediately converted to lazy.
2017-01-25Remove IO UUID functions.Jesse Rosenthal1-1/+2
2017-01-25ODT Writer: fix compiler complaint.Jesse Rosenthal1-1/+0
2017-01-25Finish pure writer of FB2.Jesse Rosenthal1-10/+17
2017-01-25FB2 writer: Rewrite image-fetching to use fetchItem.Jesse Rosenthal1-43/+11
This uses the function from shared, which will allow us to convert it over to the free monad.
2017-01-25Continue refactoring FB2 writer.Jesse Rosenthal1-8/+14
2017-01-25FB2 writer: bring functions to toplevel.Jesse Rosenthal1-47/+53
This is the first of a number of changes to bring the FB2 writer a bit closer to the idioms used elsewhere in pandoc, so it can be more easily converted to using the pure functions from Free.
2017-01-25Make pure rtf writer using free.Jesse Rosenthal1-4/+13
2017-01-25Implement runTest functions.Jesse Rosenthal4-25/+16
These work with a State monad and a Reader monad to produce deterministic results. It can probably be simplified somewhat.
2017-01-25Remove IORef from EPUB writer.Jesse Rosenthal1-51/+62
2017-01-25Remove IORef from ODT writer.Jesse Rosenthal1-24/+38
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.
2017-01-25Introduce pure versions of IO Writers.Jesse Rosenthal4-90/+124
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 Plociniczak22-11/+48
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.
2017-01-25Added page breaks into Pandoc.Hubert Plociniczak1-3/+25
This requires an updated version of pandoc-types that introduces PageBreak definition. Not that this initial commit only introduces ODT pagebreaks and distinguishes for it page breaks before, after, or both, the paragraph, as read from the style definition.