aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/App.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-08-24Change optMetadataFile type from Maybe to List (#5702)Owen McGrath1-2/+3
Changed optMetadataFile from `Maybe FilePath` to `[FilePath]`. This allows for multiple YAML metadata files to be added. The new default value has been changed from `Nothing` to `[]`. To account for this change in `Text.Pandoc.App`, `metaDataFromFile` now operates on two `mapM` calls (for `readFileLazy` and `yamlToMeta`) and a fold. Added a test (command/5700.md) which tests this functionality and updated MANUAL.txt, as per the contributing guidelines. With the current behavior, using `foldr1 (<>)`, values within files specified first will be used over those in later files. (If the reverse of this behavior would be preferred, it should be fixed by changing foldr1 to foldl1.)
2019-08-08Revert "Avoid a pointless Text -> String conversion on output."John MacFarlane1-14/+8
This reverts commit 87ce1ffbd97f6cb2785f9fbf05f68d3185f50675. This change caused a problem on Windows that we didn't have before; this needs looking into. https://ci.appveyor.com/project/jgm/pandoc/build/job/fxq96log042df8dk .\pandoc.exe -s --toc ..\MANUAL.txt -o MANUAL.html pandoc.exe: MANUAL.html: commitAndReleaseBuffer: invalid argument (invalid character) Command exited with code 1
2019-08-07Avoid a pointless Text -> String conversion on output.John MacFarlane1-8/+14
2019-07-20Removed an unnecessary liftIO.John MacFarlane1-2/+1
2019-07-20Moved istty check.John MacFarlane1-5/+5
2019-07-20Minor code clarity change.John MacFarlane1-8/+8
2019-07-14Logging: Added UnknownExtensions constructor to LogMessage.John MacFarlane1-35/+39
[API change] Issue this warning when we're falling back to markdown or html because we don't recognize the extension of the input or output files.
2019-07-14Change formatForFilePaths to return a Maybe.John MacFarlane1-1/+2
Internal change. This will make it easier to emit messages when we're guessing at a format.
2019-04-25Fix --self-contained so it works when output format has extensions.John MacFarlane1-4/+4
Previously if you used `--self-contained` with `html-smart` or `html+smart`, it wouldn't work.
2019-04-02Fix harmless error in file-scope code.John MacFarlane1-2/+2
Closes #5422.
2019-03-02Use XDG data directory for user data directory.John MacFarlane1-6/+12
Instead of `$HOME/.pandoc`, the default user data directory is now `$XDG_DATA_HOME/pandoc`, where `XDG_DATA_HOME` defaults to `$HOME/.local/share` but can be overridden by setting the environment variable. If this directory is missing, then `$HOME/.pandoc` is searched instead, for backwards compatibility. However, we recommend moving local pandoc data files from `$HOME/.pandoc` to `$HOME/.local/share/pandoc`. On Windows the default user data directory remains the same. Closes #3582.
2019-03-01Remove license boilerplate.John MacFarlane1-18/+0
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-28Markdown Reader: yamlToMeta respects extensions (#5276)Mauro Bieg1-4/+5
Add ReaderOptions parameter to yamlToMeta [API change]. fixes #5272
2019-02-28Shared: add filterIpynbOutput. [API change]John MacFarlane1-8/+21
Add command line option `--ipynb-output=all|none|best`. Closes #5339.
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel1-2/+2
Quite a few modules were missing copyright notices. This commit adds copyright notices everywhere via haddock module headers. The old license boilerplate comment is redundant with this and has been removed. Update copyright years to 2019. Closes #4592.
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.