Commit graph

741 commits

Author SHA1 Message Date
John MacFarlane
0d95c15e83 TexMath: Export readTeXMath', which attends to display/inline.
Deprecate readTeXMath, and use readTeXMath' in all the writers.
Require texmath >= 0.6.5.
2013-11-01 14:28:24 -07:00
John MacFarlane
e63aafd620 Fix definition lists with internal links in terms (closes #1032).
This fix puts braces around a term that contains an internal
link, to avoid problems with square brackets.
2013-10-21 17:33:42 -07:00
John MacFarlane
9d6bca06ee Pass the buildDir as first argument to test suite.
Allows test suite to work with cabal sandboxes.
Previously we hard-coded the build directory.
2013-10-20 12:36:26 -07:00
John MacFarlane
e5feed00f7 MediaWiki reader: Trim contents of <math> tags.
Otherwise we get problems when converting to markdown.

Closes #1027.
2013-10-18 17:50:43 -07:00
John MacFarlane
a117a88137 Updated opendocument tests. 2013-09-24 18:41:46 -07:00
John MacFarlane
21f1bcb280 Markdown reader: unresolved citations fall back to original text.
Not ???.

Reason:  Less surprising, especially for people using @ as
in twitter.
2013-09-14 22:28:37 -07:00
John MacFarlane
71841de0f3 Mediawiki: Parse an image + caption in a para by itself as a figure. 2013-09-11 09:31:41 -07:00
John MacFarlane
8d43e08ce7 Markdown writer: Fixed bugs in YAML header output. 2013-09-06 22:26:38 -07:00
John MacFarlane
9b0b9b6e03 Markdown reader: Don't autolink a bare URI that is followed by </a>.
Closes #937.
2013-09-01 15:18:56 -07:00
John MacFarlane
90c49b0aae Use registerHeader in Textile reader.
This produces automatic header identifiers, unless `auto_identifiers`
extension is disabled.

Closes #967.
2013-09-01 09:22:55 -07:00
John MacFarlane
9282f63278 Use registerHeader in RST and LaTeX readers.
This will give automatic unique identifiers, unless
`-auto_identifiers` is specified.
2013-09-01 09:13:31 -07:00
John MacFarlane
4e4c948b41 Added markdown citation parsing test. 2013-08-26 22:30:27 -07:00
John MacFarlane
e7a4bcc6fe Merge pull request #961 from nougad/add_latex_listings_label
Write id for code block to label attr in latex when listing is used
2013-08-25 20:48:38 -07:00
John MacFarlane
152d2919ab Removed tests relating to citation processing. 2013-08-25 07:41:37 -07:00
John MacFarlane
deb59b6235 Removed dependency on citeproc-hs.
Going forward we'll use pandoc-citeproc, as an external filter.

The `--bibliography`, `--csl`, and `--citation-abbreviation` fields
have been removed.  Instead one must include `bibliography`, `csl`,
or `csl-abbrevs` fields in the document's YAML metadata.  The filter
can then be used as follows:

    pandoc --filter pandoc-citeproc

The `Text.Pandoc.Biblio` module has been removed.  Henceforth,
`Text.CSL.Pandoc` from pandoc-citations can be used by library users.

The Markdown and LaTeX readers now longer format bibliographies and
citations.  That must be done using `processCites` or `processCites'`
from Text.CSL.Pandoc.

All bibliography-related fields have been removed from `ReaderOptions`
and `WriterOptions`: `writerBiblioFiles`, `readerReferences`,
`readerCitationStyle`.

API change.
2013-08-24 22:33:01 -07:00
Florian Eitel
5f09cf7ff0 Write id for code block to label attr in latex when listing is used
The code:

    ~~~{#test}
    asdf
    ~~~

gets compiled to html:

    <pre id="test">
    asdf
    </pre>

So it is possible to link to the identifier `test`

But this doesn't happen on latex

When using the listings package (`--listings`) it is possible to set the
identifier using the `label=test` property:

    \begin{lstlisting}[label=id]
    hi
    \end{lstlisting}

And this is exactly what this patch is doing.

Modified LaTeX Reader/Writer and added tests for this.
2013-08-22 20:15:36 +02:00
John MacFarlane
b1d08a8aa8 Merge branch 'altcite' 2013-08-20 22:00:39 -07:00
John MacFarlane
7048c130ec Create Cite element even if no matching reference in the biblio.
* Add ??? as fallback text for non-resolved citations.
* Biblio:  Put references (including a header at the end of
  the document, if one exists) inside a Div with class "references".
  This gives some control over styling of references, and allows
  scripts to manipulate them.
* Markdown writer:  Print markdown citation codes, and disable
  printing of references, if `citations` extension is enabled.

NOTE:  It would be good to improve what citeproc-hs does for
a nonexistent key.
2013-08-20 20:47:06 -07:00
John MacFarlane
e8ddcfd997 Scale LaTeX tables so they don't exceed columnwidth. 2013-08-19 16:03:22 -07:00
John MacFarlane
8d441af3da Adjusted writers and tests for change in parsing of div/span.
Textile, MediaWiki, Markdown, Org, RST will emit raw HTML div tags for divs.
Otherwise Div and Span are "transparent" block containers.
2013-08-18 14:36:40 -07:00
John MacFarlane
441a7aebf8 LaTeX writer: Avoid problem with footnotes in unnumbered headers.
Closes #940.
Added test case.
2013-08-16 13:03:38 -07:00
John MacFarlane
309024971c Updated tests for latest pandoc-types changes. 2013-08-16 12:25:21 -07:00
John MacFarlane
3e8bd8aa15 Updated for removed unMeta, unFormat in pandoc-types. 2013-08-14 23:24:45 -07:00
John MacFarlane
eb0c0b86ed ODT/OpenDocument writer: Minor changes for ODF 1.2 conformance.
See #939.  We leave the nonconforming contextual-spacing attribute,
which is provided by LibreOffice itself and seems to be supported.
2013-08-11 17:13:46 -07:00
John MacFarlane
6f736dfa75 Added Tests.Walk.
This verifies that walk and query match the generic traversals.
2013-08-10 19:04:15 -07:00
John MacFarlane
210d7b7bce Updated tests for new Format. 2013-08-10 17:53:11 -07:00
John MacFarlane
cbfa932106 Adjustments for new Format newtype. 2013-08-10 17:24:54 -07:00
John MacFarlane
4a84b78100 MediaWiki writer: Use native mediawiki tables instead of HTML.
Closes #720.
2013-08-03 23:05:14 -07:00
John MacFarlane
85cc140744 Textile reader: Improved handling of <pre> blocks.
* Closed #927 (a bug in which `<pre>` in certain contexts was
  not recognized as a code block).
* Remove internal HTML tags in code blocks, rather than printing
  them verbatim.
* Parse attributes on `<pre>` tag for code blocks.
2013-07-25 09:45:23 -07:00
John MacFarlane
af5705308a Test suite changes for new highlighting-kate version. 2013-07-23 20:31:49 -07:00
John MacFarlane
800c5490ec LaTeX reader: Don't add spurious ", " to citation suffixes.
This is added when needed in Text.Pandoc.Biblio anyway.
2013-07-21 11:44:49 -07:00
Alexander Kondratskiy
0b49f810f4 Fixing wrong numbered-list indentation in open document format 2013-07-14 14:33:58 -04:00
John MacFarlane
35e2caa058 Updated a test whose output changed due to last commit. 2013-07-13 13:47:09 -07:00
John MacFarlane
9009a7e4a8 Markdown writer: Commas are okay in plain yaml scalars.
It's just commas with brackets that can cause problems.
2013-07-01 21:00:46 -07:00
John MacFarlane
e7a68fc7e8 Markdown writer: Render yaml title block fields in alpha order.
This makes the output predictable; previously it varied across
implementations.
2013-07-01 20:56:27 -07:00
John MacFarlane
19ad69b1c6 Improvements to yaml title block writer. 2013-07-01 16:28:34 -07:00
John MacFarlane
21a9b44609 Switched order of fields in yaml header (writer test). 2013-07-01 14:38:32 -07:00
John MacFarlane
2d46828b1c Revert "Markdown writer: Don't include variables in metadata."
This reverts commit 0ec8573347.
2013-07-01 14:17:04 -07:00
John MacFarlane
0ec8573347 Markdown writer: Don't include variables in metadata. 2013-07-01 12:48:13 -07:00
John MacFarlane
5d01e9a117 Markdown writer: Support yaml title block. 2013-06-30 23:37:27 -07:00
John MacFarlane
5cb0f0bbf1 ConTeXt writer: Properly handle tables without captions.
The old output only worked in MkII. This should work in MkIV
as well.

Closes #837.
2013-06-28 21:30:27 -07:00
John MacFarlane
dd96213c05 Man writer: give more fine-grained control in template.
Now the `title`, `section`, `header`, and `footer` can all be set
individually in metadata.  The `description` variable has been
removed.

Quotes have been added so that spaces are allowed in the title.

If you have a title that begins

    COMMAND(1) footer here | header here

pandoc will parse it as before into a title, section, header, and
footer.  But you can also specify these elements explicitly.

Closes #885.
2013-06-27 19:32:28 -07:00
John MacFarlane
79a4ea03e2 Stop escaping | in LaTeX math.
This caused problems with array environments.  Closes #891.
2013-06-26 20:54:31 -07:00
John MacFarlane
f7f32af293 Use latest chicago-author-date.csl. 2013-06-25 22:37:03 -07:00
John MacFarlane
243c56a880 Fixed 'authors' metadata parsing in reST.
Semicolons separate different authors.
2013-06-25 22:32:50 -07:00
John MacFarlane
08631ef1a3 Some test suite fixes for new metadata. 2013-06-25 22:32:50 -07:00
John MacFarlane
f869f7e08d Use new flexible metadata type.
* Depend on pandoc 1.12.
* Added yaml dependency.
* `Text.Pandoc.XML`: Removed `stripTags`.  (API change.)
* `Text.Pandoc.Shared`:  Added `metaToJSON`.
  This will be used in writers to create a JSON object for use
  in the templates from the pandoc metadata.
* Revised readers and writers to use the new Meta type.
* `Text.Pandoc.Options`: Added `Ext_yaml_title_block`.
* Markdown reader:  Added support for YAML metadata block.
  Note that it must come at the beginning of the document.
* `Text.Pandoc.Parsing.ParserState`:  Replace `stateTitle`,
  `stateAuthors`, `stateDate` with `stateMeta`.
* RST reader:  Improved metadata.
  Treat initial field list as metadata when standalone specified.
  Previously ALL fields "title", "author", "date" in field lists
  were treated as metadata, even if not at the beginning.
  Use `subtitle` metadata field for subtitle.
* `Text.Pandoc.Templates`:  Export `renderTemplate'` that takes a string
  instead of a compiled template..
* OPML template:  Use 'for' loop for authors.
* Org template: '#+TITLE:' is inserted before the title.
  Previously the writer did this.
2013-06-24 20:29:41 -07:00
John MacFarlane
a2b98ba218 Added test for #882. 2013-06-19 09:27:11 -07:00
John MacFarlane
6c5ba22c96 Added a test for #833. 2013-06-19 09:00:37 -07:00
John MacFarlane
b04dfde403 RST reader: don't insert paragraphs where docutils doesn't.
rst2html doesn't add `<p>` tags to list items (even when they are
separated by blank lines) unless there are multiple paragraphs in the
list.  This commit changes the RST reader to conform more closely to
what docutils does.

Closes #880.
2013-06-18 10:04:37 -07:00