Commit graph

232 commits

Author SHA1 Message Date
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
John MacFarlane
87170e2af4 Removed deprecated --no-wrap option. 2017-01-25 17:07:41 +01:00
John MacFarlane
767638a54e Removed deprecated --chapters option. 2017-01-25 17:07:41 +01:00
John MacFarlane
ce1664cf2b Simplified reference-docx/reference-odt to reference-doc.
* Text.Pandoc.Options.WriterOptions: removed writerReferenceDocx
  and writerReferenceODT, replaced them with writerReferenceDoc.
  This can hold either an ODT or a Docx. In this way, writerReferenceDoc
  is like writerTemplate, which can hold templates of different
  formats. [API change]

* Removed `--reference-docx` and `--reference-odt` options.

* Added `--reference-doc` option.
2017-01-25 17:07:41 +01:00
John MacFarlane
9570f59066 Process.pipeProcess: stream stderr rather than capturing.
Signature of pipeProcess has changed: the return value is
now IO (ExitCode, ByteString) -- with only stdout. Stderr
is just inherited from the parent.

This means that stderr from filters will now be streamed
as the filters are run.

Closes #2729.
2017-01-25 17:07:41 +01:00
John MacFarlane
70aa7b0485 Added --fail-if-warnings option. 2017-01-25 17:07:40 +01:00
John MacFarlane
1a0d93a1d3 LaTeX reader: Proper include file processing.
* Removed handleIncludes from LaTeX reader [API change].
* Now the ordinary LaTeX reader handles includes in a way
  that is appropriate to the monad it is run in.
2017-01-25 17:07:40 +01:00
John MacFarlane
63dc6bd025 Added a --quiet option to suppress warnings.
Use this also in Tests.Old.
2017-01-25 17:07:40 +01:00
John MacFarlane
5ab8909661 New withWarningsToStderr exported from Text.Pandoc.Class.
And use this in pandoc.hs so that messages actually get printed.
2017-01-25 17:07:40 +01:00
Jesse Rosenthal
3cda737dbd Remove redundant import. 2017-01-25 17:07:40 +01:00
Jesse Rosenthal
52859b9863 Finish converting readers over. 2017-01-25 17:07:40 +01:00
Jesse Rosenthal
5a02a81b43 Have to do some work to get the mediabag out. 2017-01-25 17:07:40 +01:00
John MacFarlane
300d94ac24 Deleted whitespace at end of source lines. 2017-01-25 17:07:39 +01:00
Jesse Rosenthal
04545c92c8 Clean up Text.Pandoc
We had primed versions of all the Writer types and getWriter
functions, as we transitioned. Now that we're using the new ones
exclusively, we'll get rid of the old ones, and get rid of the primes in
the names.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
04487779b2 Convert all writers to use PandocMonad.
Since PandocMonad is an instance of MonadError, this will allow us, in a
future commit, to change all invocations of `error` to `throwError`,
which will be preferable for the pure versions. At the moment, we're
disabling the lua custom writers (this is temporary).

This requires changing the type of the Writer in Text.Pandoc. Right now,
we run `runIOorExplode` in pandoc.hs, to make the conversion easier. We
can switch it to the safer `runIO` in the future.

Note that this required a change to Text.Pandoc.PDF as well. Since
running an external program is necessarily IO, we can be clearer about
using PandocIO.
2017-01-25 17:07:39 +01:00
John MacFarlane
b596d20605 Some fixes to permit breezeDark style. 2017-01-19 16:32:35 +01:00
John MacFarlane
46b1c31925 Add breezeDark to the list of highlighting styles. 2017-01-19 15:59:57 +01:00
John MacFarlane
9d781b1454 Updates to use skylighting rather than highlighting-kate.
So far this just reproduces capacity.

Later we'll be able to add features like warning
messages, dynamic loading of xml syntax definitions,
and dynamic loading of themes.
2016-12-23 18:07:49 -07:00
John MacFarlane
9b9ec99ee8 We no longer need the MathMLInHTML.js shim from 2004! 2016-12-09 21:18:02 +01:00
John MacFarlane
1fde7a340b Set PANDOC_VERSION environment variable for filters.
Closes #2640.
2016-12-08 11:09:40 +01:00
John MacFarlane
b0733190b0 Fixed bash completion for filenames with spaces.
Closes #2749.
2016-12-07 17:37:27 +01:00
John MacFarlane
fb8a2540bd Options: Removed writerStandalone, made writerTemplate a Maybe.
Previously setting writerStandalone = True did nothing unless
a template was provided in writerTemplate.  Now a fragment
will be generated if writerTemplate is Nothing; otherwise,
the specified template will be used and standalone output
generated.  [API change]
2016-11-30 15:34:58 +01:00