John MacFarlane
9ab30c6495
Writers.Shared: export metaToJSON', addVariablesToJSON.
...
This allows us to add the variables AFTER using the metadata
to generate a YAML header (in the Markdown writer).
Addresses the problem shown by
https://travis-ci.org/jgm/pandoc/jobs/205154181#L705
See #3439
2017-02-25 23:13:23 +01:00
John MacFarlane
03941ca9b0
Writers.Shared: Changed metaToJSON a bit.
...
Now we handle metadata first, then variables.
This way, meta-json variable will not contain representations of
variables, only proper metadata.
2017-02-25 22:59:16 +01:00
John MacFarlane
bd5df466d7
AsciiDoc writer: use PandocMonad throughout.
...
Issues info messages for non-rendered raw content.
2017-02-25 22:29:38 +01:00
John MacFarlane
da792c63ca
Expose some unexposed modules.
...
+ Text.Pandoc.Writers.Shared
+ Text.Pandoc.Parsing
+ Text.Pandoc.Asciify
+ Text.Pandoc.Emoji
+ Text.Pandoc.ImageSize
[API change]
These are often helpful to people writing their own
reader or writer modules. Closes #3260 .
2017-02-25 22:07:01 +01:00
John MacFarlane
e1304aa59c
Fetch images when generating PDF via context.
...
To do this, we create the temp directory as a subdirectory
of the working directory. Since context mk IV by default looks
for images in the parent directory, this works.
Closes #3380 .
2017-02-25 21:46:41 +01:00
John MacFarlane
654859af4a
Docx writer: use Set for dynamic styles to avoid duplicates.
2017-02-25 20:47:58 +01:00
John MacFarlane
5441e11b06
Docx writer: bookmarks for Span with id.
...
And cleaned up code.
2017-02-25 20:41:44 +01:00
John MacFarlane
f8f3b69c25
Docx writer bookmark improvements.
...
- Bookmark start/end now surrounds content rather than preceding it.
- Bookmarks generated for Div with id. Fixes jgm/pandoc-citeproc#205 .
- Cleaner code for handling dir and style attributes for Div.
2017-02-25 15:51:53 +01:00
John MacFarlane
3a1a50a45f
Make --ascii
work with DocBook output too.
2017-02-25 13:35:34 +01:00
John MacFarlane
7d0082aa0b
LaTeX reader: allow hspace and vspace to count as raw block or inline.
...
Previously we would refuse to parse anything as raw inline if
it was in the blockCommands list. Now we allow exceptions
if they're listed under ignoreInlines in inlineCommands.
This should make it easier e.g. to include an \hspace
between two side-by-side raw LaTeX tables.
2017-02-25 12:43:00 +01:00
John MacFarlane
f1cf8273d5
Revert "LaTeX reader: don't treat \vspace
and \hspace
as block commands."
...
This reverts commit 2873cd8288
.
2017-02-25 12:43:00 +01:00
Or Neeman
fa43e36449
Fix stale references to tests
directory ( #3469 )
...
Some of the benchmarks were failing due to references to files in the
`tests` directory, which is now called `test`. A search found other
references to it also. This commit updates all these references.
2017-02-25 10:31:40 +01:00
John MacFarlane
59c673c613
Fixed link to mac uninstaller script.
2017-02-24 16:07:56 +01:00
John MacFarlane
a3741a45ab
Removed unnecessary import.
2017-02-24 15:57:10 +01:00
John MacFarlane
d3e5725cbc
Use catchError instead of runExceptT.
2017-02-24 15:55:40 +01:00
John MacFarlane
0448b7d1fc
Implemented \graphicspath
in LaTeX reader.
...
Closes #736 .
2017-02-24 15:34:41 +01:00
John MacFarlane
b8674519d5
Removed useless TEXINPUTS stuff for context2pdf.
...
mkiv context doesn't use TEXINPUTS.
2017-02-24 14:34:58 +01:00
John MacFarlane
72af7b4ee5
Shared: remove 'warn'.
...
PDF writer: Use 'report' instead of 'warn', make it sensitive
to verbosity settings.
2017-02-24 14:29:56 +01:00
John MacFarlane
887d0b70fe
Logging: Remove UsingResourceFrom, add CouldNotConvertImage
2017-02-24 14:29:54 +01:00
John MacFarlane
1c84855aab
Class: Add stResourcePath to CommonState, getResourcePath, setResourcePath.
...
To be used in implementing `\graphicspath` in LaTeX, and possibly
in things like PDF production via context.
Use resource path in fetchItem.
Issue an info message if we get a resource from somewhere other
than ".".
Added UsingResourceFrom to log message.
2017-02-24 14:15:10 +01:00
John MacFarlane
6936747794
EPUB reader: minor refactoring, avoiding explicit MediaBag handling.
...
This all works behind the scenes in CommonState plumbing.
2017-02-24 13:39:20 +01:00
John MacFarlane
ce647d1cd8
Some fixes to the preceding revisions in SelfContained.
...
Make sure we don't duplicate end tags for script or link.
2017-02-24 13:11:29 +01:00
John MacFarlane
7c0a80c323
SelfContained: don't use data URIs for script or style.
...
Instead, just use script or style tags with the content inside.
The old method with data URIs prevents certain optimizations
outside pandoc.
Exception: data URIs are still used when a script contains
`</script>` or a style contains `</`.
Closes #3423 .
Also, in MIME, use application/javascript (not
application/x-javascript).
2017-02-24 11:55:50 +01:00
John MacFarlane
0e8b19e709
Refactored getData from getDataURI in SelfContained.
2017-02-24 11:27:52 +01:00
John MacFarlane
6beeb49b75
Updated table tests.
2017-02-23 22:34:10 +01:00
John MacFarlane
f3d81056d6
Removed \strut
at beginning of table cells.
...
This fixes a problem with alignment of lists in table cells
(closes #3436 ). The `\strut` at the end seems to be enough
to avoid the too-close spacing that motivated addition of
the strut in #1573 .
2017-02-23 22:25:08 +01:00
John MacFarlane
35922ffa32
Removed unnecessary import.
2017-02-23 21:54:03 +01:00
John MacFarlane
4739620afe
Special-case .stretch class for images in reveal.js.
...
Now in reveal.js, an image with class `stretch` in a paragraph
by itself will stretch to fill the whole screen, with no
caption or figure environment.
Closes #1291 .
2017-02-23 21:16:45 +01:00
John MacFarlane
ad2e19a41f
Fix compiler warning for older GHC versions.
2017-02-23 21:00:35 +01:00
John MacFarlane
61d3376a45
Restore "Fetching..." message with openURL if --verbose.
2017-02-23 16:24:20 +01:00
John MacFarlane
e08e93e844
Use PandocIOError in Class.
2017-02-23 16:21:59 +01:00
John MacFarlane
de5102a22c
Error: Changed PandocFileReadError to PandocIOError
2017-02-23 16:21:49 +01:00
John MacFarlane
4a9069130f
Shared.openURL: Changed type from an Either.
...
Now it will just raise an exception to be trapped later.
2017-02-23 16:21:03 +01:00
John MacFarlane
2d964dd4ee
PDF: make sure that verbosity is respected when we fetch items.
2017-02-23 15:06:49 +01:00
John MacFarlane
2bbf98a613
Put makeSelfContained in PandocMonad instead of IO.
...
This removes the need to pass MediaBag around and improves
exceptions. It also opens up the possibility of using
makeSelfContained purely.
2017-02-23 15:06:25 +01:00
John MacFarlane
a38f847484
Use latest pandoc-citeproc commit in pkg.yaml.
2017-02-23 10:16:57 +01:00
John MacFarlane
86d8e1ef89
Pretty: simplified definition of realLength.
2017-02-23 09:54:31 +01:00
John MacFarlane
9614835ea7
Added emf to mimeTypes with type application/x-msmetafile.
...
See #1713 .
2017-02-22 21:20:40 +01:00
John MacFarlane
f4a452f891
When parsing raw LaTeX commands, include trailing space.
...
Otherwise things like `\noindent foo` break and turn into
`\noindentfoo`.
Affects `-f latex+raw_tex` and `-f markdown` (and other formats
that allow `raw_tex`).
Closes #1773 .
2017-02-22 21:15:25 +01:00
Mauro Bieg
e51b32a475
Merge pull request #3464 from mb21/determine-svg-size
...
make imageSize recognize basic SVG dimensions, see #3462
2017-02-22 18:32:02 +01:00
mb21
3f6b50e525
imageSize interface change
...
`imageSize img` is now `imageSize opts img`
2017-02-22 15:34:53 +01:00
mb21
b312ac6d2d
make imageSize recognize basic SVG dimensions, see #3462
2017-02-22 15:34:53 +01:00
John MacFarlane
c2e4ea10b3
MANUAL: Document that content above slide-level will be omitted...
...
in slide shows. See #3460 , #2265 .
2017-02-22 14:04:30 +01:00
John MacFarlane
5d71e37f26
MediaWiki reader: ensure that list starts begin at left margin.
...
Including when they're in tables or other list items.
Closes #2606 .
2017-02-21 23:41:32 +01:00
John MacFarlane
f90b82d3d9
MediaWiki writer: Remove newline before </ref>
.
...
Closes #2652 .
2017-02-21 23:03:10 +01:00
John MacFarlane
e462f80d74
MediaWiki writer: add display attribute on <math>
tags.
...
This allows display math to be rendered properly.
Closes #3452 .
2017-02-21 22:57:48 +01:00
John MacFarlane
5269724ad3
MediaWiki reader: fixed more table issues.
...
Closes #2649 .
2017-02-21 21:28:24 +01:00
John MacFarlane
1d06e8c5a5
MediaWiki reader: Allow blank line after table start.
...
See #2649 .
2017-02-21 18:34:21 +01:00
John MacFarlane
598ffa3a94
MediaWiki tables: allow extra hyphens after |-
in tables.
...
I didn't see this documented anywhere, but it seems to be allowed
(and common).
See #2649 . This addresses some of the cases there, but not all.
2017-02-21 17:30:13 +01:00
John MacFarlane
7af3d90ae1
MediaWiki writer: Updated list of syntax highlighting languages.
...
Now 'r' gets you `<source>` rather than `<code>` (among others).
Closes #3461 .
2017-02-21 17:13:59 +01:00