aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Logging.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-11-12Switch to new pandoc-types and use Text instead of String [API change].despresc1-180/+179
PR #5884. + Use pandoc-types 1.20 and texmath 0.12. + Text is now used instead of String, with a few exceptions. + In the MediaBag module, some of the types using Strings were switched to use FilePath instead (not Text). + In the Parsing module, new parsers `manyChar`, `many1Char`, `manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`, `mantyUntilChar` have been added: these are like their unsuffixed counterparts but pack some or all of their output. + `glob` in Text.Pandoc.Class still takes String since it seems to be intended as an interface to Glob, which uses strings. It seems to be used only once in the package, in the EPUB writer, so that is not hard to change.
2019-10-10Improve parsing of --defaults.John MacFarlane1-0/+9
- 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-09-27LogMessage: change UnknownExtension -> CouldNotDeduceFormatJohn MacFarlane1-4/+4
2019-09-19Clarify warning for missing title.John MacFarlane1-3/+3
Closes #5760.
2019-09-08Emit warning on `-f latex -o out.pdf` (#5736)Mauro Bieg1-0/+6
add UnusualConversion to LogMessage [API change]
2019-07-14Logging: Added UnknownExtensions constructor to LogMessage.John MacFarlane1-1/+10
[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-06-09Logging: Added IgnoredElement constructor for LogMessage.John MacFarlane1-0/+6
SkippedContent doesn't work for some of the XML-based readers, which don't have access to source positions.
2019-05-13Org reader: omit, but warn about unknown export optionsAlbert Krewinkel1-0/+6
Unknown export options are properly ignored and omitted from the output.
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-1/+1
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-10-08Add helpful suggestion to missing title warning.John MacFarlane1-1/+2
Tell users what to add to the command line to avoid the warning. Closes #4909.
2018-05-04catch IO errors when writing media files, closes #4559 (#4619)Francesco Occhipinti1-0/+6
If we do not catch these errors, any malformed entry in a media bag could cause the loss of a whole document output. An example of malformed entry is an entry with an empty file path.
2018-04-28FB2 reader: replace some errors with warningsAlexander Krotov1-0/+7
Now FB2 reader can read writer.fb2, which does not validate (yet).
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-05Update copyright notices to include 2018Albert Krewinkel1-1/+1
2017-11-04Logging: issue INFO, not WARNING, if LaTeX .sty file can't be read.John MacFarlane1-1/+4
Normally this is not a situation requiring a fix from the user, so a warning is inappropriate.
2017-11-01hlintAlexander Krotov1-7/+7
2017-10-29Source code reformatting.John MacFarlane1-1/+1
2017-10-27Don't rely on syb when we don't need to.John MacFarlane1-1/+1
2017-10-23Downgraded SkippedContent and DocxParserWarning from WARNING to INFOJohn MacFarlane1-2/+2
2017-08-18LaTeX reader: implement \newtoggle, \iftoggle, \toggletrue|falseJohn MacFarlane1-0/+9
from etoolbox. Closes #3853.
2017-08-11Added support for translations (localization) (see #3559).John MacFarlane1-0/+14
* readDataFile, readDefaultDataFile, getReferenceDocx, getReferenceODT have been removed from Shared and moved into Class. They are now defined in terms of PandocMonad primitives, rather than being primitve methods of the class. * toLang has been moved from BCP47 to Class. * NoTranslation and CouldNotLoudTranslations have been added to LogMessage. * New module, Text.Pandoc.Translations, exporting Term, Translations, readTranslations. * New functions in Class: translateTerm, setTranslations. Note that nothing is loaded from data files until translateTerm is used; setTranslation just sets the language to be used. * Added two translation data files in data/translations. * LaTeX reader: Support `\setmainlanguage` or `\setdefaultlanguage` (polyglossia) and `\figurename`.
2017-08-07Logging: Added Deprecated constructor to LogMessage.John MacFarlane1-5/+9
2017-08-07Added Deprecated warning to LogMessage.John MacFarlane1-0/+7
2017-08-07Revert "Logging: Made SkippedContent an INFO level message..."John MacFarlane1-1/+1
This reverts commit 8995281691b56d711c44fb0c5cae2fc675d12eb9.
2017-08-07Logging: Made SkippedContent an INFO level message...John MacFarlane1-1/+1
rather than WARNING.
2017-07-06Logging: added MacroAlreadyDefined.John MacFarlane1-0/+9
2017-06-25Fixed log message for InvalidLang.John MacFarlane1-1/+1
2017-06-25Added InvalidLang to LogMessage.John MacFarlane1-0/+7
2017-06-19Separated tracing from logging.John MacFarlane1-11/+1
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-18In producing PDFs, warn if the font is missing some characters.John MacFarlane1-0/+6
* 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-12Changed "extracting..." warning to a regular log message.John MacFarlane1-0/+6
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-05-25Markdown reader: warn for notes defined but not used.John MacFarlane1-0/+10
Closes #1718. Parsing.ParserState: Make stateNotes' a Map, add stateNoteRefs.
2017-05-24Logging: Made SkippedContent WARNING not INFO.John MacFarlane1-1/+1
2017-05-21Text.Pandoc.App: ToJSON and FromJSON instances for Opts.John MacFarlane1-0/+10
This can be used e.g. to pass options via web interface, such as trypandoc.
2017-05-13Update dates in copyright noticesAlbert Krewinkel1-1/+1
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-03-13RST writer: convert to PandocMonad, report on unrendered raw items.John MacFarlane1-2/+2
2017-03-13Highlighting: highlighting now returns an Either rather than Maybe.John MacFarlane1-0/+6
This allows us to display error information returned by the skylighting library. Display a warning if the highlighting library throws an error.
2017-03-12Issue warning for duplicate header identifiers.John MacFarlane1-1/+10
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-09Logging: Added NoLangSpecified, use toConstr to avoid boilerplate.John MacFarlane1-42/+30
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-26/+28
2017-03-04Logging: Added NoTitleElement constructor for LogMessage.John MacFarlane1-0/+9
2017-02-24Logging: Remove UsingResourceFrom, add CouldNotConvertImageJohn MacFarlane1-8/+9
2017-02-24Class: Add stResourcePath to CommonState, getResourcePath, setResourcePath.John MacFarlane1-0/+8
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-23Put makeSelfContained in PandocMonad instead of IO.John MacFarlane1-2/+14
This removes the need to pass MediaBag around and improves exceptions. It also opens up the possibility of using makeSelfContained purely.
2017-02-15Add CircularReference constructor to LogMessage.John MacFarlane1-0/+10
2017-02-11Rename logMessagesToJSON -> encodeLogMessages.John MacFarlane1-3/+3
2017-02-11Logging: export logMessagesToJSON.John MacFarlane1-0/+10
Use a deterministic order for fields.
2017-02-11Use new warnings throughout the code base.John MacFarlane1-31/+74
2017-02-10Logging: added ToJSON instance and showLogMessage.John MacFarlane1-3/+96
This gives us the possibility of both machine-readable and human-readable output for log messages. See #3392.