aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
AgeCommit message (Collapse)AuthorFilesLines
2017-01-25Fixed shadowing warnings.John MacFarlane1-3/+3
2017-01-25Put an Integer rather than Word64 behind Extensions.John MacFarlane1-3/+2
This allows us to expand indefinitely. No measurable performance penalty.
2017-01-25Removed writerIgnoreNotes.John MacFarlane5-17/+10
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-25Factored out deNote in Shared.John MacFarlane1-4/+4
2017-01-25Removed unused readerFileScope.John MacFarlane1-2/+0
API change.
2017-01-25Removed writerMediaBag from WriterOpts.John MacFarlane2-17/+23
...since this is now handled through PandocMonad. Added an explicit MediaBag parameter to makePDF and makeSelfContained.
2017-01-25Removed writerTeXLigatures.John MacFarlane3-6/+4
Make `smart` extension work in LaTeX/ConTeXt writers instead. Instead of `-t latex --no-tex-ligatures`, do `-t latex-smart`.
2017-01-25Made `smart` extension default for pandoc markdown.John MacFarlane1-0/+1
Updated tests.
2017-01-25Options: changed default reader/writerExtensions to emptyExtensions.John MacFarlane1-2/+2
Previously they were pandocExtensions. This didn't make sense for many formats.
2017-01-25Make the `smart` extension affect the Markdown writer.John MacFarlane1-6/+29
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-25Removed readerOldDashes and --old-dashes option, added old_dashes extension.John MacFarlane4-8/+3
API change. CLI option change.
2017-01-25Removed readerSmart and the --smart option; added Ext_smart extension.John MacFarlane9-16/+11
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-25Make Extensions a custom type instead of a Set Extension.John MacFarlane4-35/+53
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-25Split extensions code from Options into separate Text.Pandoc.Extensions.John MacFarlane2-205/+248
API change. However, Extensions exports Options, so this shouldn't have much impact.
2017-01-25Fixed something small that broke in rebase.John MacFarlane1-1/+1
2017-01-25Class: Warn instead or erroring if we can't fetch mediaJesse Rosenthal1-5/+18
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-25Class: Refactor fetchItem.Jesse Rosenthal1-38/+44
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-25Class: Add insertDeferredMedia function.Jesse Rosenthal1-0/+7
2017-01-25Integrate DeferredMediaBag into CommonStateJesse Rosenthal1-10/+17
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-25Introduce DeferredMediaBag.Jesse Rosenthal1-0/+24
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-25Class: have pure instance of openURL throw an error, for now.John MacFarlane1-1/+1
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-25Text.Pandoc.Shared: Removed fetchItem, fetchItem'.John MacFarlane9-108/+58
Made changes where these are used, so that the version of fetchItem from PandocMonad can be used instead.
2017-01-25Add openURL and readFileStrict to PandocMonad.John MacFarlane1-38/+98
Removed fetchItem and fetchItem'. Provide fetchItem in PandocMonad (it uses openURL and readFileStrict). TODO: - PandocPure instance for openURL. - Fix places where fetchItem is used so that we trap the exception instead of checking for a Left value. (At least in the places where we want a warning rather than a failure.)
2017-01-25Removed hush from Text.Pandoc.Shared.John MacFarlane2-8/+3
Not used anywhere.
2017-01-25Removed `--normalize` option and normalization functions from Shared.John MacFarlane5-159/+20
* 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-25Class: Removed getDefaultReferenceDocx/ODT from PandocMonad.John MacFarlane3-25/+7
We don't need these, since the default docx and odt can be retrieved using `readDataFile datadir "reference.docx"` (or odt).
2017-01-25Removed commented-out vestigaes of fail in Class.John MacFarlane1-8/+0
2017-01-25Class: removed 'fail' from PandocMonad.John MacFarlane2-13/+13
Do we need this? I don't see why. There's a name clash which would better be avoided.
2017-01-25Generic instance for PandocError.John MacFarlane1-1/+2
2017-01-25Added ReaderOptions parameter to readNative.John MacFarlane1-2/+4
This makes it similar to the other readers -- even though ReaderOptions is essentially ignored, the uniformity is nice.
2017-01-25MediaBag: put extractMediaBag into MonadIO.John MacFarlane1-3/+7
2017-01-25SelfContained: put makeSelfContained in MonadIO.John MacFarlane1-2/+3
2017-01-25PDF: put makePDF in MonadIO.John MacFarlane1-4/+6
2017-01-25Shared: put err into MonadIO.John MacFarlane1-2/+2
2017-01-25Simplified reference-docx/reference-odt to reference-doc.John MacFarlane3-6/+4
* 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-25Process.pipeProcess: stream stderr rather than capturing.John MacFarlane2-27/+15
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-25RST reader: rebase-related fixes to warnings.John MacFarlane1-13/+12
2017-01-25Removed unneeded pragmas.John MacFarlane1-2/+1
2017-01-25Remove now-unnecessary lifts in Markdown writer.John MacFarlane1-9/+6
Other writers still TBD.
2017-01-25Instances of PandocMonad for common transformers.John MacFarlane1-2/+79
2017-01-25Class: no more MonadState CommonState.John MacFarlane1-14/+23
- Added getCommonState, putCommonState, getsCommonState, modifyCommonState to PandocMonad interface. - Removed MonadState CommonState instances.
2017-01-25Whitespace.John MacFarlane1-3/+3
2017-01-25RST reader: removed now unnecessary lifts.John MacFarlane1-8/+7
2017-01-25Markdown reader: Removed readMarkdownWithWarnings [API change].John MacFarlane1-10/+1
2017-01-25Add PandocMonad m instance for ParserT based on PandocMonad.John MacFarlane1-6/+4
This will avoid the need for lift.
2017-01-25Have warningWithPos take a SourcePos rather than Maybe SourcePos.John MacFarlane4-20/+30
After all, we have warning if you don't want the source pos info.
2017-01-25LaTeX reader: add warning when parsing unescaped charactersJohn MacFarlane1-4/+5
that normally need escaping in LaTeX.
2017-01-25RST reader: implement start-after, end-before fields for include.John MacFarlane1-6/+12
2017-01-25RST reader: handle code, literal, number-lines, class, name for include.John MacFarlane1-30/+27
2017-01-25RST reader include: handle negative values for start-, end-line.John MacFarlane1-23/+30