Commit graph

2110 commits

Author SHA1 Message Date
Jesse Rosenthal
d9e179d6fd Powerpoint writer: Read notes into powerpoint Presentatation type.
We record notes in a map in state while processing.
2018-02-18 16:31:32 -05:00
Jesse Rosenthal
6fa6b6a5f2 Powerpoint writer: Change references to Notes to SpeakerNotes
This is to avoid confusion with {foot,end}notes.
2018-02-18 16:31:32 -05:00
Andrew Pritchard
bb7681a85a EMF Image size support (#4375) 2018-02-18 11:12:58 -08:00
John MacFarlane
3535af0197 Markdown writer: properly escape @ to avoid capture as citation.
Closes #4366.
2018-02-16 15:59:03 -08:00
John MacFarlane
036767ea80 TEI writer: more attribute fixes.
- Ensure that id prefix is always used.
- Don't emit `role` attribute; that was a leftover from the
  Docbook writer.
2018-02-16 10:47:46 -08:00
John MacFarlane
ded2e211ca TEI writer: Use 'xml:id', not 'id' attribute.
Closes #4371.
2018-02-16 10:41:22 -08:00
Alexander Krotov
9131d62c9b Muse writer: use unicode quotes for quoted text 2018-02-15 14:33:25 +03:00
Alexander Krotov
6dcb974423 AsciiDoc writer: do not output implicit heading IDs
Convert to asciidoc-auto_identifiers for old behaviour.

Fixes #4363
2018-02-13 23:19:34 +03:00
Alexander Krotov
d777fe8bbe Muse writer: write image width specified in percent in Text::Amuse mode 2018-02-03 18:36:38 +03:00
John MacFarlane
8bdbdc24de TEI writer: Use height instead of depth for images.
Closes #4331.
2018-02-01 11:38:33 -08:00
Alexander Krotov
9ff8bc64f9 Muse writer: don't wrap displayMath into <verse>
<verse> is a block tag and displayMath is an inline element.
Writing <verse> around displayMath could result in nested
<verse> tags.
2018-01-30 00:33:02 +03:00
Alexander Krotov
b7d8930dc0 Muse writer: escape nonbreaking space ("~~") 2018-01-29 12:54:43 +03:00
Jesse Rosenthal
9cf9f1f89d Docx writer: make more deterministic to facilitate testing
This will allow us to compare files directly in a golden test. Times
are still based on IO, but we will be able to safely skip those.

Changes:

 - `getUniqueId` now calls to the state to get an incremented digit,
   instead of calling to P.uniqueHash.

 - we always start the PRNG in mkNumbering/mkAbstractNum with the same
   seed (1848), so our randoms should be the same each time.
2018-01-27 07:44:53 -05:00
Jesse Rosenthal
ae2157fe8b Docx writer: Fix ids in comment writing
Comments from `--track-changes=all` were producing corrupt docx,
because the writer was trying to get id from the `(ID,_,_)` field of
the attributes, and ignoring the "id" entry in the key-value pairs. We
now check both.

There is a larger conversation to be had about the right way to treat
"id" and "class" entries in kvs, but this fix will correctly interpret
the output of the docx reader work.
2018-01-27 07:41:55 -05:00
Henri Menke
751b5ad010 ConTeXt writer: new section syntax and --section-divs (#4295)
Fixes #2609.

This PR introduces the new-style section headings: `\section[my-header]{My Header}` -> `\section[title={My Header},reference={my-header}]`.

On top of this, the ConTeXt writer now supports the `--section-divs` option to write sections in the fenced style, with `\startsection` and `\stopsection`.
2018-01-25 11:56:28 -08:00
Jesse Rosenthal
0d7aedca58 Dock writer: Fix deletion track changes
This had been mistakenly written as a second insertion function.

Closes: #4303
2018-01-25 10:42:01 -05:00
Henri Menke
71bbadb793
ConTeXt writer: xtables: correct wrong usage of caption 2018-01-23 09:15:59 +13:00
Alexander Krotov
e9ed4832ed Muse writer: join code with different attributes during normalization 2018-01-22 16:27:14 +03:00
Alexander Krotov
288065cfd4 Muse writer: indent lists inside Div 2018-01-22 16:24:44 +03:00
John MacFarlane
8ffb4e5b33 Conditional import to avoid warning. 2018-01-19 22:46:29 -08:00
John MacFarlane
b8ffd834cf hlint code improvements. 2018-01-19 21:25:24 -08:00
danse
a0ee842096 remove blockToRST' moving its logic into fixBlocks 2018-01-19 16:34:37 +01:00
danse
2165efef7e in RST writer insert comment between lists and quotes, closes #4248 2018-01-19 15:57:54 +01:00
Alexander Krotov
01499b766b Muse writer: support definitions with multiple descriptions
Muse reader does not support this syntax yet, but Emacs Muse parses
it correctly.
2018-01-19 15:00:00 +03:00
Jesse Rosenthal
d0a895acee Powerpoint writer: Implement syntax highlighting
This also necessitated implementing colors and underlining, though
there is currently no way to produce these from markdown. Note that
background colors can't be implemented in PowerPoint, so highlighting
styles that require these will be incomplete.
2018-01-18 17:33:05 -05:00
Jesse Rosenthal
63ae907629 Clean up T.P.W.OOXML file, and add copyright. 2018-01-18 11:49:18 -05:00
Jesse Rosenthal
eae7904853 Powerpoint writer: Make our own docProps/core.xml file.
This allows us to set document metadata properties from pandoc metadata.
2018-01-18 10:15:17 -05:00
Jesse Rosenthal
bfef2cbbf3 Powerpoint writer: Add docProps to Presentation datatype.
This picks up the necessary information from meta and carries it over
to the XML output, so Output.hs doesn't need access to the original
pandoc information.
2018-01-18 10:15:12 -05:00
Jesse Rosenthal
588af3cc78 Powerpoint writer: Link notes to endnotes slide. 2018-01-17 16:40:32 -05:00
Jesse Rosenthal
42e690d1b2 Powerpoint writer: Use more specific slide id names. 2018-01-17 16:40:32 -05:00
Jesse Rosenthal
0d53efeddb Powerpoint writer: Use slideids to simplify code. 2018-01-17 16:40:32 -05:00
Jesse Rosenthal
63a2507d0e Powerpoint writer: Revamp slide type
This is an internal change to the Presentation type. The algebraic
datatype that used to be called `Slide` is now `Layout`, and Slide is
defined as `Slide SlideId Layout (Maybe Notes)`. Though there should
be no user-visible changes in this commit, it offers two benefits
moving forward:

1. Slides now carry their Id with them, instead of being assigned it
in deck order. This makes it easier to set up a link to, say, an
endnotes slide ahead of time.

2. This makes room for Notes slides, when we implement them.
2018-01-17 16:40:32 -05:00
Jesse Rosenthal
fcbec16e57 Powerpoint writer: Change reference to notesSlide to endNotesSlide
This will prevent confusion when speakers notes are implemented.
2018-01-17 08:32:52 -05:00
Jesse Rosenthal
0482edadbd Powerpoint writer: Move image sizing into picProps.
Rather than passing around attributes, we can have image sizing in the
picProps and then pass it along to write to XML.
2018-01-17 08:32:52 -05:00
John MacFarlane
d987a9d114 Markdown writer: fix cell width calculation.
Previously we could get ever-lengthening cell widths
when a table was run repeatedly through `pandoc -f markdown -t
markdown`.  This patch stabilizes the relative cell
widths. Closes #4265.
2018-01-16 23:13:33 -08:00
Robert Schütz
b2268b1fc7 LaTeX writer: escape & in lstinline 2018-01-16 16:34:39 +01:00
Henri Menke
6910267abf ConTeXt writer: Use xtables instead of Tables (#4223)
- Default to xtables for context output.
- Added `ntb` extension (affecting context writer only) to use Natural Tables instead.
- Added `Ext_ntb` constructor to `Extension` (API change).
2018-01-15 18:38:33 -07:00
Jesse Rosenthal
c6a55f8e9f Powerpoint writer: Improve table placement. 2018-01-15 15:51:58 -05:00
Jesse Rosenthal
e408ae6278 Powerpoint writer: Make our own _rels/.rels file.
The toplevel .rels file could have a thumbnail image if taken from the
template. Rather than removing it from the inherited file, it's easier
to just make our own.
2018-01-15 15:35:06 -05:00
Jesse Rosenthal
f79a6f1163 Powerpoint writer: Import reference-doc images properly.
There was a glob error that was leading to images from the
reference-doc pptx not being imported. We don't need a glob here --
just replace it with `isPrefixOf`.
2018-01-15 14:48:35 -05:00
Jesse Rosenthal
b010113f3f Powerpoint writer: Move Presentation.hs out of PandocMonad
We don't need it for anything but the log messages, and we can just
keep track of that in state and pass it along to the `writePowerpoint`
function. This will simplify the code.
2018-01-15 10:01:59 -05:00
Jesse Rosenthal
a7d131cf44 Powerpoint writer: Ignore anchor links to nowehere.
We don't convert a '#target' ExternalTarget to an InternalTarget if
`target` is not in the AnchorMap. We just remove the link. This
prevents broken links in the Powerpoint output.
2018-01-15 08:56:20 -05:00
Jesse Rosenthal
3156722ac4 Powerpoint writer: Fix anchor links.
They were broken when I refactored (the Output module wanted to use
state left over from the construction of the Presentation type). This
change introduces a new type `LinkTarget = InternalTarget |
ExternalTarget`. Internal target points to a slide number, and these
will all be resolved before the Presentation is passed along to the
Output module.
2018-01-14 21:59:06 -05:00
Jesse Rosenthal
431f6166fa Powerpoint writer: Refactor into separate modules.
There are two steps in the conversion: a conversion from pandoc to a
Presentation datatype modeling pptx, and a conversion from
Presentation to a pptx archive. The two steps were sharing the same
state and environment, and the code was getting a bit
spaghetti-ish. This separates the conversion into separate
modules (T.P.W.Powerpoint.Presentation, which defineds the
Presentation datatype and goes Pandoc->Presentation)
and (T.P.W.Pandoc.Output, which goes Presentation->Archive).
Text.Pandoc.Writers.Powerpoint a thin wrapper around the two modules.
2018-01-14 09:39:39 -05:00
Jesse Rosenthal
90dcd0bc87 Powerpoint writer: Avoid overlapping blocks in column output.
Just as a slide can't have an image and text on the same slide because
of overlapping, we can't have both in a single column. We run
splitBlocks on the text in the column and discard the rest.
2018-01-14 01:50:16 -05:00
Jesse Rosenthal
64c4451ef3 Powerpoint writer: Position images correctly in two-column layout.
You can have two images side-by-side, or text alongside an image. The
image will be fit correctly within the column.
2018-01-14 01:50:16 -05:00
Jesse Rosenthal
1577289672 Powerpoint writer: Make content shape retrieval environment-aware
We put `getContentShape` and `getContentShapeSize` inside the P monad,
so that we can (in the future) make use of knowledge of what slide
environment we're in to get the correct shape. This will allow us, for
example, to get individual columns for a two-column layout, and place
images in them appropriately.
2018-01-14 01:50:16 -05:00
Jesse Rosenthal
50b64bcf1c Powerpoint writer: Improve image handling.
We now determine image and caption placement by getting the dimensions
of the content box in a given layout. This allows for images to be
correctly sized and positioned in a different template.

Note that iamges without captions and headers are no longer
full-screened. We can't do this dependably in different layouts,
because we don't know where the header is (it could be to the side of
the content, for example).
2018-01-13 21:42:38 -05:00
Jesse Rosenthal
944ed5e098 Powerpoint writer: read presentation size from reference file.
Our presentation size is now dependent on the reference/template file
we use. This will make it easier to set different output sizes by
supplying different reference files. The alternative (allowing a user
to explicitly set output size regardless of the template) will lead to
too many thorny issues, as explicitly set sizes at the various level
of powerpoint layout would have to be reset.
2018-01-13 14:58:46 -05:00
Jesse Rosenthal
e08776b9d5 Powerpoint writer: code cleanup
Last commit accidentally left commented-out code in.
2018-01-13 09:34:03 -05:00