aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App.hs
AgeCommit message (Collapse)AuthorFilesLines
2018-01-13Move filter functions to separate moduleAlbert Krewinkel1-95/+5
2018-01-12Lua filters: make PANDOC_READER_OPTIONS availableAlbert Krewinkel1-2/+2
The options which were used to read the document are made available to Lua filters via the `PANDOC_READER_OPTIONS` global.
2018-01-07Use latest skylighting and omit the 'missingincludes' check.John MacFarlane1-11/+1
If you use a custom syntax definition that refers to a syntax you haven't loaded, pandoc will now complain when it is highlighting the text, rather than at the start. This saves a huge performance hit from the `missingIncludes` check. Closes #4226.
2018-01-06Don't use `missingIncludes` unless custom syntax defs have been given.John MacFarlane1-1/+2
This avoids a huge performance sink that comes from evaluating all the elements of the default syntax map. Better just to have run-time errors for missing includes? See #4226.
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-3/+3
2017-12-28Filter changes.John MacFarlane1-34/+46
* Previously we ran all lua filters before JSON filters. * Now we run filters in the order they are presented on the command line, whether lua or JSON. * The type of `applyFilters` has changed (incompatible API change). * `applyLuaFilters` has been removed (incompatible API change). * Bump version to 2.1. See #4196.
2017-12-28Changed format of --list-extensions.John MacFarlane1-4/+3
Now the + or - occurs first.
2017-12-27Allow `--list-extensions` to take an optional FORMAT argument.John MacFarlane1-4/+6
This lists the extensions set by default for the selected FORMAT.
2017-12-27Allow lenient decoding of *latex error logs.John MacFarlane1-1/+6
These sometimes aren't properly UTF8 encoded, and it's confusing if we get an encoding error due to the error log. Closes #4200.
2017-12-23Fixed bug: when target is PDF, writer extensions were being ignored.John MacFarlane1-3/+3
E.g. `-t latex-smart -o file.pdf` would produce a different latex intermediate than `-t latex-smart -o file.tex`. Thanks to Bernhard Fisseni for pointing this out. This is a regression since pandoc 2.0 (introduced in commit c7e3c1ec).
2017-12-21Add pptx to isTextFormat listJesse Rosenthal1-1/+1
This is used to check standalone and not writing to the terminal.
2017-12-13Custom writer: use init file to setup Lua interpreterAlbert Krewinkel1-2/+2
The same init file (`data/init`) that is used to setup the Lua interpreter for Lua filters is also used to setup the interpreter of custom writers.lua.
2017-12-11`--pdf-engine-opt`: fix bug where option order was reversed.John MacFarlane1-1/+1
Closes #4137.
2017-12-11Integrate Powerpoint writer into pandoc.Jesse Rosenthal1-0/+1
2017-12-10Changes for skylighting-0.5.John MacFarlane1-1/+2
This fixes a bug in 2.0.4, whereby pandoc could not read the theme files generated with `--print-highlight-style`. It also fixes some CSS issues involving line numbers. Highlighted code blocks are now enclosed in a div with class sourceCode. Highlighting CSS no longer sets a generic color for pre and code; we only set these for class `sourceCode`. This will close #4133 and #4128.
2017-12-04Add `empty_paragraphs` extension.John MacFarlane1-8/+11
* Deprecate `--strip-empty-paragraphs` option. Instead we now use an `empty_paragraphs` extension that can be enabled on the reader or writer. By default, disabled. * Add `Ext_empty_paragraphs` constructor to `Extension`. * Revert "Docx reader: don't strip out empty paragraphs." This reverts commit d6c58eb836f033a48955796de4d9ffb3b30e297b. * Implement `empty_paragraphs` extension in docx reader and writer, opendocument writer, html reader and writer. * Add tests for `empty_paragraphs` extension.
2017-12-02Add --strip-empty-paragraphs option.John MacFarlane1-5/+15
This works for any input format.
2017-11-28Added --print-highlight-style option.John MacFarlane1-1/+26
This generates a JSON version of a highlighting style, which can be saved as a .theme file, modified, and used with `--highlight-style`. Closes #4106. Closes #4096.
2017-11-27Fix --help output for --highlight-style to include FILE (#4098)Mauro Bieg1-1/+1
Closes #4095.
2017-11-26Clearer deprecation warning for --latexmathml, --asciimathml, -m.John MacFarlane1-1/+1
Previously we only mentioned `--latexmathml`, even if `-m` was used.
2017-11-21Add comment explaining why TH is used in Text.Pandoc.App.John MacFarlane1-0/+2
2017-11-21Change JSON instances for Opt to TemplateHaskell (#4083)Jasper Van der Jeugt1-10/+6
The `Generic` JSON instances for `Text.Pandoc.App.Opt` seem to tickle a particulary bad quadratic complexity case (Generics complexity is worse than quadratic with respect to the number of fields in the datatype). This is with GHC-8.2.1, I didn't test it using 8.0 but I assume it is similar. Using `Generic`, compilation of the `Text.Pandoc.App` module takes minutes and often gets killed due to out of memory on slower machines with "only" 8GB of accessible memory. This is particularly annoying to me since it means I cannot build pandoc on Travis. TemplateHaskell is a little uglier, but the module seems to compile within a few seconds, and compilation doesn't take more than 1GB of memory. Should I also change the other JSON instances throughout the codebase for consistency?
2017-11-21Recognize ".muse" file extensionAlexander Krotov1-0/+2
2017-11-08Fix regression with --metadata.John MacFarlane1-4/+10
It should replace a metadata value set in the document itself, rather than creating a list including a new value. Closes #4054.
2017-11-07Deprecated ancient HTML math methods.John MacFarlane1-24/+38
`--latexmathml`, `--gladtex`, `--mimetex`, `--jsmath`
2017-10-30EPUB writer fixes:John MacFarlane1-1/+1
- Ensure that epub2 is recognized as a non-text format, so that a template is used. - Don't include "prefix" attribute for ibooks for epub2. It doesn't validate. - Fix stylesheet paths; previously we had an incorrect stylesheet path for the cover page and nav page.
2017-10-29Fixed warnings.John MacFarlane1-5/+0
2017-10-29Use uncurry.John MacFarlane1-1/+1
2017-10-27hlint suggestions.John MacFarlane1-1/+1
2017-10-27hlint suggestions.John MacFarlane1-9/+8
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-17/+17
2017-10-26makePDF: add argument for pdf options, remove writerPdfArgs.John MacFarlane1-3/+4
- Removed writerPdfArgs from WriterOptions (API change). - Added parameter for pdf args to makePDF.
2017-10-24Text.Pandoc.App: export applyFilters, applyLuaFilters. (API change)John MacFarlane1-0/+2
2017-10-15App: added --request-header option.John MacFarlane1-8/+17
2017-10-15Handle unknown options in form `--latex-engine=foo`.John MacFarlane1-1/+2
Previously these were not triggering the helpful message about option name changes.
2017-10-06Removed redundant importJohn MacFarlane1-1/+0
2017-10-05KaTeX fixes:John MacFarlane1-22/+4
* In Options.HTMLMathMethod, the KaTeX contsructor now takes only one string (for the KaTeX base URL), rather than two [API change]. * The default URL has been updated to the latest version. * The autoload script is now loaded by default.
2017-09-30Removed Verbosity and MediaBag params from makePDF.John MacFarlane1-3/+2
They can be obtained from CommonState since we're in PandocIO.
2017-09-30Removed writerSourceURL, add source URL to common state.John MacFarlane1-17/+8
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`.
2017-09-30Run Lua filters before extracting mediaAlbert Krewinkel1-2/+2
This enables users to change the media files being extracted via lua filters.
2017-09-30Text.Pandoc.Lua: add mediabag submoduleAlbert Krewinkel1-7/+6
2017-09-28Support R filters #3940 (#3941)Andrie de Vries1-0/+1
2017-09-26Lua filters: set global FORMAT instead of args.John MacFarlane1-4/+4
This changes the type of runLuaFilter.
2017-09-20Fixed bug in determining writer for xelatex engine.John MacFarlane1-1/+1
This revises the last commit, fixing #3931.
2017-09-19Fix and simply latex engine code in App.John MacFarlane1-47/+44
Fixes #3931.
2017-09-17Added `--strip-comments` option, `readerStripComments` in `ReaderOptions`.John MacFarlane1-0/+8
* Options: Added readerStripComments to ReaderOptions. * Added `--strip-comments` command-line option. * Made `htmlTag` from the HTML reader sensitive to this feature. This affects Markdown and Textile input. Closes #2552.
2017-09-15Set PANDOC_READER_OPTIONS in environment where filters are run.John MacFarlane1-7/+16
This contains a JSON representation of ReaderOptions.
2017-09-12Add default pdf engine for beamer.John MacFarlane1-0/+1
2017-09-12Use defaultLatexEngine instead of `head latexEngines`.John MacFarlane1-3/+9
Partial functions make me nervous.
2017-09-11Support for PDF generation via `weasyprint` and `prince` (#3909)Mauro Bieg1-41/+77
* Rename --latex-engine to --pdf-engine * In `Text.Pandoc.Options.WriterOptions`, rename `writerLaTeXEngine` to `writerPdfEngine` and `writerLaTeXArgs` to `writerPdfArgs`. * Add support for `weasyprint` and `prince`, in addition to `wkhtmltopdf`, for PDF generation via HTML (closes #3906). * `Text.Pandoc.PDF.html2pdf`: use stdin instead of intermediate HTML file