Commit graph

24 commits

Author SHA1 Message Date
John MacFarlane
a85d833576 Fixed log message for InvalidLang. 2017-06-25 15:52:30 +02:00
John MacFarlane
a02f08c9fc Added InvalidLang to LogMessage. 2017-06-25 12:46:26 +02:00
John MacFarlane
814ac51d32 Separated tracing from logging.
Formerly tracing was just log messages with a DEBUG log
level.  We now make these things independent.  Tracing
can be turned on or off in PandocMonad using `setTrace`;
it is independent of logging.

* Removed `DEBUG` from `Verbosity`.
* Removed `ParserTrace` from `LogMessage`.
* Added `trace`, `setTrace` to `PandocMonad`.
2017-06-19 22:17:43 +02:00
John MacFarlane
abd2e94f5a In producing PDFs, warn if the font is missing some characters.
* Added `MissingCharacter` to `LogMessage` in Text.Pandoc.Logging.
* Parse the (xe)latex log for missing character warnings and issue
  the warning.

Closes #3742.
2017-06-18 11:17:00 +02:00
John MacFarlane
23f3c2d7b4 Changed "extracting..." warning to a regular log message.
This makes it sensitive to proper verbosity settings.
(It is now treated as INFO rather than WARNING, so one
doesn't get these messages for creation of tmp images
while making a pdf.)

API changes:

* Removed extractMediaBag from Text.Pandoc.MediaBag.
* Added Extracting as constructor for LogMessage.
2017-06-12 15:28:39 +02:00
John MacFarlane
8f2c803f97 Markdown reader: warn for notes defined but not used.
Closes #1718.

Parsing.ParserState: Make stateNotes' a Map, add stateNoteRefs.
2017-05-25 11:34:51 +02:00
John MacFarlane
19d3a2bbe5 Logging: Made SkippedContent WARNING not INFO. 2017-05-24 21:46:43 +02:00
John MacFarlane
aa1e39858d Text.Pandoc.App: ToJSON and FromJSON instances for Opts.
This can be used e.g. to pass options via web interface,
such as trypandoc.
2017-05-21 11:42:50 +02:00
Albert Krewinkel
965f1ddd4a
Update dates in copyright notices
This follows the suggestions given by the FSF for GPL licensed software.
<https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-05-13 23:30:13 +02:00
John MacFarlane
4de4816b99 RST writer: convert to PandocMonad, report on unrendered raw items. 2017-03-13 21:32:58 +01:00
John MacFarlane
db37b71d9a Highlighting: highlighting now returns an Either rather than Maybe.
This allows us to display error information returned by the
skylighting library.

Display a warning if the highlighting library throws an error.
2017-03-13 11:38:19 +01:00
John MacFarlane
2f8f8f0da6 Issue warning for duplicate header identifiers.
As noted in the previous commit, an autogenerated identifier
may still coincide with an explicit identifier that is given
for a header later in the document, or with an identifier on
a div, span, link, or image. This commit adds a warning
in this case, so users can supply an explicit identifier.

* Added `DuplicateIdentifier` to LogMessage.
* Modified HTML, Org, MediaWiki readers so their custom
  state type is an instance of HasLogMessages.  This is necessary
  for `registerHeader` to issue warnings.

See #1745.
2017-03-12 22:07:28 +01:00
John MacFarlane
11e57c4d18 Logging: Added NoLangSpecified, use toConstr to avoid boilerplate. 2017-03-09 10:20:30 +01:00
John MacFarlane
e256c8ce17 Stylish-haskell automatic formatting changes. 2017-03-04 13:03:41 +01:00
John MacFarlane
87764b1c46 Logging: Added NoTitleElement constructor for LogMessage. 2017-03-04 11:13:54 +01:00
John MacFarlane
887d0b70fe Logging: Remove UsingResourceFrom, add CouldNotConvertImage 2017-02-24 14:29:54 +01:00
John MacFarlane
1c84855aab Class: Add stResourcePath to CommonState, getResourcePath, setResourcePath.
To be used in implementing `\graphicspath` in LaTeX, and possibly
in things like PDF production via context.

Use resource path in fetchItem.

Issue an info message if we get a resource from somewhere other
than ".".

Added UsingResourceFrom to log message.
2017-02-24 14:15:10 +01:00
John MacFarlane
2bbf98a613 Put makeSelfContained in PandocMonad instead of IO.
This removes the need to pass MediaBag around and improves
exceptions.  It also opens up the possibility of using
makeSelfContained purely.
2017-02-23 15:06:25 +01:00
John MacFarlane
ebe4072bd9 Add CircularReference constructor to LogMessage. 2017-02-15 17:35:29 +01:00
John MacFarlane
48c78713c8 Rename logMessagesToJSON -> encodeLogMessages. 2017-02-11 22:58:22 +01:00
John MacFarlane
92a5445aa1 Logging: export logMessagesToJSON.
Use a deterministic order for fields.
2017-02-11 20:13:33 +01:00
John MacFarlane
76c55466d3 Use new warnings throughout the code base. 2017-02-11 00:14:44 +01:00
John MacFarlane
8ad7e2c21f Logging: added ToJSON instance and showLogMessage.
This gives us the possibility of both machine-readable
and human-readable output for log messages.

See #3392.
2017-02-10 22:06:07 +01:00
John MacFarlane
5e1249481b Added Text.Pandoc.Logging (exported module).
This now contains the Verbosity definition previously
in Options, as well as a new LogMessage datatype that
will eventually be used instead of raw strings for
warnings.

This will enable us, among other things, to provide
machine-readable warnings if desired.

See #3392.
2017-02-10 20:59:54 +01:00