Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Errors can be thrown purely with `throwError`. At the moment there are
only three kinds of errors:
1. PandocFileReadError FilePath (for problems reading a file from the
filesystem)
2. PandocShouldNeverHappenError String (for stuff that should never
happen but we need to pattern-match anyway)
3. PandocSomeError String (a grab bag of everything else)
Of course, we need to subdivide the third item in this list.
|
|
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.
|
|
This requires a default environment. The state variables are pretty
straightforward. The env variables are a little trickier. I'm just
making most of them empty for now. Note that some of them (like
defaultReferenceDocx/ODT) will be coming out soon anyway.
|
|
Until we fix fetchItem and fetchItem' to make use of MonadError, we have
to thow an exception. We'll throw PandocFileReadError. Note that this is
temporary.
|
|
|
|
We're still compiling for 7.8 which is pre-AMP, so let's just be
explicit about it so we can use applicative notation.
|
|
|
|
Instead of Free Monad with runIO
|
|
This can be instantiated by both an IO monad or a pure State monad.
|
|
We still export a P.getPOSIXTime function, but it's just internally
defined in terms of P.getCurrentTime.
|
|
This is just defined in term of a bytestring, so we convert when necessary.
|
|
We only used it once, and then immediately converted to lazy.
|
|
|
|
We're trying to cut down the necessarily IO functions. Since we alerady
have a newStdGen function, we don't need this one.
|
|
|
|
|
|
|
|
This uses the function from shared, which will allow us to convert it
over to the free monad.
|
|
|
|
This is the first of a number of changes to bring the FB2 writer a bit
closer to the idioms used elsewhere in pandoc, so it can be more easily
converted to using the pure functions from Free.
|
|
|
|
Export TestState and TestEnv, and remove redundant import.
|
|
These work with a State monad and a Reader monad to produce
deterministic results. It can probably be simplified somewhat.
|
|
|
|
We want pure writers, so IORef shouldn't be in there. We switch to using
a normal State Monad. If this produces performance problems, we can look
into trying STRefs, but that seems like unnecessary complication at the
moment.
|
|
Using Text.Pandoc.Free, introduce pure versions of Docx, EPUB, ICML, and
ODT writers. Each of the pure versions is exported along with the IO
version (produced by running `runIO` on the pure reader). Ideally, this
should make the writers easier to test.
|
|
Introduce a new module, Text.Pandoc.Free, with pure versions, based on
the free monad, of numerous IO functions used in writers and
readers. These functions are in a pure
Monad (PandocAction). PandocAction takes as a parameter the type of
IORefs in it. It can be aliased in individual writers and readers to
avoid this parameter.
Note that this means that at the moment a reader can only use one type
of IORef. If possible, it would be nice to remove this limitation.
|
|
Update all writers to take into account page breaks.
A straightforwad, far from complete, implementation of page
breaks in selected writers.
Readers will have to follow in the future as well.
|
|
This requires an updated version of pandoc-types that
introduces PageBreak definition.
Not that this initial commit only introduces ODT pagebreaks
and distinguishes for it page breaks before, after, or both,
the paragraph, as read from the style definition.
|
|
This allows more languages to be used when using the `--listings`
option.
Closes #3374.
|
|
Removed separate 'parent' param in paraStyle.
|
|
This change makes the writer create only as many temporary
text styles as are absolutely necessary. It also consolidates
adjacent nodes with the same style.
Closes #3371.
|
|
Single-line raw blocks can be given via `#+FORMAT: raw line`, where
`FORMAT` must be one of `latex`, `beamer`, `html`, or `texinfo`.
Closes: #3366
|
|
Sometimes display math is indented with more than one colon.
Previously we handled these cases badly, generating definition
lists and missing the math.
Closes #3362.
|
|
Previously this did not properly enable escaped line breaks.
Closes #3341.
|
|
Haddock documentation strings must be associated with functions. Remove
pipe char from a comment that was moved into a `do` block in
`Readers/Org/Inlines.hs`.
|
|
Bugfix for an issue which, whenever the citation was immediately followed by a
comma, prevented correct parsing of org-ref citations.
|
|
Nested emphasis markup (e.g. `/*strong and emphasized*/`) was
interpreted incorrectly in that the inner markup was not recognized.
|
|
Change MediaWiki reader's behavior when the smart option is parsed to
match other readers' behavior.
Fix #2012.
|
|
|
|
|
|
closes #3323
|
|
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.
|
|
Unprefixed numbers where used by older org-mode versions, but are no
longer supported.
|
|
This addresses a problem of too-wide tables when empty cells
are used.
Thanks to Joost Kremers for reporting the issue.
|
|
In the past, the docx reader wrote an empty header as an empty list. It
should have the same width as a row (and be filled with empty cells).
(Note that I've reordered the code here slightly to get rid of a call to
`head`. It wasn't unsafe because it tested for null, but it was a bit of
a smell.)
|
|
Closes #3298.
|
|
Tables in MS Word are set by default to have special first-row
formatting, which pandoc uses to determine whether or not they have a
header. This means that one-row tables will, by default, have only a
header -- which we imagine is not what people want. This change
ensures that a one-row table is not understood to be a header only.
Note that this means that it is impossible to produce a header-only
table from docx, even though it is legal pandoc. But we believe that
in nearly all cases, it will be an accidental (and unwelcome) result
Closes #3285.
|
|
|