Commit graph

5753 commits

Author SHA1 Message Date
Nikolay Yakimov
a82dedf1ff Lists test 2015-03-08 03:59:48 +03:00
Nikolay Yakimov
ae07d5ed49 Initial tests for writer 2015-03-03 14:37:02 +03:00
Nikolay Yakimov
65c80822e7 Code cleanup 2015-03-03 13:08:52 +03:00
Nikolay Yakimov
409111f647 Started moving StyleMap out of writer code 2015-03-01 22:57:35 +03:00
Nikolay Yakimov
13daf3ed6a Update Docx writer for 1cb601d reference.docx 2015-03-01 18:49:44 +03:00
Nikolay Yakimov
1cb601d288 Update reference.docx
Following styles are set as custom:
* Author
* Abstract
* Compact
* Image Caption
* Table Caption
* Definition Term
* Definition
* First Paragraph

Following styles are renamed to correspond with Word Normal.dotm
* Block Quote -> Block Text
* Link -> Hyperlink
* Footnote Ref -> Footnote Reference

Following styles added:
* Caption

Following styles' inheritance changed:
* Image Caption <- Caption
* Table Caption <- Caption
2015-03-01 18:45:19 +03:00
Nikolay Yakimov
542e19f6ce Remove accidentally added file 2015-02-24 02:35:00 +03:00
Nikolay Yakimov
ba153585db Comment out unused functions to make CI happy 2015-02-24 02:34:46 +03:00
Nikolay Yakimov
908a47e4b9 Treat some ambiguous styles as custom for now
* Author
* Abstract
* Compact
* ImageCaption
* TableCaption
* DefinitionTerm
* Definition
* FirstParagraph
2015-02-24 02:31:14 +03:00
Nikolay Yakimov
47c70b9131 Do not lookup custom styles 2015-02-23 02:05:32 +03:00
Nikolay Yakimov
7ae7f0c051 Also skip SourceCode style if exists 2015-02-23 01:53:47 +03:00
Nikolay Yakimov
8b3acde9de If --no-highlight is set, remove *Tok styles. 2015-02-22 23:25:12 +03:00
Nikolay Yakimov
80715ecd7a Prototype fix for #1872 2015-02-22 00:19:58 +03:00
Nikolay Yakimov
5cdd11725c Initial stab at more involved fix for #1607
This patch attempts to build a style name -> style id mapping based on styles.xml from reference doc, and changes pStyle and rStyle to accept style name as a parameter instead of styleId. There is a fallback mechanic that removes spaces from style name and returns it as style id, but it likely won't help much.

Style names are matched lower-case, since headings and `footnote text` have lowercase names.
2015-02-21 22:20:18 +03:00
Jesse Rosenthal
a7c67c897e Docx reader: Minor cleanup.
The previous commits had some code repetition. This just makes it a bit
easier to read.
2015-02-21 09:18:53 -05:00
Jesse Rosenthal
9654514e8a Docx reader: add test for verbatim in sub/superscript. 2015-02-21 08:45:38 -05:00
Jesse Rosenthal
55d2ce751a Docx reader: allow sub/superscript verbatims.
Verbatim usually shuts off all other run styles, but we don't want it to
shut off sub/superscript.
2015-02-21 08:41:09 -05:00
Matthew Pickering
3e81c3a0a6 Merge pull request #1964 from mpickering/latexfix
LaTeX Writer: Don't use listings in headers
2015-02-20 09:58:37 +00:00
Matthew Pickering
274efc4a71 LaTeX Writer: Don't use listings in headers
Fixes #1963
2015-02-20 09:35:36 +00:00
Jesse Rosenthal
2995526772 Docx reader: Add tests for new list style parsing. 2015-02-19 00:24:04 -05:00
Jesse Rosenthal
a01913b45c Docx reader: Allow numbering in the style file.
This allows inherited styles with numbering (lists). It works like this:

 1. check to see if the style has numbering info.
 2. if the paragraph has explicit numbering info in the doc that takes
 precedence.
 3. if not we use the numbering info in the style, if it's there.
 4. otherwise normal paragraph.

We no longer assume it's not a numbering element if it doesn't have an
explicit level---we just set that level to 1. (In the style files, the
examples I've seen don't have that explicit level.)
2015-02-19 00:17:04 -05:00
John MacFarlane
3480189e8e ICML writer: Better handling of raw blocks and inlines.
Previously these were always escaped and printed verbatim.
Now they are ignored unless the format is "icml", in which
case they are passed through unescaped.

Closes #1951.
2015-02-17 08:50:48 -08:00
John MacFarlane
e8cd53d1c9 Fixed revealjs template so style css is correctly included.
Closes #1949.
2015-02-16 19:57:37 -08:00
John MacFarlane
e32227f744 Allow wildcards in --epub-embed-font arguments.
Closes #1939.
2015-02-13 23:34:20 -08:00
John MacFarlane
d5469b30fe Improved building of data URIs in SelfContained.
Now base64 is used except for 'text/*' mime types.  Closes #1940.
2015-02-13 21:37:43 -08:00
Jesse Rosenthal
616e211f36 Docx reader: test lists in table cells. 2015-02-13 09:08:07 -05:00
Jesse Rosenthal
24fd0ad04d Docx reader: Handle lists correctly inside table cells.
Previously we didn't transform lists inside table cells.
2015-02-13 09:02:16 -05:00
Jesse Rosenthal
ba59e5447f Docx writer: Add footnotes id -1 and 0.
Word uses, by default, footnotes with id -1 and 0 for separators. If a
user modifies reference.docx, they will end up with a settings.xml file
that references these footnotes, but no such footnotes in the
document. This will produce a corruption error. Here we add these to the
document and settings.xml file, so future modifications won't break the file.
2015-02-12 09:21:41 -05:00
Jesse Rosenthal
c2f32f4e8f Docx Writer: Alter Blockquote style slightly.
Since blockquote derives from BodyText, we just want to specify by
default that it won't indent, regardless of what BodyText does. Note
that this will not produce any visible difference in the default
configuration.
2015-02-11 15:06:48 -05:00
Jesse Rosenthal
f703198bc9 Docx Writer: Update reference.docx
This updates reference.docx to make BodyText a quick style, and inherit
from it appropriately.
2015-02-11 15:06:48 -05:00
Jesse Rosenthal
96d5c8a5dc Docx Writer: Add "BodyText" Style
We apply a "BodyText" style to all unstyled paragraphs. This is,
essentially, the same as "Normal" up until now -- except that since not
everything inherits from "BodyText" (the metadata won't, for example, or
the headers or footnote numbers) we can change the text in the body
without having to make exceptions for everything.

This will still inherit from Normal, so if we want to
change *everything*, we can do it through "Normal".
2015-02-11 15:06:36 -05:00
Jesse Rosenthal
25ef68d266 Docx Writer: Use FirstParagraph style at beginning.
Before we had used `FirstParagraph` style after Headings, BlockQuotes,
and other blocks a user might not want an indentation after. We hadn't
actually used it for the first paragraph -- i.e. the opening of the
body. This makes sure the first body paragraph gets that style.
2015-02-10 21:05:13 -05:00
Jesse Rosenthal
d623a5c7e9 Added FirstParagraph to docx templates. 2015-02-09 23:22:59 -05:00
Jesse Rosenthal
daab4c3f22 Docx Writer: Implement FirstParagraph Style
Following the odt writer, we make the first text paragraph following an
image, blockquote, table, or heading into a "FirstParagraph" style. This
allows it to be styled differently, if the user wishes. The default is
for it to be the same as "Normal"
2015-02-09 23:22:52 -05:00
John MacFarlane
6a6392d393 Travis: comment out ghc 7.10 until we have the dependencies. 2015-02-07 21:17:53 -08:00
John MacFarlane
12962e2332 Merge pull request #1927 from freephile/master
update syntax for Images/Media files in MediaWiki
2015-02-07 20:33:33 -08:00
John MacFarlane
24f379ebd7 Merge pull request #1915 from mpickering/travisupdate
Update travis file (for GHC 7.10)
2015-02-07 20:32:42 -08:00
John MacFarlane
20b3dea3fe Merge branch 'timtylin-patch/fixTexinfoWrap' 2015-02-07 20:31:33 -08:00
John MacFarlane
bd7cf8dbd5 Merge branch 'patch/fixTexinfoWrap' of https://github.com/timtylin/scholdoc into timtylin-patch/fixTexinfoWrap
Conflicts:
	src/Text/Pandoc/Writers/Texinfo.hs
2015-02-07 20:28:56 -08:00
John MacFarlane
0a1cd25312 Merge pull request #1925 from timtylin/patch/prettyLineBreaks
Append newline to the LineBreak of various writers
2015-02-07 20:21:58 -08:00
Tim Lin
858ebf99eb Texinfo writer: fix wrapping by using breakable spaces 2015-02-06 01:16:40 -08:00
Greg Rundlett
218f28af6d update syntax for Images/Media files in MediaWiki
The preferred syntax for Images and other media is [[File:Foo.jpg]] in MediaWiki since v1.14 (2008).  [[Image:Foo.jpg]] is deprecated but still works as an alias to the File namespace.  I don't think this would break any existing wikis since talk of switching the syntax/namespace for images started back in 2002 (https://phabricator.wikimedia.org/T2044).  NS_FILE became the new namespace for Files in v 1.14 in late 2008. (https://www.mediawiki.org/wiki/Release_notes/1.14)  There is still a namespace alias so '[[Image:]]' still works today.  It's just that MediaWiki supports other media as well, and so the name and syntax used in documentation (see https://www.mediawiki.org/wiki/Help:Images) has long been '[[File:foo.jpg]]'
2015-02-05 17:07:50 -05:00
Greg Rundlett
13c4757057 update syntax for Images/Media files in MediaWiki
The preferred syntax for Images and other media is [[File:Foo.jpg]] in MediaWiki since v1.14 (2008).  [[Image:Foo.jpg]] is deprecated but still works as an alias to the File namespace.
2015-02-05 17:03:20 -05:00
Tim Lin
0c18f3a854 Append newline to the LineBreak of various writers
This change improves output formatting of content with a large amount of force line breaks, such as line-blocks. The following writers are affected:

* Dokuwiki
* HTML
* EPUB (via HTML)
* LaTeX
* MediaWiki
* OpenDocument
* Texinfo

This commit resolves #1924
2015-02-04 22:42:22 -08:00
John MacFarlane
fb7a03dcda Textile reader: table improvements.
* Handle newlines in cells.
* Handle empty cells.
* Closes #1919.
2015-02-02 10:45:50 -08:00
Matthew Pickering
2a3df35423 Update travis file 2015-02-02 10:44:34 +00:00
John MacFarlane
7050c26abc LaTeX writer: Don't escape $ in URL. Closes #1913. 2015-02-01 11:19:55 -08:00
John MacFarlane
6a0d4da382 HTML writer: Add "inline" or "display" class to math spans.
This allows inline and display math to be styled differently.

Closes #1914.
2015-02-01 11:08:27 -08:00
Matthew Pickering
5073758bb8 Merge pull request #1912 from zudov/missing_alt
Fixed issue #1131 + small refactoring
2015-01-30 00:35:16 +00:00
Konstantin Zudov
92e762c2d6 Refactored if x then [] else y to [y | not x] 2015-01-29 22:36:23 +02:00