Commit graph

5235 commits

Author SHA1 Message Date
Jesse Rosenthal
85f8d92850 Powerpoint writer: Ignore Notes div
For now, ignore notes div for parity with other slide outputs.
2018-01-03 22:07:07 -05:00
Jesse Rosenthal
bf15258d3b Powerpoint writer: Set default slidelevel correctly.
We had previously defaulted to slideLevel 2. Now we use the correct
behavior of defaulting to the highest level header followed by
content. We change an expected test result to match this behavior.
2018-01-03 21:58:39 -05:00
Jesse Rosenthal
41dc65b37f Powerpoint writer: Split blocks correctly for linked images
We treat links with an image as the first inline as an image with a
link picProp -- so we have to split on it the same as if it were an
image.
2018-01-03 20:52:48 -05:00
Jesse Rosenthal
101aece6cc Powerpoint writer: combine adjacent runs.
This will make the xml easier to read for debugging purposes. It
should also make links behave more consistently across numerous words.
2018-01-03 17:54:43 -05:00
Jesse Rosenthal
02d85469ab Powerpoint writer: Fix new replaceNamedChildren
Previous version replaced *each* element from the template with the
new elements -- leading to multiple overlapping frames. This only
replaces the first instance, and throws out the rest.
2018-01-03 16:55:33 -05:00
Jesse Rosenthal
6aae439980 PowerPoint writer: make inline code inherit code size.
Previously (a) the code size wasn't set when we force size, and (b)
the properties was set from the default, instead of inheriting. Both
of those problems were fixed.
2018-01-03 15:33:18 -05:00
Jesse Rosenthal
13990c0501 Powerpoint writer: simplify replaceNamedChildren function
A lot of work in the powerpoint writer is replacing XML from within
slidelayouts from templates. This function does a good deal of that
work, and this makes it preserve element order, as well as making it a
bit easier to understand.
2018-01-03 14:29:09 -05:00
Jesse Rosenthal
1ce736c2df Powerpoint writer: code cleanup
Remove commented-out functions and imports.
2018-01-03 13:36:12 -05:00
Jesse Rosenthal
143ec05bd9 Powerpoint writer: Allow linked images.
The following markdown:

    [![Image Title](image.jpg)](http://www.example.com)

will now produce a linked image in the resulting PowerPoint file.
2018-01-03 13:00:52 -05:00
Jesse Rosenthal
cd00225219 PowerPoint writer: Fix error with empty table cell.
We require an empty "<a:p>" tag, even if the cell contains no
paragraphs -- otherwise PowerPoint complains of corruption.
2018-01-03 11:56:41 -05:00
Jesse Rosenthal
2f5cca85fa Powerpoint writer: Fix compiler error (again)
The record syntax in a pattern match seems to be confusing the 8.X
compilers. Stop using it.
2018-01-03 11:17:24 -05:00
Jesse Rosenthal
576ed3f416 Powerpoint writer: Appease compiler 2018-01-03 11:00:49 -05:00
Jesse Rosenthal
dcc6e6b777 Powerpoint writer: Implement two-column slides.
This uses the columns/column div format described in the pandoc
manual. At the moment, only two columns (half the screen each) are
allowed. Custom widths are not supported.
2018-01-03 10:18:43 -05:00
John MacFarlane
7c7f3a89d1
Merge pull request #4219 from stalmon/master
fixes for docx writer
2018-01-02 11:34:30 -07:00
Jesse Rosenthal
a55a1e3a57 Docx reader: remove MultiWayIf
Different formatting rules across 7.X and 8.X. Use empty case
expression instead.
2018-01-02 11:45:22 -05:00
Jesse Rosenthal
2e90e2932c Docx reader: Allow for insertion/deletion of paragraphs.
If the paragraph has a deleted or inserted paragraph break (depending
on the track-changes setting) we hold onto it until the next
paragraph. This takes care of accept and reject. For this we introduce
a new state which holds the ils from the previous para if necessary.

For `--track-changes=all`, we add an empty span with class
`paragraph-insertion`/`paragraph-deletion` at the end of the paragraph
prior to the break to be inserted or deleted.

Closes #3927.
2018-01-02 11:31:20 -05:00
Jesse Rosenthal
2746f73093 Docx reader: Parse track changes info into paragraph props.
This will tell us whether a paragraph break was inserted or
deleted. We add a generalized track-changes parsing function, and use
it in `elemToParPart` as well.
2018-01-02 10:47:33 -05:00
Jesse Rosenthal
f6fde0ae5e Docx reader: Extract tracked changes type from parpart.
We're going to want to use it elsewhere as well, in upcoming tracking
of paragraph insertion/deletion.
2018-01-02 07:50:08 -05:00
Sebastian Talmon
053a1dcd10
firstRow table definition compatibility for Word 2016
Word 2016 seems to use a default value of "1" for table headers, if there is no firstRow definition (although a default value of 0 is documented), so all tables get the first Row formatted as header.
Setting the parameter to 0 if the table has no header row fixes this for Word 2016
2018-01-02 09:43:04 +01:00
John MacFarlane
b9d73428c7 Docx writer: Fix custom styles with spaces in the name.
Custom styles with spaces worked for divs but not for spans.
This commit fixes the problem.  Closes #3290.
2018-01-01 21:44:06 -08:00
John MacFarlane
5733183b3d Markdown reader: rewrite inlinesInBalancedBrackets.
The rewrite is much more direct, avoiding parseFromString.
And it performs significantly better; unfortunately, parsing
time still increases exponentially.

See #1735.
2018-01-01 16:42:19 -08:00
stalmon
4f43a1d250
Removed redundant subtitle in title
subtitle is allready used to create a subtitle for the document
appending the subtitle to the main title leads to double subtitle in the document
2018-01-02 01:14:36 +01:00
John MacFarlane
ecc46e229f Lua.Module.Utils: make stringify work on MetaValues.
I'm sure this was intended in the first place, but currently
only Meta is supported.
2018-01-01 14:11:49 -08:00
Jesse Rosenthal
e6b04fa0cf Docx reader: minor cleanup. 2017-12-31 10:18:03 -05:00
Jesse Rosenthal
836153de43 Docx Reader: Combine adjacent anchors.
There isn't any reason to have numberous anchors in the same place,
since we can't maintain docx's non-nesting overlapping. So we reduce
to a single anchor, and have all links pointing to one of the
overlapping anchors point to that one. This changes the behavior from
commit e90c714c7 slightly (use the first anchor instead of the last)
so we change the expected test result.

Note that because this produces a state that has to be set after every
invocation of `parPartToInlines`, we make the main function into a
primed subfunction `parPartToInlines'`, and make `parPartToInlines` a
wrapper around that.
2017-12-31 09:29:51 -05:00
John MacFarlane
a274e15f0d Markdown reader: Avoid parsing raw tex unless \ + letter seen.
This seems to help with the performance problem, #4216.
2017-12-30 23:33:03 -08:00
John MacFarlane
d6d4388f6f LaTeX reader: Simplified a check for raw tex command. 2017-12-30 22:43:46 -08:00
Jesse Rosenthal
e90c714c73 Docx reader: Remove unused anchors.
Docx produces a lot of anchors with nothing pointing to them -- we now
remove these to produce cleaner output. Note that this has to occur at
the end of the process because it has to follow link/anchor rewriting.

Closes #3679.
2017-12-30 22:17:06 -05:00
Alexander Krotov
debc6d13aa Muse reader: automatically translate #cover into #cover-image
Amusewiki uses #cover directive to specify cover image.
2017-12-31 00:30:26 +03:00
Alexander Krotov
bbfb6f0c3c Muse writer: don't escape URIs from AST 2017-12-30 20:32:16 +03:00
Jesse Rosenthal
4fc3f51186 Docx reader: Read multiple children of w:sdtContents`
Previously we had only read the first child of an sdtContents tag. Now
we replace sdt with all children of the sdtContents tag.

This changes the expected test result of our nested_anchors test,
since now we read docx's generated TOCs.
2017-12-30 08:21:42 -05:00
Albert Krewinkel
f42839ee2c
Lua filters: stop exporting pushPandocModule
The function `pushPandocModule` was exported by Text.Pandoc.Lua to
enable simpler testing. The introduction of `runPandocLua` renders
direct use of this function obsolete. (API change)
2017-12-29 10:11:45 +01:00
Albert Krewinkel
9be2c7624c
data/pandoc.lua: drop function pandoc.global_filter
The function `global_filter` was used internally to get the implicitly
defined global filter. It was of little value to end-users, but caused
unnecessary code duplication in pandoc. The function has hence been
dropped. Internally, the global filter is now received by interpreting
the global table as lua filter.

This is a Lua API change.
2017-12-29 10:04:55 +01:00
John MacFarlane
ac8e72a95d
Merge pull request #4170 from oltolm/opendocument
improve formatting of formulas in OpenDocument
2017-12-28 22:30:25 -07:00
John MacFarlane
da64e5baa4 Class: make FileTree opaque.
This forces uses to interact with it using
`insertInFileTree` and `getFileInfo`, which normalize
file names.
2017-12-28 16:39:52 -08:00
John MacFarlane
8b575dbf84 Filter changes.
* Previously we ran all lua filters before JSON filters.
* Now we run filters in the order they are presented on the
  command line, whether lua or JSON.
* The type of `applyFilters` has changed (incompatible API change).
* `applyLuaFilters` has been removed (incompatible API change).
* Bump version to 2.1.

See #4196.
2017-12-28 16:39:52 -08:00
oltolm
19bab48dcc improve formatting of formulas in OpenDocument 2017-12-28 22:10:04 +01:00
John MacFarlane
98fd9a978a Alphabetical order Extension constructors.
This makes them appear in order in `--list-extensions`.
2017-12-28 12:23:46 -08:00
John MacFarlane
e10864d9d5 Changed format of --list-extensions.
Now the + or - occurs first.
2017-12-28 12:12:22 -08:00
John MacFarlane
3494b6efd3 Powerpoint writer tests: use IO.
Otherwise we can't find the data files when compiled
with -embed_data_files.
2017-12-28 12:06:38 -08:00
John MacFarlane
d5770b7496 Moved makeCanoncial definition out of ifdef!
Also added slide2 to the default pptx, and reordered
the data files in pandoc.cabal.
2017-12-28 11:03:53 -08:00
John MacFarlane
60ace79b03 Class: use makeCanonical for normalization in FileTree and data files. 2017-12-28 10:47:09 -08:00
John MacFarlane
ddd6a89247 Text.Pandoc.Class: add insertInFileTree (API change).
This gives a pure way to insert an ersatz file into a FileTree.

In addition, we normalize paths both on insertion and on
lookup, so that "foo" and "./foo" will be judged equivalent.
2017-12-28 10:23:09 -08:00
John MacFarlane
90296d7e96 LaTeX writer: Use \endhead after \toprule in headerless tables.
Closes #4207.
2017-12-28 08:53:54 -08:00
John MacFarlane
3c93ac5cf0 LaTeX reader: be more tolerant of & character.
This allows us to parse unknown tabular environments
as raw LaTeX.  Closes #4208.
2017-12-28 08:41:53 -08:00
Albert Krewinkel
e5c8b65004
Org reader: support minlevel option for includes
The level of headers in included files can be shifted to a higher level
by specifying a minimum header level via the `:minlevel` parameter. E.g.
`#+include: "tour.org" :minlevel 1` will shift the headers in tour.org
such that the topmost headers become level 1 headers.

Fixes: #4154
2017-12-28 14:16:04 +01:00
Alexander Krotov
0fd7ed0cab FB2 writer: add cover image specified by "cover-image" meta
Fixes #4195
2017-12-28 16:03:18 +03:00
Jesse Rosenthal
52a4cf6699 PowerPoint writer: Obey slide level option 2017-12-28 07:47:07 -05:00
John MacFarlane
ba6c193457 Fix warning. 2017-12-27 13:38:44 -08:00
John MacFarlane
f688086979 Small improvement to figcaption parsing. #4184. 2017-12-27 12:38:04 -08:00