John MacFarlane
17e48ba81e
Merge pull request #1494 from jkr/math-module
...
Math module
2014-08-07 13:44:19 -07:00
Jesse Rosenthal
7bd7d4d476
Docx reader: Handle inline drawings.
...
Previous drawings that were under some other toplevel run (i.e., a
hyperlink) wouldn't be properly handled. This should fix that.
2014-08-07 15:01:05 -04:00
Jesse Rosenthal
d293dd528b
OMath module: Add new file.
2014-08-07 12:41:33 -04:00
Jesse Rosenthal
a7967d1aef
Docx reader: Split math out into math module.
...
Could use some cleanup, but this is the first step for getting
an OMML reader into TeXMath.
2014-08-07 12:20:22 -04:00
Matthew Pickering
13f26af84f
Docx Reader: Added Default instances and removed withDState
...
Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>
2014-08-06 19:15:33 -04:00
Jesse Rosenthal
91ab2f155f
Get rid of unused docx variable.
...
Since changing the Docx type, this is no longer necessary. Thanks to
Matthew Pickering for picking up on this.
2014-08-06 12:19:24 -04:00
John MacFarlane
444b1c2ad8
Merge pull request #1491 from jkr/texmath-equations
...
Docx Reader: Use TeXMath for writing equations.
2014-08-06 09:07:00 -07:00
Jesse Rosenthal
cd9ca5a18a
Docx reader: remove now-unnecessary state variable.
...
This also introduces a `defaultDState` value.
2014-08-06 11:20:41 -04:00
Jesse Rosenthal
cdd769624f
Remove now-unnecessary TexChar
...
TeXMath does the work now.
2014-08-06 11:20:41 -04:00
Jesse Rosenthal
06488c95fa
Add a note on how mapD
works.
2014-08-06 11:20:41 -04:00
Jesse Rosenthal
3bc2ea4cf7
Docx reader: Use TeXMath to write math
...
The new version of TeXMath can translate from its type system into
LaTeX. So instead of writing the LaTeX ourself, we write to the TeXMath
`Exp` type, and let TeXMath do the rest.
2014-08-06 11:20:27 -04:00
Uli Köhler
9d07db933c
MediaWiki reader doesn't recognize german "Bild"
2014-08-06 00:47:23 +02:00
Matthew Pickering
b04bb3b6d2
MediaBag: Improved normalisation when writing files
2014-08-05 11:02:23 +01:00
John MacFarlane
2de2842bdd
Merge pull request #1486 from Aelve/minor
...
Very minor cleanup and readability changes
2014-08-04 22:07:02 -07:00
John MacFarlane
39b59b7603
Merge pull request #1476 from jkr/endnote-fix
...
Docx Parser: Produce endnotes.
2014-08-04 21:59:58 -07:00
John MacFarlane
d71b013841
HTML reader: ignore <?xml..> and <DOCTYPE..> tags.
...
Previously they were parsed as raw.
2014-08-04 18:39:39 -07:00
John MacFarlane
40d8100d44
Use texmath 0.7 interface.
2014-08-04 11:13:09 -07:00
Artyom Kazak
141fdf944a
Add PatternGuards pragmas.
2014-08-04 19:58:25 +04:00
Artyom Kazak
eb88444452
Remove redundant isHexDigit function.
2014-08-04 19:58:25 +04:00
Artyom Kazak
e51a2cedf9
Remove dangling where
from one function.
2014-08-04 19:58:25 +04:00
Artyom Kazak
82118b3328
Use stripPrefix
where appropriate.
2014-08-04 19:57:42 +04:00
Artyom Kazak
feebab9740
Clean up mediaTypeOf
a bit.
2014-08-04 19:41:37 +04:00
Artyom Kazak
f659644fcc
Use mapM_
instead of () <$ mapM
in one place.
2014-08-04 19:41:37 +04:00
John MacFarlane
4630cff2a6
Merge branch 'epubend' of https://github.com/mpickering/pandoc into mpickering-epubend
...
Conflicts:
pandoc.cabal
2014-08-04 07:36:18 -07:00
Artyom Kazak
ec88d47f23
Correctly implement capitalisation.
...
Using `map toUpper` to capitalise text is wrong, as e.g.
“Straße” should be converted to “STRASSE”, which is 1 character
longer. This commit adds a `capitalize` function and replaces
2 identical implementations in different modules (`toCaps` and
`capitalize`) with it.
2014-08-03 17:37:37 +04:00
John MacFarlane
842c705097
SelfContained: Fixed determining of source URL from within CSS files.
...
(This fixes a bug introduced a couple commits back.)
2014-08-02 16:33:22 -07:00
John MacFarlane
85ff3c5771
fetchItem: improved mime type guessing.
...
Strip a fragment like `?#iefix` from the extension before doing
the mime lookup.
2014-08-02 16:32:11 -07:00
John MacFarlane
1d137fbed6
Shared: fetchItem improvements.
...
* More consistent logic: absolute URIs are fetched from the net;
other things are treated as relative URIs if sourceURL is a Just,
otherwise as file paths.
* We escape characters that are not allowed in URIs before trying
to parse them (e.g. '|', which often occurs in the wild).
* When treating relative paths as local file paths, we drop
any fragment or query. This is useful e.g. when you've downloaded
web fonts locally, but your source still contains the original
relative URLs.
Together with the previous commit, this should close #1477 .
2014-08-02 16:12:05 -07:00
John MacFarlane
ce8922437d
Text.Pandoc.SelfContained changes.
...
* mkSelfContained now takes just two arguments, WriterOptions and
the string.
* It no longer looks in data files. This only made sense when we
had copies of slidy and S5 code there.
* Shared.fetchItem' is used instead of the nearly duplicate getItem.
2014-08-02 16:07:19 -07:00
Jesse Rosenthal
3a411c3307
Docx Parser: Produce endnotes.
...
The parser had been changing footnotes and endnotes into footnotes. This
isn't a problem, because pandoc collapses them, but the parser should
maintain as much of the docx structure as is collapsed, and let the
toplevel reader worry about how to translate it into Pandoc. (This would
be an issue when, as is planned, the docx parser spins off into its
own module.)
The output is the same, so no test change is required.
2014-08-01 09:16:42 -04:00
Jesse Rosenthal
57939a9282
Docx Reader: Single underlines are "emph"
...
All other underlines are ignored.
2014-07-31 18:44:41 -04:00
Matthew Pickering
cd9a5d90cb
EPUB Reader: Now uses the new MediaBag for images
2014-07-31 22:48:08 +01:00
Matthew Pickering
8460ea417f
EPUB Reader: Integrated into program
2014-07-31 21:39:50 +01:00
Matthew Pickering
51051e9953
HTML Reader: Added ability to read MathML formatted <math> blocks
2014-07-31 21:39:50 +01:00
Matthew Pickering
7c1f867397
HTML Reader: Added support for anchors on links and list items
2014-07-31 21:39:50 +01:00
Matthew Pickering
266e1977e0
HTML Reader: Extended HTML Reader to recognise EPUB specific elements
2014-07-31 21:39:49 +01:00
Matthew Pickering
002ae95d7a
Options: Added option to turn on epub html extensions
2014-07-31 21:39:49 +01:00
Matthew Pickering
b57e554b59
Except Compat: Updated to export more module functions
2014-07-31 21:39:49 +01:00
Matthew Pickering
089745af61
EPUB Reader: Added EPUB reader
2014-07-31 21:39:49 +01:00
John MacFarlane
6dd2418476
New module, Text.Pandoc.MediaBag.
...
Moved `MediaBag` definition and functions from Shared:
`lookupMedia`, `mediaDirectory`, `insertMedia`, `extractMediaBag`.
Removed `emptyMediaBag`; use `mempty` instead, since `MediaBag`
is a Monoid.
2014-07-31 12:00:21 -07:00
John MacFarlane
00662faefb
Made MediaBag a newtype, and added mime type information to media.
...
Shared now exports functions for interacting with a MediaBag:
- `emptyMediaBag`
- `lookuMedia`
- `insertMedia`
- `mediaDirectory`
- `extractMediaBag`
2014-07-31 11:05:35 -07:00
Matthew Pickering
31e7c1b67c
Shared: Added function insertMedia which is an alias for M.insert
2014-07-31 15:47:49 +01:00
John MacFarlane
f1885ae799
Removed deprecated and no longer used readerStrict in ReaderOptions.
...
This is handled by readerExtensions now.
2014-07-30 18:32:06 -07:00
John MacFarlane
71e76175be
getT2TMeta: Take list of source files instead of single.
...
Get latest modification time.
2014-07-30 17:25:00 -07:00
John MacFarlane
e4913d6dba
Allow --self-contained to get content from MediaBag.
...
Added a parameter to makeSelfContained (API change).
2014-07-30 15:26:40 -07:00
John MacFarlane
23d806644f
RTF writer: Improved image embedding.
...
Use calculated sizes.
2014-07-30 14:49:57 -07:00
John MacFarlane
e365af9c23
RTF writer: refactored image embedding, using fetchItem'.
2014-07-30 14:27:51 -07:00
John MacFarlane
234652a4b8
PDF, Docx, EPUB, and ODT writers now automatically use MediaBag.
...
The MediaBag is thread through from the reader, with no need
to extract to files.
2014-07-30 14:07:31 -07:00
John MacFarlane
28321a18bf
Shared: Added fetchItem', which searches a media bag too.
2014-07-30 13:47:07 -07:00
John MacFarlane
67c5c7a575
Moved MediaBag back from Shared to Options, to avoid module cycle.
2014-07-30 13:46:48 -07:00