summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
Commit message (Collapse)AuthorAge
* Removed readerSmart and the --smart option; added Ext_smart extension.John MacFarlane2017-01-25
| | | | | | | | | | | | | | | | | 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.
* Make Extensions a custom type instead of a Set Extension.John MacFarlane2017-01-25
| | | | | | | | | 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.
* Split extensions code from Options into separate Text.Pandoc.Extensions.John MacFarlane2017-01-25
| | | | | | API change. However, Extensions exports Options, so this shouldn't have much impact.
* Fixed something small that broke in rebase.John MacFarlane2017-01-25
|
* Class: Warn instead or erroring if we can't fetch mediaJesse Rosenthal2017-01-25
| | | | | | 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.
* Class: Refactor fetchItem.Jesse Rosenthal2017-01-25
| | | | | | 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.
* Class: Add insertDeferredMedia function.Jesse Rosenthal2017-01-25
|
* Integrate DeferredMediaBag into CommonStateJesse Rosenthal2017-01-25
| | | | | | | | | | | 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.
* Introduce DeferredMediaBag.Jesse Rosenthal2017-01-25
| | | | | | | | | | | | 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.
* Class: have pure instance of openURL throw an error, for now.John MacFarlane2017-01-25
| | | | | Later we may want to include a map of URLs and mime type, bytestring pairs in pure state to serve as a fake internet.
* Text.Pandoc.Shared: Removed fetchItem, fetchItem'.John MacFarlane2017-01-25
| | | | | Made changes where these are used, so that the version of fetchItem from PandocMonad can be used instead.
* Add openURL and readFileStrict to PandocMonad.John MacFarlane2017-01-25
| | | | | | | | | | | | 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.)
* Removed hush from Text.Pandoc.Shared.John MacFarlane2017-01-25
| | | | Not used anywhere.
* Removed `--normalize` option and normalization functions from Shared.John MacFarlane2017-01-25
| | | | | | | | | | | | | * 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.
* Class: Removed getDefaultReferenceDocx/ODT from PandocMonad.John MacFarlane2017-01-25
| | | | | We don't need these, since the default docx and odt can be retrieved using `readDataFile datadir "reference.docx"` (or odt).
* Removed commented-out vestigaes of fail in Class.John MacFarlane2017-01-25
|
* Class: removed 'fail' from PandocMonad.John MacFarlane2017-01-25
| | | | | | Do we need this? I don't see why. There's a name clash which would better be avoided.
* Generic instance for PandocError.John MacFarlane2017-01-25
|
* Added ReaderOptions parameter to readNative.John MacFarlane2017-01-25
| | | | | | This makes it similar to the other readers -- even though ReaderOptions is essentially ignored, the uniformity is nice.
* MediaBag: put extractMediaBag into MonadIO.John MacFarlane2017-01-25
|
* SelfContained: put makeSelfContained in MonadIO.John MacFarlane2017-01-25
|
* PDF: put makePDF in MonadIO.John MacFarlane2017-01-25
|
* Shared: put err into MonadIO.John MacFarlane2017-01-25
|
* Simplified reference-docx/reference-odt to reference-doc.John MacFarlane2017-01-25
| | | | | | | | | | | | * 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.
* Process.pipeProcess: stream stderr rather than capturing.John MacFarlane2017-01-25
| | | | | | | | | | | 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.
* RST reader: rebase-related fixes to warnings.John MacFarlane2017-01-25
|
* Removed unneeded pragmas.John MacFarlane2017-01-25
|
* Remove now-unnecessary lifts in Markdown writer.John MacFarlane2017-01-25
| | | | Other writers still TBD.
* Instances of PandocMonad for common transformers.John MacFarlane2017-01-25
|
* Class: no more MonadState CommonState.John MacFarlane2017-01-25
| | | | | | | - Added getCommonState, putCommonState, getsCommonState, modifyCommonState to PandocMonad interface. - Removed MonadState CommonState instances.
* Whitespace.John MacFarlane2017-01-25
|
* RST reader: removed now unnecessary lifts.John MacFarlane2017-01-25
|
* Markdown reader: Removed readMarkdownWithWarnings [API change].John MacFarlane2017-01-25
|
* Add PandocMonad m instance for ParserT based on PandocMonad.John MacFarlane2017-01-25
| | | | This will avoid the need for lift.
* Have warningWithPos take a SourcePos rather than Maybe SourcePos.John MacFarlane2017-01-25
| | | | After all, we have warning if you don't want the source pos info.
* LaTeX reader: add warning when parsing unescaped charactersJohn MacFarlane2017-01-25
| | | | that normally need escaping in LaTeX.
* RST reader: implement start-after, end-before fields for include.John MacFarlane2017-01-25
|
* RST reader: handle code, literal, number-lines, class, name for include.John MacFarlane2017-01-25
|
* RST reader include: handle negative values for start-, end-line.John MacFarlane2017-01-25
|
* RST reader: support start-line and end-line in include.John MacFarlane2017-01-25
| | | | Just skip other options for now.
* RST reader: Simple `.. include::` support.John MacFarlane2017-01-25
| | | | | TODO: handle the options (see comment in code). See #223.
* Class: Functions for dealing with PureStateJesse Rosenthal2017-01-25
| | | | | | | | | | | There are two states in PandocPure, but it is only easy to deal with CommonState. In the past, to do state monad operations on PureState (the state specific to PandocPure) you had to add (lift . lift) to the monadic operation and then rewrap in the newtype. This adds four functions ({get,gets,put,modify}PureState) corresponding to normal state monad operations. This allows the user to modify PureState in PandocPure without worrying about where it sits in the monad stack or rewrapping the newtype.
* Class: rename env* prefixed fields to st*.Jesse Rosenthal2017-01-25
| | | | This was left over from when they were part of an environment.
* Shared: changed err and warn output.John MacFarlane2017-01-25
| | | | | Don't print program name in either case. Print [warning] for warnings.
* LaTeX reader: Make sure we process includes in preamble.John MacFarlane2017-01-25
|
* LaTeX reader: further fixes to include.John MacFarlane2017-01-25
|
* Give source position for include file loop.John MacFarlane2017-01-25
|
* Error: change type of handleError.John MacFarlane2017-01-25
| | | | | | | | | It now lives in IO and gives a proper message + exit instead of calling 'error'. We shouldn't be making it easier for people to raise error on pure code. And this is better for the main application in IO.
* LaTeX reader: Proper include file processing.John MacFarlane2017-01-25
| | | | | | * 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.
* Removed readRSTWithWarnings (now useless).John MacFarlane2017-01-25
|