aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App.hs
AgeCommit message (Collapse)AuthorFilesLines
2018-12-31Simplify/fix reading of `--metadata` values on command line.John MacFarlane1-7/+8
Previously we used HsYAML's decodeStrict to recognize boolean values (treating everything else as a string). This caused problems relating to hvr/HsYAML#7. We now just check for the recognized boolean values `true|True|TRUE|false|False|FALSE`, and avoid using HsYAML. Closes #5177.
2018-11-29Improve error message for UTF-8 decoding errors.John MacFarlane1-6/+17
Give the filename and the byte offset. Closes #4765.
2018-11-07T.P.App: extract submodule T.P.App.FormatHeuristicsAlbert Krewinkel1-57/+1
Format guessing is used for input and output options and should be shared.
2018-11-06T.P.App: extract Opt into separate moduleAlbert Krewinkel1-2/+2
The new Opt module has only a few dependencies. This is important for compile-times during development, as Template Haskell containing modules are be recompiled whenever a (transitive) dependency changes.
2018-11-03App: extract output settings into moduleAlbert Krewinkel1-201/+28
2018-11-03App: extract command line options to separate moduleAlbert Krewinkel1-1035/+8
2018-11-01Text.Pandoc.App: improved detection of format based on extension.John MacFarlane1-83/+66
We now ensure that if someone tries to convert a file for a format that has a pandoc writer but not a reader, it won't just default to markdown.
2018-10-31Work around HXT limitation for --syntax-definition with windows drive.John MacFarlane1-2/+9
Closes #4836.
2018-10-26Always preserve tabs for man format.John MacFarlane1-1/+3
We need it for tables.
2018-10-19Use man reader for files with extension dot + digit.John MacFarlane1-0/+1
2018-09-30Implement `--ascii` (`writerPreferAscii`) in writers, not App.John MacFarlane1-20/+5
Now the `write*` functions for Docbook, HTML, ICML, JATS, Man, Ms, OPML are sensitive to `writerPreferAscii`. Previously the to-ascii translation was done in Text.Pandoc.App, and thus not available to those using the writer functions directly. In addition, the LaTeX writer is now sensitive to `writerPreferAscii` and to `--ascii`. 100% ASCII output can't be guaranteed, but the writer will use commands like `\"{a}` and `\l` whenever possible, to avoid emiting a non-ASCII character. A new unexported module, Text.Pandoc.Groff, has been added to store functions used in the different groff-based writers.
2018-09-15introduce --metadata-file optionmb211-0/+17
closes #1960 API change: Text.Pandoc.Readers.Markdown exports now `yamlToMeta`
2018-08-03Better error message on `-t pdf -o out.pdf` (#4815)Mauro Bieg1-5/+9
closes #1155 (again)
2018-07-18Fix regression finding templates in user data directory.John MacFarlane1-3/+1
Under version 2.2.1 and prior pandoc found latex templates in the templates directory under the data directory, but this no longer works in 2.2.2. MANUAL says: "If the template is not found, pandoc will search for it in the templates subdirectory of the user data directory (see `--data-dir`)." This commit fixes the regression, which stems from 07bce91. Closes #4777.
2018-06-29Use HsYAML instead of yaml for translations, YAML metadata.John MacFarlane1-5/+6
yaml wraps a C library; HsYAML is pure Haskell. Closes #4747. Advances #4535.
2018-06-29Use decodeEither' not decodeEither (deprecated).John MacFarlane1-2/+2
2018-06-28Avoid using deprecated 'decode' from yaml.John MacFarlane1-5/+5
2018-06-12Allow --template to take a URL argument.John MacFarlane1-1/+1
2018-06-03Regression: make --pdf-engine work with full paths (#4682)Mauro Bieg1-2/+2
Fixes #4681.
2018-05-09Restored and undeprecated gladtex for HTML math.John MacFarlane1-0/+6
- Added `GladTeX` constructor to `Text.Pandoc.Options.HTMLMathMethod` [API change, reverts removal in v2.2] - Restored and undeprecated `--gladtex` option, removed in v2.2. Closes #4607.
2018-05-08Use uriPathToPath with file: URIs.John MacFarlane1-2/+2
Closes #4613. Needs testing on Windows.
2018-04-30Don't lowercase custom writer filenameAlexander Krotov1-5/+3
Fixes #4610
2018-04-26Add FB2 reader (#4539)Alexander1-0/+1
2018-04-26Make `--ascii` work for all XML formats (ICML, OPML, JATS,...).John MacFarlane1-2/+3
Also document in manual.
2018-04-26Make `--ascii` work with `ms` and `man` output.John MacFarlane1-8/+16
2018-04-25Removed deprecated ancient HTML math methods.John MacFarlane1-40/+0
Removed `--latexmathml`, `--gladtex`, `--mimetex`, `--jsmath`, `-m`, `--asciimathml` options. Removed `JsMath`, `LaTeXMathML`, and `GladTeX` constructors from `Text.Pandoc.Options.HTMLMathMethod` [API change]. Removed unneeded data file LaTeXMathML.js and updated tests. Bumped version to 2.2.
2018-04-14Added a needed import in Text.Pandoc.App.John MacFarlane1-0/+1
2018-04-12Fix bash completion for `--print-default-data-file`.John MacFarlane1-2/+16
Previously this looked in the filesystem, even if pandoc was compiled with `embed_data_files` (and sometimes it looked in a nonexistent build directory). Now the bash completion script just includes a hard-coded list of data file names. See #4549.
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane1-0/+2
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-03-16Monoid/Semiground cleanup relying on custom Prelude.John MacFarlane1-1/+0
2018-03-09Raise error if someone tries to print docx, odt, etc. template.John MacFarlane1-0/+3
Closes #4441.
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.