Commit graph

7817 commits

Author SHA1 Message Date
John MacFarlane
d2e0592e01 LaTeX writer: export writeBeamer.
Removed writerBeamer from WriterOptions.
2017-01-28 09:52:45 +01:00
John MacFarlane
91cdcc796d HTML: export separate functions for slide formats.
writeS5, writeSlideous, writeRevealJs, writeDZSlides, writeSlidy.

Removed writerSlideVariant from WriterOptions.
2017-01-27 22:39:36 +01:00
John MacFarlane
5156a4fe3c Shared: rename compactify', compactify'DL -> compactify, compactifyDL. 2017-01-27 21:36:45 +01:00
John MacFarlane
56f74cb0ab Removed Shared.compactify.
Changed signatures on Parsing.tableWith and Parsing.gridTableWith.
2017-01-27 21:30:35 +01:00
John MacFarlane
86b9a51ee3 benchmark: allow benchmark arguments.
These pattern match: so, '--benchmark-arguments "markdown reader"'
will only benchmark the markdown reader; with just "markdown" it
will do the writer too; with no arguments all benchmarks are run.
2017-01-27 11:29:26 +01:00
John MacFarlane
8a61d943f5 Fix up benchmarks so they compile. 2017-01-27 11:15:55 +01:00
John MacFarlane
4ccbdf4e8d Expose FileTree in Class 2017-01-27 11:15:42 +01:00
John MacFarlane
f5dd123819 HTML writer: export writeHtmlStringForEPUB.
Options: Remove writerEPUBVersion.
2017-01-27 10:27:34 +01:00
John MacFarlane
b6c1d491f5 Split writeDocbook into writeDocbook4, writeDocbook5.
Removed writerDocbookVersion in WriterOptions.
Renamed default.docbook template to default.docbook4.
Allow docbook4 as an output format.
But alias docbook = docbook4.
2017-01-26 22:40:57 +01:00
John MacFarlane
190943e1fd EPUB writer: split writeEPUB into writeEPUB2, writeEPUB3.
Also include explicit epub2 output format in CLI tool.
2017-01-26 22:09:21 +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
1105dd866c Rename default.html template to default.html4. 2017-01-25 21:47:07 +01:00
John MacFarlane
2985e0ea4f Removed unneeded exports. 2017-01-25 21:10:49 +01:00
John MacFarlane
65b8570e0e Cleanups for rebase. 2017-01-25 17:07:43 +01:00
John MacFarlane
73e343cfcd Fixed small mistake in instance for logOutput. 2017-01-25 17:07:43 +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
4e97efe857 Class: Changes around logging.
* Export getLog, setVerbosity
* Add report to PandocMonad methods.
* Redefine warning and getWarnings in terms of getLog and report.
* Remove stWarnings from CommonState, add stLog and stVerbosity.
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
6f9df9b4f1 Removed vestigial writerMediaBag from WriterOptions.
API change.
2017-01-25 17:07:43 +01:00
John MacFarlane
01483f91bd Revert "Added page breaks into Pandoc."
This reverts commit f02a12aff638fa2339192231b8f601bffdfe3e14.
2017-01-25 17:07:43 +01:00
John MacFarlane
73f57daf69 Fixed shadowing warnings. 2017-01-25 17:07:43 +01:00
John MacFarlane
00f6549629 Added extra-dep: true to stack.yaml for url deps. 2017-01-25 17:07:43 +01:00
John MacFarlane
85b9abc7a3 Compile against pandoc-types 1.18.*. 2017-01-25 17:07:43 +01:00
John MacFarlane
2bc0cbc239 Removed tests for Walk; these now live in pandoc-types. 2017-01-25 17:07:43 +01:00
John MacFarlane
e02e3aa10c Removed duplicate name in authors 2017-01-25 17:07:43 +01:00
John MacFarlane
17916f478b Put an Integer rather than Word64 behind Extensions.
This allows us to expand indefinitely.
No measurable performance penalty.
2017-01-25 17:07:42 +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
2d04922cd0 Factored out deNote in Shared. 2017-01-25 17:07:42 +01:00
John MacFarlane
8d179f7508 Removed unneeded imports. 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
a58369a7e6 Options: changed default reader/writerExtensions to emptyExtensions.
Previously they were pandocExtensions.
This didn't make sense for many formats.
2017-01-25 17:07:42 +01:00
John MacFarlane
412ed3f132 Make the smart extension affect the Markdown writer.
Thus, to "unsmartify" something that has been parsed as
smart by pandoc, you can use `-t markdown+smart`, and
straight quotes will be produced instead of curly quotes,
etc.

Example:

    % pandoc -f latex -t markdown+smart
    ``hi''---ok
    ^D
    "hi"---ok
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
1427252160 Split extensions code from Options into separate Text.Pandoc.Extensions.
API change.
However, Extensions exports Options, so this shouldn't have
much impact.
2017-01-25 17:07:42 +01:00
John MacFarlane
93e4cd9f8c Fixed something small that broke in rebase. 2017-01-25 17:07:42 +01:00
Jesse Rosenthal
5b3bfa28f4 Class: Warn instead or erroring if we can't fetch media
If deferred media can't be fetched, we catch the error and warn
instead. We add an internal function for fetching which returns a Maybe
value, and then run catMaybes to only keep the Just's.
2017-01-25 17:07:42 +01:00
Jesse Rosenthal
613588a0dc Class: Refactor fetchItem.
Move the downloading/reading-in logic out of fetchItem, so we can use it
to fill the MediaBag. Now when other modules use `fetchItem` it will
fill the MediaBag as expected.
2017-01-25 17:07:42 +01:00
Jesse Rosenthal
4b953720c8 Class: Add insertDeferredMedia function. 2017-01-25 17:07:42 +01:00
Jesse Rosenthal
55dbc00d55 Integrate DeferredMediaBag into CommonState
The DeferredMediaBag is now the object that is held in state. It should
not be visible to users, who will still deal with MediaBag through
exported getters and setters.

We now have a function `fetchDeferredMedia` which returns () but
downloads/reads in all of the deferred media.

Note that getMediaBag first fetches all deferred media.
2017-01-25 17:07:42 +01:00
Jesse Rosenthal
5814096d79 Introduce DeferredMediaBag.
This is a lazy MediaBag, that will only be evaluated (downloaded/read
in) upon demand.

Note that we use fetchItem in getDefferedMedia at the moment to read
in/download. This means that we don't need to distinguish between URIs
and FilePaths. But there is an inefficiency here: `fetchItem` will pull
an item out of the mediaBag if it's already there, and then we'll
reinsert it. We could separate out `fetchItem` into the function that
checks the MediaBag and the underlying downloader/read-inner.
2017-01-25 17:07:42 +01:00
John MacFarlane
adcd4c5b7b Use latest pandoc-citeproc for windows build. 2017-01-25 17:07:42 +01:00
John MacFarlane
f447e724cc Expose Text.Pandoc.MIME, unexpose Text.Pandoc.CSS 2017-01-25 17:07:42 +01:00
John MacFarlane
994d431172 Class: have pure instance of openURL throw an error, for now.
Later we may want to include a map of URLs and mime type, bytestring
pairs in pure state to serve as a fake internet.
2017-01-25 17:07:42 +01:00