Commit graph

7694 commits

Author SHA1 Message Date
Jesse Rosenthal
f22bc52864 Remove GetPOSIXTime from Free monad.
We still export a P.getPOSIXTime function, but it's just internally
defined in terms of P.getCurrentTime.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
2ffd630a43 Free: Remove readFileUTF8.
This is just defined in term of a bytestring, so we convert when necessary.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
314a4c7296 Remove readFileStrict.
We only used it once, and then immediately converted to lazy.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
c9e67163fd Remove IO UUID functions. 2017-01-25 17:07:39 +01:00
Jesse Rosenthal
8b144db6e5 Write Pure uuid function taking stdgen.
We're trying to cut down the necessarily IO functions. Since we alerady
have a newStdGen function, we don't need this one.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
1c589c51b1 ODT Writer: fix compiler complaint. 2017-01-25 17:07:39 +01:00
Jesse Rosenthal
f404412331 Free: Add Typeable instance to PandocActionError 2017-01-25 17:07:39 +01:00
Jesse Rosenthal
2ea3e77172 Finish pure writer of FB2. 2017-01-25 17:07:39 +01:00
Jesse Rosenthal
e711043dee FB2 writer: Rewrite image-fetching to use fetchItem.
This uses the function from shared, which will allow us to convert it
over to the free monad.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
30cfda7a71 Continue refactoring FB2 writer. 2017-01-25 17:07:39 +01:00
Jesse Rosenthal
d97fb5f3c6 FB2 writer: bring functions to toplevel.
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.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
9ac1303660 Make pure rtf writer using free. 2017-01-25 17:07:39 +01:00
Jesse Rosenthal
590e119df0 Fix up compiler warnings.
Export TestState and TestEnv, and remove redundant import.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
e24d5a56a7 Implement runTest functions.
These work with a State monad and a Reader monad to produce
deterministic results. It can probably be simplified somewhat.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
072107d1a2 Remove IORef from EPUB writer. 2017-01-25 17:07:39 +01:00
Jesse Rosenthal
8d1d0eb9a5 Remove IORef from ODT writer.
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.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
32c68dada9 Introduce pure versions of IO Writers.
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.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
0ab4af2f03 New Free module, with pure versions of IO funcs
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.
2017-01-25 17:07:39 +01:00
Hubert Plociniczak
a6b469c02b Adds support for pagebreaks (when it makes sense)
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.
2017-01-25 17:07:39 +01:00
Hubert Plociniczak
30b3412857 Added page breaks into Pandoc.
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.
2017-01-25 17:07:39 +01:00
John MacFarlane
5a03ebf05b Copied a few changes from default.latex to default.beamer.
(Wandmalfarbe)
2017-01-25 17:05:55 +01:00
John MacFarlane
a5d855d342 Update list of listings languages in Highlighting.
This allows more languages to be used when using the `--listings`
option.

Closes #3374.
2017-01-25 12:35:14 +01:00
John MacFarlane
6d751cb386 OpenDocument writer: small refactoring.
Removed separate 'parent' param in paraStyle.
2017-01-24 15:01:39 +01:00
John MacFarlane
77e8682a73 Update latex writer test for template change. 2017-01-24 15:01:11 +01:00
John MacFarlane
207b3f7e40 Changed position of \VerbatimNotes and fancyvrb in latex, beamer templates.
This fixes hyperlinks on footnotes in documents that contain
verbatim in notes.

(Note: the beamer template was updated to match the LaTeX template, but
at this point verbatim in notes seems not to work in beamer.)

Closes #3361.
2017-01-24 14:48:38 +01:00
ickc
74875695e2 travis: catch #3372 (#3373) 2017-01-24 10:29:54 +01:00
John MacFarlane
41f4476aab OpenDocument writer: don't profilerate text styles unnecessarily.
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.
2017-01-23 15:18:34 +01:00
John MacFarlane
faf4f7818b Use skylighting 0.1.1.1 in stack.yaml. 2017-01-21 23:30:24 +01:00
Albert Krewinkel
5729f1f2ea
Org reader: allow short hand for single-line raw blocks
Single-line raw blocks can be given via `#+FORMAT: raw line`, where
`FORMAT` must be one of `latex`, `beamer`, `html`, or `texinfo`.

Closes: #3366
2017-01-19 20:33:05 +01:00
John MacFarlane
aad7c3bf54 windows stack.yaml - use latest skylighting. 2017-01-19 20:04:02 +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
937b502923 Use skylighting 0.1.1.
Closes #3363.
2017-01-19 15:56:19 +01:00
John MacFarlane
06bdb8dbab MediaWiki reader: improved handling of display math.
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.
2017-01-19 11:24:19 +01:00
bumper314
5bd571f499 Fix sample.lua barfing on Raw data (#3358)
* Fix for "pandoc: user error (Incorrect result type (string expected, got nil))." when the source format contains Raw data.

* Update sample.lua
2017-01-18 12:47:15 +01:00
ickc
117f3d2323 travis: download stack only in stack BUILD (#3357) 2017-01-17 14:09:02 +01:00
Mauro Bieg
1b2ba57270 fix internal link in INSTALL.md 2017-01-17 10:20:14 +01:00
John MacFarlane
1dc4b3925d Clarify that blank space is needed around footnotes.
Closes #3352.
2017-01-15 10:51:49 +01:00
Albert Krewinkel
c743e93912 Rearrange and extend badges in README (#3354)
* Reorganize badges to get a more harmonic look

* Add homebrew badge

* Add badge for pandoc-discuss google group
2017-01-15 10:48:28 +01:00
Alexey Rogachev
94513e3744 Fixed typo (#3351) 2017-01-13 22:15:06 +01:00
John MacFarlane
c56669ec39 Allow vector 0.12.0.0. 2017-01-10 17:05:29 +01:00
John MacFarlane
072e5a7d20 LaTeX template: Add hyphen option to url package. 2017-01-10 17:05:25 +01:00
John MacFarlane
4781819a6b Fixed -f markdown_github-hard_line_breaks+escaped_line_breaks.
Previously this did not properly enable escaped line breaks.
Closes #3341.
2017-01-08 10:01:19 +01:00
John MacFarlane
d719d79ebc Added instructions for manual install from oxs, win packages. 2017-01-07 12:52:44 +01:00
Albert Krewinkel
4da41bdb8e
Remove pipe char irking the haddock coverage tool
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`.
2017-01-06 18:59:07 +01:00
Albert Krewinkel
4ca420e937
Org reader: accept org-ref citations followed by commas
Bugfix for an issue which, whenever the citation was immediately followed by a
comma, prevented correct parsing of org-ref citations.
2017-01-06 18:22:19 +01:00
Albert Krewinkel
21e6ca1976 Org reader: ensure emphasis markup can be nested
Nested emphasis markup (e.g. `/*strong and emphasized*/`) was
interpreted incorrectly in that the inner markup was not recognized.
2017-01-05 23:30:46 +01:00
tgkokk
f2e3e756f8 MediaWiki reader: Fix quotation mark parsing (#3336)
Change MediaWiki reader's behavior when the smart option is parsed to
match other readers' behavior.

Fix #2012.
2017-01-05 21:24:33 +01:00
John MacFarlane
2d8d735bb7 LaTeX template: allow passing microtypeoptions to microtype.
Thanks to Vaclav Haisman.
2017-01-03 21:04:50 -08:00
John MacFarlane
66fc644ddb Allow aeson 1.1. 2017-01-02 12:13:35 -08:00