aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App.hs
AgeCommit message (Collapse)AuthorFilesLines
2017-04-15Small fix to error reporting in App.John MacFarlane1-4/+2
Closes #3548.
2017-04-15Error: Added PandocCouldNotFindDataFileError.John MacFarlane1-4/+4
Use this instead of PandocAppError when appropriate. Removed exit code from PandocAppError, use 1 for all.
2017-04-15App: use PandocOptionError instead of PandocAppError where appropriate.John MacFarlane1-16/+16
2017-04-15Error: Added PandocFilterError.John MacFarlane1-8/+4
2017-04-15Error: Added PandocPDFErrorJohn MacFarlane1-1/+1
2017-04-15Text.Pandoc.Error: added new constructors.John MacFarlane1-9/+6
- PandocSyntaxMapError String - PandocFailOnWarningError - PandocPDFProgramNotFoundError String
2017-04-15Revised error message for pandoc -t pdf.John MacFarlane1-4/+4
2017-04-04Error: Added PandocOptionError.John MacFarlane1-1/+1
2017-04-03Removed unused import.John MacFarlane1-1/+0
2017-04-02Text.Pandoc.App: Throw errors rather than exiting.John MacFarlane1-41/+53
These are caught (and lead to exit) in pandoc.hs, but other uses of Text.Pandoc.App may want to recover in another way. Added PandocAppError to PandocError (API change). This is a stopgap: later we should have a separate constructor for each type of error. Also fixed uses of 'exit' in Shared.readDataFile, and removed 'err' from Shared (API change). Finally, removed the dependency on extensible-exceptions. See #3548.
2017-04-01Allow a theme file as argument to `--highlight-style`.John MacFarlane1-2/+8
Also include a sample, `default.theme`, in `data/`.
2017-04-01Change MathJax CDN default since old one is shutting down.John MacFarlane1-1/+1
New URL: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js Announcement: https://www.mathjax.org/cdn-shutting-down/ NOTE: The new URL requires a version number, which we'll have to update manually in subsequent pandoc releases in order to take advantage of mathjax improvements. Closes #3544.
2017-03-31JATS writer: don't include jats.csl in metadata if csl already specified.John MacFarlane1-1/+3
2017-03-30Allow dynamic loading of syntax definitions.John MacFarlane1-1/+28
See #3334. * Add writerSyntaxMap to WriterOptions. * Highlighting: added parameter for SyntaxMap to highlight. * Implemented --syntax-definition option. TODO: [ ] Figure out whether we want to have the xml parsing depend on the dtd (it currently does, and fails unless the language.dtd is found in the same directory). [ ] Add an option to read a KDE syntax highlighting theme as a custom style. [ ] Add tests.
2017-03-30Don't read jats.csl unless we actually need it.John MacFarlane1-5/+6
2017-03-30Automatically include URI-encoded jats.csl for jats output.John MacFarlane1-2/+8
This way people can do pandoc -s -t jats --filter pandoc-citeproc and it will just work. If they want to specify a stylesheet, they still can.
2017-03-24Recognize .roff extension as ms format.John MacFarlane1-0/+1
2017-03-23Allow creation of pdf via groff ms and pdfroff.John MacFarlane1-4/+8
pandoc -t ms -o output.pdf input.txt
2017-03-23Initial addition of groff ms writer.John MacFarlane1-0/+1
* New module: Text.Pandoc.Writers.Ms. * New template: default.ms. * The writer uses texmath's new eqn writer to convert math to eqn format, so a ms file produced with this writer should be processed with `groff -ms -e` if it contains math.
2017-03-20Lua filters (#3514)Albert Krewinkel1-0/+16
* Add `--lua-filter` option. This works like `--filter` but takes pathnames of special lua filters and uses the lua interpreter baked into pandoc, so that no external interpreter is needed. Note that lua filters are all applied after regular filters, regardless of their position on the command line. * Add Text.Pandoc.Lua, exporting `runLuaFilter`. Add `pandoc.lua` to data files. * Add private module Text.Pandoc.Lua.PandocModule to supply the default lua module. * Add Tests.Lua to tests. * Add data/pandoc.lua, the lua module pandoc imports when processing its lua filters. * Document in MANUAL.txt.
2017-03-16Add default abbreviations file (data/abbreviations).John MacFarlane1-4/+4
This contains a list of strings that will be recognized by pandoc's Markdown parser as abbreviations. (A nonbreaking space will be inserted after the period, preventing a sentence space in formats like LaTeX.) Users can override the default by putting a file abbreviations in their user data directory (`~/.pandoc` on *nix).
2017-03-16Added --abbreviations=FILE option for custom abbreviations file.John MacFarlane1-8/+23
2017-03-07Re-enable support for custom lua writers.John MacFarlane1-1/+3
Closes #3495.
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-109/+110
2017-03-04hlint refactoring.John MacFarlane1-12/+9
2017-02-27Removed `--epub-stylesheet`; use `--css` instead.John MacFarlane1-13/+2
* Removed writerEpubStylesheet in WriterOptions. * Removed `--epub-stylesheet` option. * Allow `--css` to be used with epub. * Allow multiple stylesheets to be used. * Stylesheets will be taken both from `--css` and from the `stylesheet` metadata field (which can contain either a file path or a list of them). Closes #3472, #847.
2017-02-25App: reverse optInputFiles so they come out in right order in templates.John MacFarlane1-1/+5
2017-02-25Add `sourcefile` and `outputfile` template variables (#3439)Roland Hieber1-0/+5
Closes #3431.
2017-02-25Make `--ascii` work with DocBook output too.John MacFarlane1-1/+4
2017-02-23Use PandocIOError in Class.John MacFarlane1-5/+1
2017-02-23Put makeSelfContained in PandocMonad instead of IO.John MacFarlane1-1/+1
This removes the need to pass MediaBag around and improves exceptions. It also opens up the possibility of using makeSelfContained purely.
2017-02-20Added Functor constraint to keep ghc 7.8.4 happy.John MacFarlane1-1/+1
2017-02-11Rename logMessagesToJSON -> encodeLogMessages.John MacFarlane1-2/+1
2017-02-11Logging: export logMessagesToJSON.John MacFarlane1-2/+2
Use a deterministic order for fields.
2017-02-11Added --log option to save log messages in JSON format to a file.John MacFarlane1-0/+12
See #3392.
2017-02-11Use new warnings throughout the code base.John MacFarlane1-2/+1
2017-02-06Removed --parse-raw and readerParseRaw.John MacFarlane1-19/+14
These were confusing. Now we rely on the +raw_tex or +raw_html extension with latex or html input. Thus, instead of --parse-raw -f latex we use -f latex+raw_tex and instead of --parse-raw -f html we use -f html+raw_html
2017-02-06Fix importJohn MacFarlane1-1/+1
2017-02-06Changed year on copyright message.John MacFarlane1-1/+1
2017-02-06Consolidated file arguments into Opt.John MacFarlane1-4/+7
2017-02-06Further refactoring of App.John MacFarlane1-8/+724
Moved option parsing code into App. pandoc.hs is now a 2-liner.
2017-02-05Fix an unneeded import warning.John MacFarlane1-1/+1
2017-02-05Split pandoc.hs into a module, Text.Pandoc.App, and a small program.John MacFarlane1-0/+720
The App module provides a function that does a pandoc conversion, based on option settings. The program (pandoc.hs) now does nothing more than parse options and pass them to this function, which can easily be used by other applications (e.g. a GUI wrapper). The Opt structure has been further simplified. API changes: * New exposed module Text.Pandoc.App * Text.Pandoc.Highlighting has been exposed. * highlightingStyles has been moved to Text.Pandoc.Highlighting.