Commit graph

253 commits

Author SHA1 Message Date
Albert Krewinkel
11b5f1e40b
Update copyright year (#6186)
* Update copyright year

* Copyright: add notes for Lua and Jira modules
2020-03-13 09:52:47 -07:00
John MacFarlane
5769ce9e55 Remove license boilerplate (pandoc.hs). 2019-03-01 10:29:23 -08:00
John MacFarlane
7e389cb3db Use NoImplicitPrelude and explicitly import Prelude.
This seems to be necessary if we are to use our custom Prelude
with ghci.

Closes #4464.
2018-03-18 10:46:28 -07:00
Albert Krewinkel
0d935bd081
Update copyright notices to include 2018 2018-01-05 20:39:12 +01:00
John MacFarlane
cbcb9b36c0 hlint suggestions. 2017-10-27 23:13:55 -07:00
John MacFarlane
7a924ec55a More code simp in pandoc.hs. 2017-10-27 20:58:54 -07:00
John MacFarlane
007236e8eb pandoc.hs - removed some cruft. 2017-10-27 20:39:20 -07:00
Kolen Cheung
0b09409385 update years in copyright 2017-10-26 22:57:13 -07:00
John MacFarlane
b61a51ee15 hlint suggestions. 2017-06-02 15:25:39 +02:00
John MacFarlane
0cf6511f16 Some hlint refactoring. 2017-06-01 15:09:38 +02:00
John MacFarlane
913db947a9 Text.Pandoc.App: Throw errors rather than exiting.
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-02 23:04:48 +02:00
Albert Krewinkel
f2f6851713 Lua filters (#3514)
* 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-20 15:17:03 +01:00
John MacFarlane
e256c8ce17 Stylish-haskell automatic formatting changes. 2017-03-04 13:03:41 +01:00
John MacFarlane
37e579581a Consolidated file arguments into Opt. 2017-02-06 14:52:16 +01:00
John MacFarlane
67dc15771d Further refactoring of App.
Moved option parsing code into App.
pandoc.hs is now a 2-liner.
2017-02-06 14:46:48 +01:00
John MacFarlane
6cb1e19d03 Removed another redundant import. 2017-02-06 08:58:39 +01:00
John MacFarlane
0bbea0cc76 Split pandoc.hs into a module, Text.Pandoc.App, and a small program.
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.
2017-02-05 21:58:45 +01:00
John MacFarlane
f2103e7e7b pandoc.hs: make reader and writer Maybe values in Opt. 2017-02-05 18:10:43 +01:00
John MacFarlane
2c3eeca8df More simplification of pandoc.hs.
Opt is now set up to contain only the basic content passed
through the options -- further processing (lookup of styles,
insertion of file contents, etc.) is now done later.
2017-02-05 11:23:52 +01:00
John MacFarlane
de48851605 More simplification of Opt in pandoc.hs.
We defer file reading til after option parsing.
2017-02-04 22:56:23 +01:00
John MacFarlane
67f4360fb8 More simplification of Opt in pandoc.hs. 2017-02-04 22:44:09 +01:00
John MacFarlane
1feddee6d6 Small revision to deprecation message for --old-dashes. 2017-02-04 11:05:26 +01:00
John MacFarlane
7d3702e807 Simplified Opt structure in cli option parsing.
We should make this closer to the actual options,
and do processing outside.
2017-02-04 10:09:20 +01:00
John MacFarlane
3a332fa076 Better error messages for removed options.
See #3416.
2017-02-04 09:41:08 +01:00
John MacFarlane
b8f4512534 Added TODO comment. 2017-02-04 08:37:44 +01:00
John MacFarlane
7018003811 --mathml and MathML in HTMLMathMethod longer take an argument.
The argument was for a bridge javascript that used to be necessary
in 2004.  We have removed the script already.
2017-01-30 11:31:50 +01:00
John MacFarlane
d2e0592e01 LaTeX writer: export writeBeamer.
Removed writerBeamer from WriterOptions.
2017-01-28 09:52:45 +01:00
John MacFarlane
fce0a60f0a Provide explicit separate functions for HTML 4 and 5.
* Text.Pandoc.Writers.HTML: removed writeHtml, writeHtmlString,
  added writeHtml4, writeHtml4String, writeHtml5, writeHtml5String.
* Removed writerHtml5 from WriterOptions.
* Renamed default.html template to default.html4.
* "html" now aliases to "html5"; to get the old HTML4 behavior,
  you must now specify "-t html4".
2017-01-25 21:51:26 +01:00
John MacFarlane
70b86f48e1 Removed readerVerbosity and writerVerbosity.
API change.

Also added a verbosity parameter to makePDF.
2017-01-25 17:07:43 +01:00
John MacFarlane
bc7e846da6 More logging-related changes.
Class:

* Removed getWarnings, withWarningsToStderr
* Added report
* Added logOutput to PandocMonad
* Make logOutput streaming in PandocIO monad
* Properly reverse getLog output

Readers:

* Replaced use of trace with report DEBUG.

TWiki Reader:  Put everything inside PandocMonad m.

API changes.
2017-01-25 17:07:43 +01:00
John MacFarlane
8280d6a489 Changes to verbosity in writer and reader options.
API changes: Text.Pandoc.Options:

* Added Verbosity.
* Added writerVerbosity.
* Added readerVerbosity.
* Removed writerVerbose.
* Removed readerTrace.

pandoc CLI:  The `--trace` option sets verbosity to DEBUG;
the `--quiet` option sets it to ERROR, and the `--verbose`
option sets it to INFO.  The default is WARNING.
2017-01-25 17:07:43 +01:00
John MacFarlane
d1efc839f1 Removed writerHighlight; made writerHighlightStyle a Maybe.
API change.

For no highlighting, set writerHighlightStyle to Nothing.
2017-01-25 17:07:43 +01:00
John MacFarlane
4007d6a897 Removed writerIgnoreNotes.
Instead, just temporarily remove notes when generating
TOC lists in HTML and Markdown (as we already did in LaTeX).

Also export deNote from Text.Pandoc.Shared.

API change in Shared and Options.WriterOptions.
2017-01-25 17:07:42 +01:00
John MacFarlane
00c6c371f2 Removed unused readerFileScope.
API change.
2017-01-25 17:07:42 +01:00
John MacFarlane
a3c3694024 Removed writerMediaBag from WriterOpts.
...since this is now handled through PandocMonad.

Added an explicit MediaBag parameter to makePDF and makeSelfContained.
2017-01-25 17:07:42 +01:00
John MacFarlane
0bcc81c0b1 Removed writerTeXLigatures.
Make `smart` extension work in LaTeX/ConTeXt writers instead.

Instead of `-t latex --no-tex-ligatures`, do `-t latex-smart`.
2017-01-25 17:07:42 +01:00
John MacFarlane
4f6e6247f9 Made smart extension default for pandoc markdown.
Updated tests.
2017-01-25 17:07:42 +01:00
John MacFarlane
5bf9125770 Removed readerOldDashes and --old-dashes option, added old_dashes extension.
API change.  CLI option change.
2017-01-25 17:07:42 +01:00
John MacFarlane
6f8b967d98 Removed readerSmart and the --smart option; added Ext_smart extension.
Now you will need to do

    -f markdown+smart

instead of

    -f markdown --smart

This change opens the way for writers, in addition to readers,
to be sensitive to +smart, but this change hasn't yet been made.

API change. Command-line option change.

Updated manual.
2017-01-25 17:07:42 +01:00
John MacFarlane
3876b91448 Make Extensions a custom type instead of a Set Extension.
The type is implemented in terms of an underlying bitset
which should be more efficient.

API change: from Text.Pandoc.Extensions export Extensions,
emptyExtensions, extensionsFromList, enableExtension, disableExtension,
extensionEnabled.
2017-01-25 17:07:42 +01:00
John MacFarlane
8165014df6 Removed --normalize option and normalization functions from Shared.
* Removed normalize, normalizeInlines, normalizeBlocks
  from Text.Pandoc.Shared.  These shouldn't now be necessary,
  since normalization is handled automatically by the Builder
  monoid instance.

* Remove `--normalize` command-line option.

* Don't use normalize in tests.

* A few revisions to readers so they work well without normalize.
2017-01-25 17:07:41 +01:00
John MacFarlane
fa00df2b8e pandoc.hs: moved main loop to beginning of file. 2017-01-25 17:07:41 +01:00
John MacFarlane
53e4b2fedc Refactored pandoc.hs so that all the runIO' part comes at the end. 2017-01-25 17:07:41 +01:00
John MacFarlane
4b4670ef6d pandoc.hs - moved some utility functions out of main loop. 2017-01-25 17:07:41 +01:00
John MacFarlane
3549e171bb More refactoring of pandoc.hs for clarity. 2017-01-25 17:07:41 +01:00
John MacFarlane
dc4f659401 Put filter running code into MonadIO 2017-01-25 17:07:41 +01:00
John MacFarlane
61335074b2 Fixed a misleading comment. 2017-01-25 17:07:41 +01:00
John MacFarlane
49502b9a02 Added a type signature 2017-01-25 17:07:41 +01:00
John MacFarlane
1bdf23c697 More refactoring of pandoc.hs for clarity. 2017-01-25 17:07:41 +01:00
John MacFarlane
8beba65977 Slight code rearrangement in preparation for...
...passing mediabag in the PandocIO monad.
2017-01-25 17:07:41 +01:00