Commit graph

2110 commits

Author SHA1 Message Date
John MacFarlane
8ca012f139 Ms writer: font improvements.
* Use `\f[R]` rather than `\f[]` to reset.  The latter
  returns to the previous font, which gives unintended
  results in some cases.
* Use `\f[BI]` and `\f[CB]` in headers, instead of `\f[I]` and `\f[C]`,
  since the header font is automatically bold.
* Use `\f[CB]` rather than `\f[BC]` for monospace bold.

Closes #4552.
2018-04-15 22:44:16 -07:00
Alexander Krotov
17767bd29d Muse writer: escape strings starting with space 2018-04-15 16:28:45 +03:00
John MacFarlane
16439c879e Ms writer link improvements.
+ Create pdf anchor for a Div with an identifier.
+ Escape `/` character in anchor ids.
+ Improve escaping for anchor ids: we now use _uNNN_ instead of uNNN
  to avoid ambiguity.

This is intended to help with #4515; however, in my tests, the
link to the reference does not seem to work. I'm not sure why.
2018-04-14 10:59:01 -07:00
John MacFarlane
d5b98c8c6e Man writer: Don't escape U+2019 as '.
Closes #4550.
2018-04-14 10:42:05 -07:00
Alexander Krotov
782ab73aa3 Muse writer: escape > less often
> should be escaped only when it can start verse, i.e., at the beginning of the line.
2018-04-10 23:38:30 +03:00
Alexander Krotov
52803e2960 Muse writer: don't break headers, line blocks and tables with line breaks 2018-04-09 04:24:08 +03:00
Alexander Krotov
79b67dec78 Muse writer: fix Haddock comment 2018-04-09 04:24:08 +03:00
Alexander Krotov
44093930a8 Muse writer: correctly output empty headings 2018-04-09 04:10:05 +03:00
Alexander Krotov
f9aa2eb353 FB2 writer: output links inline instead of producing notes
Previously all links were turned into footnotes with unclickable URLs inside.
2018-04-07 17:12:55 +03:00
Jesse Rosenthal
394f4536e1 Powerpoint writer: Handle Quoted Inlines
Closes: #4532
2018-04-05 14:03:15 -04:00
Alexander Krotov
87dda2109d Muse writer: escape horizontal rule only if at the beginning of the line 2018-04-05 19:49:09 +03:00
Alexander Krotov
16104881b3 Muse writer: simplify escaping in inlineToMuse Image{} 2018-04-05 19:49:09 +03:00
quasicomputational
13538ce6eb CommonMark writer: correctly ignore LaTeX raw blocks when not raw_tex (#4533)
Issue #4527.
2018-04-05 08:53:42 -07:00
Alexander Krotov
ff3ed5c9f8 FB2 writer: allow emphasis and notes in titles
Only <p> and <empty-line /> are allowed in titles,
but <p> has the same type as an ordinary paragraphs.
Therefore, there is no need to remove emphasis from titles.

Also, don't intersperse paragraph with empty lines.
2018-04-04 14:22:34 +03:00
Alexander Krotov
8837af879a Muse writer: rewrite noteToMuse without do 2018-04-03 15:47:23 +03:00
Alexander Krotov
dfbae03810 hlint Muse writer 2018-04-02 16:20:35 +03:00
Alexander Krotov
ca78d93b40 Muse writer: place header IDs before header
See https://github.com/melmothx/text-amuse/issues/39
2018-04-02 15:58:37 +03:00
Alexander Krotov
aca4137c40 Muse writer: only escape brackets when necessary
It includes cases when they can be mistaken for footnotes
and links, as well as inside link description.
2018-04-01 19:39:18 +03:00
Alexander Krotov
bdb8424697 Muse writer: do not escape list markers unless preceded by space 2018-03-31 23:40:31 +03:00
Jesse Rosenthal
d0dc0c353e Powerpoint writer: code cleanup
Since we're using mapM_ instead of mapM, we can get rid of the return
statement. We also don't need the `unless` statement anymore.
2018-03-30 13:53:04 -04:00
John MacFarlane
c997f112b7 EPUB writer: add epub:type="footnotes" to notes section in EPUB3.
Closes #4489.
2018-03-30 09:38:49 -07:00
Anabra
2d414321df Removed unused extensions (#4506) 2018-03-29 10:47:12 -07:00
Alexander Krotov
d0a7dbd948 Muse writer: implement Default for WriterState 2018-03-28 15:49:50 +03:00
Alexander Krotov
7c268c492d Muse writer: move options, stTopLevel and stInsideBlock to WriterEnv 2018-03-28 15:45:45 +03:00
Alexander Krotov
7252777078 Muse writer: define Muse type 2018-03-28 14:53:03 +03:00
Alexander Krotov
b379a2903a Muse writer: escape semicolons and markers after line break 2018-03-28 13:19:39 +03:00
Alexander Krotov
6d35090538 Cleanup Muse reader and writer 2018-03-26 16:05:02 +03:00
Alexander Krotov
989a9ebec3 Muse writer: remove unused binding 2018-03-25 23:42:07 +03:00
Alexander Krotov
a3f659d2c0 Muse writer: escape ordered list markers
Also reduced amount of <verbatim> tags in output to avoid escaping every "-" and word that ends in a full stop.
2018-03-25 19:28:23 +03:00
Jesse Rosenthal
2582de5384 Powerpoint writer: code cleanup. 2018-03-25 10:22:37 -04:00
Alexander Krotov
4a8993f9b0 Muse writer: improve span writing
Test more cases when span has or hasn't anchor, class and contents in different combinations.
2018-03-25 01:18:33 +03:00
Alexander Krotov
d58b961a6d Muse writer: do not join Span's doing normalization
Separate spans may have different semantics, for example if spans indicate syllables in a word.
2018-03-25 00:30:05 +03:00
Jesse Rosenthal
8b533f9c38 Powerpoint writer: simplify code with ParseXml
There were some artifact code blocks around from before
`reference-doc` functionality was implemented. This led to ignoring
the reference-doc in places. Though I fixed this, I kept the old
hacked-up functions instead of replacing them with
`parseXml` (imported from Writers.OOXML) which does this in a
consistent manner. This commit corrects that oversight.
2018-03-24 16:07:14 -04:00
Jesse Rosenthal
f7fb102aae Powerpoint writer: Allow fallback options when looking for placeholder type. 2018-03-24 11:02:45 -04:00
Jesse Rosenthal
8932604649 Revert "Powerpoint writer: Remove spPr tag from non-body layouts"
This reverts commit 99fa850a37.
2018-03-24 10:16:55 -04:00
Jesse Rosenthal
187fa4e444 Powerpoint reader: Check reference-doc for all layouts.
There were a few layouts where we were still just checking the built
in pptx doc, instead of the supplied reference doc.
2018-03-24 10:14:19 -04:00
Jesse Rosenthal
99fa850a37 Powerpoint writer: Remove spPr tag from non-body layouts
This was causing headers to be misaligned when some templates were used.
2018-03-23 16:29:29 -04:00
John MacFarlane
db596a5b12 EPUB writer: ensure that pagetitle is always set...
even when structured titles are used.
This prevents spurious warnings about empty title elements.

Closes #4486.
2018-03-23 12:09:53 -07:00
Jesse Rosenthal
435b1829b1 Powepoint writer: Simplify speaker notes
We now pull the filtered blocks and speaker notes out at the top of
the `blocksToSlide` function, and then make SpeakerNotes into a
parameter of the `blocksToSlide'` subfunction. The output is the same,
but the logic should be easier to follow now.
2018-03-23 14:22:35 -04:00
Jesse Rosenthal
3b7611a7c7 Powerpoint writer: change notes state to a simpler per-slide value
We used to keep a map of the slideId-to-notes for each slide. Since we
now extract them at the slide level, this is overcomplicated, and we
can just extract them before converting a slide and then clear the
state after.
2018-03-23 13:58:22 -04:00
Jesse Rosenthal
59f3997069 Powerpoint writer: Remove Maybe from SpeakerNotes in Slide.
Previously, we had treated it as a `Maybe`. But there is no difference
between not having speaker notes and having empty speaker notes. So we
make the SpeakerNotes newtype into a monoid, and test for memptiness
instead of testing for Just/Nothing.
2018-03-23 13:00:30 -04:00
Alexander Krotov
6f50733691 Muse writer: don't align ordered list items
It leads to problems with round-trip test,
because aligned line blocks can't be read back.
2018-03-21 17:33:27 +03:00
Jesse Rosenthal
ab184a519c Powerpoint writer: handle speaker notes earlier in the conversion process
Internal change: We were getting bad results with the empty text box
created by the conversion of notes into an empty paragraph. So we now
convert the notes at the `blocksToSlide` stage, by `walkM`ing a
function over the blocks that returns `()`, and then filters the notes
out. This avoids the need to have a return value for speaker notes,
and thus avoids the empty TextBox.

Together with the previous commit (256f14c5a), closes #4477.
2018-03-21 10:07:07 -04:00
Jesse Rosenthal
cb1ee07c98 Powerpoint writer: Keep notes with related blocks
Some blocks automatically split slides (imgs, tables, `column`
divs). We assume that any speaker notes immediately following these
are connected to these elements, and keep them with the related
blocks, splitting after them.
2018-03-21 10:07:07 -04:00
Alexander Krotov
81afcdfaf8 Muse writer: escape "]" in image title 2018-03-20 15:01:53 +03:00
Alexander Krotov
bc0025d944 Muse writer: remove key-value pairs from attributes before normalization 2018-03-20 14:51:39 +03:00
Alexander Krotov
268c73c873 Muse writer: escape ";" to avoid accidental comments 2018-03-20 12:16:34 +03:00
Alexander Krotov
d63bba3066 Muse writer: escape "]" brackets in URLs as "%5D" 2018-03-20 12:16:34 +03:00
John MacFarlane
3d21c184d4 Ms writer: don't escape hyphens.
Previously we escaped hyphens as `\-`, but that's a minus sign.
Closes #4467.

Updated changelog.
2018-03-18 14:52:03 -07:00
Mauro Bieg
ec47079d3e EPUB writer: remove notes from TOC in nav.xhtml (#4463)
fixes #4453
2018-03-18 11:34:34 -07:00