Commit graph

3084 commits

Author SHA1 Message Date
John MacFarlane
b50927527c PDF: Catch errors in conversion of images and display message.
See #1582.
2014-08-30 18:45:58 -07:00
John MacFarlane
f70e3c3297 Merge branch 'mime' of https://github.com/Aelve/John into Aelve-mime
Conflicts:
	src/Text/Pandoc/Writers/Docx.hs
2014-08-30 11:49:50 -07:00
John MacFarlane
8b09d954f9 Merge pull request #1580 from jkr/stringCellDokuWiki
DokuWiki writer: Backslash newlines in table cells
2014-08-30 09:22:38 -07:00
Jesse Rosenthal
ccda2a902c DokuWiki writer: Use backslash newlines in table cells.
Write out strings in table cells with backslash linebreaks in place of
newlines. We also want to remove the first two spaces of an indent in lists.
2014-08-30 07:17:55 -04:00
John MacFarlane
218633548f Merge pull request #1574 from jlduran/latex-horizontal-rule
LaTeX writer: Make Horizontal Rules more flexible
2014-08-29 21:40:55 -07:00
John MacFarlane
017d44af1d Merge branch 'ugly-tables' of https://github.com/jlduran/pandoc into jlduran-ugly-tables 2014-08-29 21:24:36 -07:00
Jose Luis Duran
4c684561ee LaTeX writer: Add \strut to fix multiline tables
See: http://tex.stackexchange.com/questions/34971
2014-08-29 13:54:08 +00:00
Jesse Rosenthal
c931be24e1 Docx Reader: Read single para in table cell as plain
This makes to docx reader's native output fit with the way the markdown
reader understands its markdown output. Ie, as far as table cells go:

docx -> native == docx -> native -> markdown -> native

(This identity isn't true for other things outside of table cells, of
course).
2014-08-28 14:35:33 -04:00
Jose Luis Duran
1fc665c07d LaTeX writer: Make Horizontal Rules more flexible
Currently, pandoc has hard-coded the following in order to make horizontal
rules in LaTeX:

```hs
"\\begin{center}\\rule{3in}{0.4pt}\\end{center}"
```

Which is fine, but does not allow customizations.  It also does not take into
consideration the current line width.

I'm proposing this change:

```diff
@@ In Writers/LaTeX.hs:
-"\\begin{center}\\rule{3in}{0.4pt}\\end{center}"
+"\\begin{center}\\rule{0.5\\linewidth}{\\linethickness}\\end{center}"
```
2014-08-28 03:12:37 +00:00
Jose Luis Duran
f1d330b7b5 LaTeX writer: Fix tables
- [x] Fix a bug introduced in 66378062b6, which
  causes the table caption to repeat across all pages
- [x] Address the issues discussed
  [here](https://groups.google.com/forum/#!msg/pandoc-discuss/qMu6_5lYy0o/ZAU7lzAIKw0J)
  regarding the extra vertical space.
  - [ ] NOTE: This will cause multiline table cells to appear unpadded. See
    http://tex.stackexchange.com/questions/34971
  - [x] Use [`\tabularnewline`](http://tex.stackexchange.com/questions/78796)
    instead of `\\`.
2014-08-28 02:02:20 +00:00
Matthew Pickering
404a58f456 DokuWiki Writer: Refactor to use Reader monad 2014-08-27 14:29:09 +01:00
Matthew Pickering
495f55b03e DokuWiki Writer: Hlint cleanup 2014-08-27 13:48:19 +01:00
Matthew Pickering
3412018287 DokuWiki Writer: Qualified all imports 2014-08-27 13:29:09 +01:00
John MacFarlane
8f2aa45d69 Merge pull request #1564 from jkr/trackChangesWriter
Docx writer: write track changes.
2014-08-26 22:22:16 -07:00
Calvin Beck
f813755c55 Fixed exampleLine parser to accept example lines which have indentation at the start of the line. 2014-08-26 21:56:40 -06:00
Jesse Rosenthal
b613d85af9 Docx writer: Accomodate GHC 7.4 (no lookupEnv) 2014-08-26 06:43:14 -04:00
Jesse Rosenthal
21253b59e8 Docx writer: Default to user login and time of change if not given. 2014-08-25 14:03:35 -04:00
Jesse Rosenthal
e1bb28a388 Docx writer: Implement track changes.
These have default authors and dates of "unknown" and timestamp-zero,
respectively.
2014-08-25 12:37:56 -04:00
John MacFarlane
9f8051d95d Hlint changes to Docx writer. 2014-08-24 11:37:23 -07:00
John MacFarlane
0ef1f787c7 Docx writer: Bibliography entries get Bibliography style.
Closes #1559.
2014-08-23 20:52:09 -07:00
John MacFarlane
2956ef251c Fixed --self-contained with Windows paths.
Previously C:\foo.js was being wrongly interpreted as a URI.
Closes #1558.
2014-08-22 23:21:57 -07:00
mpickering
aa808055f0 Txt2Tags Reader: Fixed crash when reading from stdin 2014-08-21 17:11:21 +01:00
mpickering
3b6d7afa71 Txt2Tags Reader: Corrected formatting of %%mtime macro 2014-08-21 17:11:16 +01:00
mpickering
2a7319541d Txt2Tags Reader: Parse Meta information
The header is now parsed as meta information. The first line is the
`title`, the second is the `author` and third line is the `date`.
2014-08-21 17:09:40 +01:00
mpickering
2cd049a1bf Txt2Tags reader: Header is now parsed only if standalone flag is set 2014-08-20 18:11:37 +01:00
John MacFarlane
60f3e777f3 EPUB writer: don't use page-progression-direction in EPUB2.
Also, if page-progression-direction not specified in metadata,
don't include the attribute even in EPUB3; not including it is
the same as including it with the value "default", as we did before.

Closes #1550.
2014-08-19 09:21:26 -07:00
John MacFarlane
716ad5fd8a Merge pull request #1547 from jkr/styleparse
Docx reader: parsing styles
2014-08-18 14:14:01 -07:00
John MacFarlane
6dce8c6760 HTML reader: improved handling of tags that can be block or inline.
Previously a section like this would be enclosed in a paragraph,
with RawInline for the video tags (since video is a tag that can
be either block or inline):

    <video controls="controls">
       <source src="../videos/test.mp4" type="video/mp4" />
       <source src="../videos/test.webm" type="video/webm" />
       <p>
          The videos can not be played back on your system.<br/>
          Try viewing on Youtube (requires Internet connection):
          <a href="http://youtu.be/etE5urBps_w">Relative Velocity on
    Youtube</a>.
       </p>
    </video>

This change will cause the video and source tags to be parsed
as RawBlock instead, giving better output.

The general change is this:  when we're parsing a "plain" sequence
of inlines, we don't parse anything that COULD be a block-level tag.
2014-08-18 12:41:09 -07:00
Jesse Rosenthal
4b38e9f1f0 Docx reader: whitespace fix. 2014-08-17 20:11:50 -04:00
Jesse Rosenthal
198aea190f Docx reader: remove emph styles and strong styles list.
We no longer need the explicit lists since we're deriving them from the
ground up.
2014-08-17 17:04:55 -04:00
Jesse Rosenthal
9da7b0946e Docx reader: Add "Hyperlink" to blacklisted styles.
This is the only one so far. We'll add others as they show up.
2014-08-17 17:04:14 -04:00
Jesse Rosenthal
15ce28b8ca Docx reader: Use style resolver.
We now no longer check against explicit styles.
2014-08-17 17:03:44 -04:00
Jesse Rosenthal
03d5d8e596 Docx Reader: Introduce function for resolving dependent run styles.
We always favor an explicit positive or negative in a style in a
descendent, and only turn to the ancestor if nothing is set.

We also introduce an (empty) list of styles that are black-listed. We
won't check them. (Think underlines in hyperlinks).
2014-08-17 16:54:11 -04:00
John MacFarlane
8e60d35d58 Merge pull request #1536 from considerate/master
Add row width to tables in Docx XML
2014-08-17 12:54:38 -07:00
John MacFarlane
b6103eeb83 Merge pull request #1543 from jkr/superSubVert
Docx reader: Change behavior of Super/Subscript
2014-08-17 12:54:10 -07:00
John MacFarlane
c14088ea93 Docx writer: Fixed regression, bungled list numbering.
In pandoc 1.13, all lists come out as basic ordered lists.
This fixes that bad regression.

Closes #1544.
2014-08-17 12:48:41 -07:00
Jesse Rosenthal
99491f0d98 Docx Parse: build a bottom-up style tree.
Two points here: (1) We're going bottom-up, from styles not based on
anything, to avoid circular dependencies or any other sort of
maliciousness/incompetence. And (2) each style points to its
parent. That way, we don't need the whole tree to pass a style over to
Docx.hs
2014-08-17 15:46:17 -04:00
Artyom Kazak
357172f13a Remove an unnecessary import. 2014-08-17 23:44:02 +04:00
Artyom Kazak
6a34cd3ddf Update Reader.EPUB to use MimeType. 2014-08-17 21:00:55 +04:00
Artyom Kazak
cca9e8feb4 MIME cleanup.
* Create a type synonym for MIME type (instead of `String`).
  * Add `getMimeTypeDef` function.
  * Avoid recreating MIME type `Map`s every time.
  * Move “Formula-...” case handling into `getMimeType`.
2014-08-17 21:00:50 +04:00
Jesse Rosenthal
b8f1658c36 Alias string and runStyle to CharStyle type. 2014-08-17 11:30:22 -04:00
Jesse Rosenthal
c4871ac790 Docx Style parser: Basic one now just takes a parent style.
This will make it easier to build the style map from the bottom up (to
avoid any infinite references).
2014-08-17 10:19:48 -04:00
Jesse Rosenthal
75eec0a6b8 Docx reader: work with new rStyle.
Just discards info at the moment, so at least it works the same.
2014-08-17 09:22:25 -04:00
Jesse Rosenthal
ea85a797c2 Parser: Framework for parsing styles.
We want to be able to read user-defined styles. Eventually we'll be able
to figure out styles in terms of inheritance as well. The actual
cascading will happen in the docx reader.
2014-08-17 09:22:21 -04:00
Jesse Rosenthal
dc5b0ba09b Docx reader: Change behavior of Super/Subscript
In docx, super- and subscript are attributes of Vertalign. It makes more
sense to follow this, and have different possible values of Vertalign in
runStyle. This is mainly a preparatory step for real style parsing,
since it can distinguish between vertical align being explicitly turned
off and it not being set.

In addition, it makes parsing a bit clearer, and makes sure we don't do
docx-impossible things like being simultaneously super and sub.
2014-08-17 08:20:00 -04:00
John MacFarlane
9d52ecdd42 HTML reader: Parse appropriately styled span as SmallCaps. 2014-08-16 22:57:00 -07:00
Viktor Kronvall
753e47194c Simplify row width calculation. 2014-08-17 03:24:44 +02:00
Christoffer Ackelman
9f3c34841b Include row width in table rows.
Added a property to all table rows where the sum of column widths
is specified in pct (fraction of 5000).
2014-08-17 03:24:44 +02:00
John MacFarlane
cb4ae6112e Markdown writer: don't escape $, ^, ~ when extensions are deactivated.
`tex_math_dollars`, `superscript`, and `subscript` extensions,
respectively.

Closes #1127.
2014-08-16 17:14:51 -07:00
Jesse Rosenthal
9bb0b99981 Docx reader: Remove unnecessary plural functions
functions like runElemsToInlines and parPartsToInlines are just defined
in terms of concatting and mapping their singular
version (e.g. `runElemToInlines`). Having two functions with almost
identical names makes it easier to introduce errors. It's easy enough to
just concat and map inline, and it makes it clearer what is going on in
the code.
2014-08-16 15:07:41 -04:00