aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Filter.hs
AgeCommit message (Collapse)AuthorFilesLines
2020-03-22Finer grained imports of Text.Pandoc.Class submodules (#6203)Albert Krewinkel1-1/+2
This should speed-up recompilation after changes in `Text.Pandoc.Class`, as the number of modules affected by a change will be smaller in general. It also offers faster insights into the parts of `T.P.Class` used within a module.
2020-03-15Use implicit Prelude (#6187)Albert Krewinkel1-2/+0
* Use implicit Prelude The previous behavior was introduced as a fix for #4464. It seems that this change alone did not fix the issue, and `stack ghci` and `cabal repl` only work with GHC 8.4.1 or newer, as no custom Prelude is loaded for these versions. Given this, it seems cleaner to revert to the implicit Prelude. * PandocMonad: remove outdated check for base version Only base versions 4.9 and later are supported, the check for `MIN_VERSION_base(4,8,0)` is therefore unnecessary. * Always use custom prelude Previously, the custom prelude was used only with older GHC versions, as a workaround for problems with ghci. The ghci problems are resolved by replacing package `base` with `base-noprelude`, allowing for consistent use of the custom prelude across all GHC versions.
2020-03-13Update copyright year (#6186)Albert Krewinkel1-1/+1
* Update copyright year * Copyright: add notes for Lua and Jira modules
2020-02-13A bit more cleanup (#6141)Joseph C. Sible1-3/+3
* Remove unnecessary fmaps and only do toMilliseconds once * Share the input tuple intead of making a new one * Lift return out of if * Simplify case statements * Lift DottedNum out of the case statements * Use st instead of mbs * Use setState instead of updateState now that we have the whole state around
2020-02-04Add timing info for filters in `--verbose` mode.John MacFarlane1-4/+18
+ Add RunningFilter, FilterCompleted constructors to LogMessage + When verbose mode is specified (verbosity == INFO), print a notice when running a filter and when a filter completes (including timing). Closes #6112.
2019-11-06Add and apply filters in order (not reversed).John MacFarlane1-4/+4
This changes `applyFilters` from Text.Pandoc.Filter so that it does a left fold rather than a right fold, applying the filters in the order listed. [behavior change] The command-line arguments are accumulated in order instead of reverse order. A first step twoards #5881.
2019-10-10Improve parsing of --defaults.John MacFarlane1-0/+21
- Add FromYAML instances to Opt and to all subsidiary types. - Remove the use of HsYAML-aeson, which doesn't give good position information on errors. - Rename some fields in Opt to better match cli options or reflect what the ycontain [API change]: + optMetadataFile -> optMetadataFiles + optPDFEngineArgs -> optPDFEngineOpts + optWrapText -> optWrap - Add IpynbOutput enumerated type to Text.Pandoc.App.Opts. Use this instead fo a string for optIpynbOutput. - Add FromYAML instance for Filter in Text.Pandoc.Filters. With these changes parsing of defaults files should be complete and should give decent error messages. Now (unlike before) we get an error if an unknown field is used.
2019-10-07Remove derive_json_via_th flag; always use TH.John MacFarlane1-13/+0
This cuts down on code duplication and reduces the chance for errors. See #4083.
2019-03-01Remove license boilerplate.John MacFarlane1-17/+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-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-11-11Fix CPP conditional for TH pragmaAlbert Krewinkel1-1/+1
The condition was from an earlier version.
2018-11-05Use DERIVE_JSON_VIA_TH in Text.Pandoc.Filter.John MacFarlane1-6/+6
Previously AVOID_TEMPLATE_HASKELL was used (with the opposite valence). I assume this was a leftover from an earlier version.
2018-11-04Add cabal flag `derive_json_via_th`Albert Krewinkel1-3/+18
Disabling the flag will cause derivation of ToJSON and FromJSON instances via GHC Generics instead of Template Haskell. The flag is enabled by default, as deriving via Generics can be slow (see #4083).
2018-10-28T.P.Filter: centralize filter path expansionAlbert Krewinkel1-2/+11
2018-10-28T.P.Lua: merge runLuaFilter into T.P.Filter.Lua (API change)Albert Krewinkel1-4/+3
The function `runLuaFilter` was only used in Text.Pandoc.Filter.Lua, use apply from the that module instead.
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-01-19hlint code improvements.John MacFarlane1-1/+1
2018-01-15Renaming: Json -> JSON in modules and functions.John MacFarlane1-2/+2
2018-01-13Move filter functions to separate moduleAlbert Krewinkel1-0/+60