Commit graph

5321 commits

Author SHA1 Message Date
Jesse Rosenthal
54708da371 Add and update docx tests in pandoc.cabal. 2014-07-29 13:05:19 -04:00
Jesse Rosenthal
840108a9c1 Docx reader: Make metavalues out of styled paragraphs.
This will make paragraphs styled with `Author`, `Title`, `Subtitle`,
`Date`, and `Abstract` into pandoc metavalues, rather than text. The
implementation only takes those elements from the beginning of the
document (ignoring empty paragraphs).

Multiple paragraphs in the `Author` style will be made into a metaList,
one paragraph per item. Hard linebreaks (shift-return) in the paragraph
will be maintained, and can be used for institution, email, etc.
2014-07-29 13:03:01 -04:00
Beni Cherniavsky-Paskin
f84a25e1aa README: reduce 1:1 Topic -> Extension nesting
Reorganize some sections whose only purpose was containing a single Extension subsection.
2014-07-28 18:19:50 +03:00
John MacFarlane
4ddb8433a8 Merge pull request #1459 from mpickering/formats
Parsing: Added isbn and pmid schemes
2014-07-27 12:18:17 -07:00
Matthew Pickering
95fb0755c1 Parsing: Added isbn and pmid schemes 2014-07-27 19:59:57 +01:00
John MacFarlane
19109331df Markdown writer: Separate adjacent lists of the same kind with comment.
Closes #1458.
2014-07-27 08:26:17 -07:00
John MacFarlane
c302ab3133 Markdown writer: More improvements to 'plain' output, updated tests.
Math now appears in unicode if possible, without the distracting
italics around identifiers.

Blank lines around headers are more consistent.

Footnotes appear in regular [n] style.
2014-07-27 07:57:23 -07:00
John MacFarlane
cc24a1f3e5 Text.Pandoc.Pretty: added blanklines.
This ensures a certain number of blanklines (and no more) in output.
2014-07-27 07:56:55 -07:00
John MacFarlane
3eff3782c1 Markdown writer: Better 'plain' output.
We now largely follow the style of Project Gutenberg.

Emphasis is rendered with `_underscores_`, strong with ALL CAPS.

The appearance of horizontal rules has changed (even in regular
markdown) to a line across the whole page.

Headings are rendered differently, using space to set them off.
2014-07-27 00:17:15 -07:00
John MacFarlane
18d72a0768 Markdown writer: Update definition lists.
They now behave like the new reader does. The old behavior
can be activated with the `compact_definition_lists` extension.
2014-07-27 00:15:18 -07:00
John MacFarlane
b104db4fb4 Docx writer: Added missing case from last commit. 2014-07-26 23:32:13 -07:00
John MacFarlane
2610de0159 Docx writer: include abstract with Abstract style.
Addresses docx part of #1451.
2014-07-26 22:55:45 -07:00
John MacFarlane
d9751f91c4 Merge pull request #1457 from mpickering/generalstate
Generalised more in Parsing.hs to enable the use of custom state
2014-07-26 19:01:26 -07:00
John MacFarlane
74690b191e Added t2t to -f in README documentation. 2014-07-26 18:49:19 -07:00
John MacFarlane
31b8a95c1d Merge pull request #1453 from mpickering/txt2tagsfinal
Txt2Tags Reader
2014-07-26 18:46:51 -07:00
Matthew Pickering
9e4604fa0b Added compatability layer to support directory-1.1 2014-07-27 00:36:23 +01:00
Matthew Pickering
00cb9836b8 Txt2Tags Reader: Updated README and package description 2014-07-27 00:12:57 +01:00
Matthew Pickering
f0a32197c8 Txt2Tags Reader: Added copyright information 2014-07-27 00:12:57 +01:00
Matthew Pickering
e340a7da02 Txt2Tags Reader: Added tests 2014-07-27 00:12:57 +01:00
Matthew Pickering
43304d6bd6 Txt2Tags Reader: Added recognition of macros 2014-07-27 00:12:56 +01:00
Matthew Pickering
ab3589ff0b Txt2Tags Reader: Integrated into pandoc 2014-07-27 00:12:56 +01:00
Matthew Pickering
7d04d383a6 Added txt2tags reader
http://txt2tags.org/

There are two points which currently do not match the official
implementation.

1. In the official implementation lists can not be nested like the
following but the reader would interpret this as a bullet list with the
first item being a numbered list.

```
  - + This is not a list
```

2. The specification describes how URIs automatically becomes links.
Unfortunately as is often the case, their definitiong of URI is not
clear. I tried three solutions but was unsure about which to adopt.

* Using isURI from Network.URI, this matches far too many strings and is
therefore unsuitable
* Using uri from Text.Pandoc.Shared, this doesn't match all strings that
the reference implementation matches
* Try to simulate the regex which is used in the native code

I went with the third approach but it is not perfect, for example
trailing punctuation is captured in Urls.
2014-07-27 00:12:56 +01:00
Matthew Pickering
5e2d22a27e Generalised more in Parsing.hs to enable the use of custom state 2014-07-26 21:23:49 +01:00
John MacFarlane
18f4490482 Fixed runtime error with compactify'DL on certain lists.
Closes #1452.  Added test.
2014-07-25 10:53:04 -07:00
Beni Cherniavsky-Paskin
28debcd9dd README: turn all extensions into headers for direct linking
Change all `**Extension: ...**` lines into headers to allow permalinking to a specific extension.
2014-07-23 22:50:46 +03:00
John MacFarlane
9c3f7688ee DocBook reader: Better handle elements inside code environments.
Of course, we can't include structure in the code block, but
this way we at least preserve the text.  Closes #1449.
2014-07-23 10:06:36 -07:00
John MacFarlane
5089bc8fe2 Merge pull request #1444 from mpickering/master
Generalised readWith to readWithM
2014-07-22 09:14:38 -07:00
Matthew Pickering
83028c5982 Exported runParserT and Stream 2014-07-22 16:37:41 +01:00
Matthew Pickering
e045b1d5f2 Generalised readWith to readWithM 2014-07-22 15:13:54 +01:00
John MacFarlane
5debb492ef Revert "Shared.hierarchicalize: Don't number subsections of unnumbered sections."
This reverts commit 2a46042661.
2014-07-21 20:47:18 -07:00
John MacFarlane
2a46042661 Shared.hierarchicalize: Don't number subsections of unnumbered sections.
They were previously numbered, starting from the previous numbered
section, which was wrong.
2014-07-21 12:35:11 -07:00
John MacFarlane
3670dda17c Markdown writer: Avoid wrapping that might start a list.
Or a blockquote or header.  Closes #1013.
2014-07-21 00:03:51 -07:00
John MacFarlane
0f970ed95b EPUB writer: Avoid excess whitespace in nav.xhtml.
This should improve TOC view in iBooks.  Closes #1392.
2014-07-20 23:28:44 -07:00
John MacFarlane
64c7a0ab76 Include lot and lof variables in latex template.
These can be set to get `\listoftables` and `\listoffigures`.
Closes #1407.

At this point we won't add a command line argument, because
this only affects one writer.  But the variables can be set
at the command line with

    -Vlof -Vlot

or in YAML metadata.
2014-07-20 21:58:16 -07:00
John MacFarlane
98c7ada061 HTML reader: parse Div and Span elements even without --parse-raw.
Closes #1434.
2014-07-20 21:43:54 -07:00
John MacFarlane
b6c769084e Fix behavior of markdown_attribute extension.
It now works as in PHP markdown extra.  Setting `markdown="1"` on
an outer tag affects all contained tags until it is reversed with
`markdown="0"`.  Closes #1378.

Added `stateMarkdownAttribute` to `ParserState`.
2014-07-20 17:44:28 -07:00
John MacFarlane
a243afb551 Markdown reader: Fixed small bug in HTML parsing with markdown_attribute.
Test case:

    <aside markdown="1">
    *hi*
    </aside>

Previously gave:

    <article markdown="1">
    <p><em>hi</em> </article></p>
2014-07-20 17:22:29 -07:00
John MacFarlane
4d2e6e826d Updated changelog. 2014-07-20 17:04:28 -07:00
John MacFarlane
4af8eed764 Markdown reader: revised definition list syntax (closes #1429).
* This change brings pandoc's definition list syntax into alignment
  with that used in PHP markdown extra and multimarkdown (with the
  exception that pandoc is more flexible about the definition markers,
  allowing tildes as well as colons).

* Lazily wrapped definitions are now allowed; blank space is required
  between list items; and the space before definition is used to
  determine whether it is a paragraph or a "plain" element.

* For backwards compatibility, a new extension,
  `compact_definition_lists`, has been added that restores the behavior
  of pandoc 1.12.x, allowing tight definition lists with no blank space
  between items, and disallowing lazy wrapping.
2014-07-20 16:33:59 -07:00
John MacFarlane
cdc4ecbe98 readWith: reverted generalization from f201bdcb.
We need input to be a string so we can print the offending line
on an error.
2014-07-20 13:51:03 -07:00
John MacFarlane
87096c64f8 Org reader: text adjacent to a list yields a Plain, not Para.
This gives better results for tight lists.  Closes #1437.

An alternative solution would be to use Para everywhere, and
never Plain.  I am not sufficiently familiar with org to know
which is best.  Thoughts, @tarleb?
2014-07-20 12:56:01 -07:00
John MacFarlane
0f01421f81 AsciiDoc writer: Double markers in intraword emphasis.
Closes #1441.
2014-07-20 12:24:53 -07:00
John MacFarlane
a7b64532f5 Merge pull request #1438 from mpickering/master
Renamed readTeXMath' to avoid name conflict with texmath 0.6.7
2014-07-19 17:18:35 -07:00
John MacFarlane
999b952a21 Require highlighting-kate >= 0.5.8.5. 2014-07-19 17:16:41 -07:00
Matthew Pickering
e7d8039969 Renamed readTeXMath' to avoid name conflict with texmath 0.6.7
Also removed deprecated readTeXMath.
2014-07-19 18:10:59 +01:00
John MacFarlane
fe6b4e532d Fixed typo in link 2014-07-17 19:40:01 -07:00
John MacFarlane
c3db0bb6a9 Merge pull request #1435 from bosmacs/org-babel-exports
Org reader: Respect :exports header arguments on code blocks
2014-07-17 10:37:28 -07:00
Craig S. Bosma
1bb4f0c497 Org reader: Respect :exports header arguments on code blocks
Adds support to the org reader for conditionally exporting either the code block,
results block immediately following, both, or neither, depending on the value
of the `:exports` header argument. If no such argument is supplied, the default
org behavior (for most languages) of exporting code is used.
2014-07-17 10:23:22 -05:00
John MacFarlane
e053562280 Remove unused import. 2014-07-16 23:56:24 -07:00
John MacFarlane
0e9d3db244 Custom writers now work with --template.
Removed HTML header scaffolding from data/sample.lua.
2014-07-16 15:17:08 -07:00