Commit graph

12510 commits

Author SHA1 Message Date
John MacFarlane
9d581428f9 Add test for #5690. 2019-08-23 10:15:42 -07:00
John MacFarlane
d6fdfe6f2b Asciidoc writer: handle admonitions.
Closes #5690.
2019-08-23 10:00:10 -07:00
John MacFarlane
8e01ccb41d RST reader: use title, not admonition-title, for admonition title.
This puts RST reader into alignment with docbook reader.
2019-08-23 09:23:15 -07:00
John MacFarlane
1c71bd1ff5 Ensure proper nesting when we have long ordered list markers.
Closes #5705.
2019-08-23 09:16:54 -07:00
Michael Peyton Jones
9b5082b086 docbook: richer parse for admonitions (#5593)
Fixes #1234.

This parses admonitions not as a blockquote, but rather as a div with an
appropriate class. We also handle titles for admonitions as a nested div
with the "title" class.

(I followed the behaviour of other docbook-to-html converters in this -
there are clearly other ways you could encode it.)

In general, the handling of elements with nested title elements is very
inconsistent. I think we should make it consistent, but I'm leaivng that
for later to make this a small change.

Example:
```docbook
<warning xml:id="someId">
<title>My title</title>
<simpara>An admonition block</simpara>
</warning>
```

goes to

```html
<div id="someId" class="warning">
<div class="title">My title</div>
<p>An admonition block</p>
</div>
```
2019-08-23 09:13:31 -07:00
Krystof Beuermann
3344f861c4 add proofState to settingsList (#5703) 2019-08-23 08:45:37 -07:00
Albert Krewinkel
a5094dda61
Circle CI: use fpco/stack-build:lts-13 as base image 2019-08-16 20:52:15 +02:00
Albert Krewinkel
6166f9499f
cabal.project: remove options unsupported by GHC 8.0 2019-08-16 20:52:15 +02:00
Albert Krewinkel
1f9384542e
Lua: improve function documentations 2019-08-16 20:52:15 +02:00
Albert Krewinkel
2712d3e869
Lua: traverse nested blocks and inlines in correct order
Traversal methods are updated to use the new Walk module such that
sequences with nested Inline (or Block) elements are traversed in the
order in which they appear in the linearized document.

Fixes: #5667
2019-08-16 20:52:15 +02:00
Albert Krewinkel
813e1fc7e0
Lua: add module for AST element sequence traversal
Lua filters must be able to traverse sequences of AST elements and to
replace elements by splicing sequences back in their place. Special
`Walkable` instances can be used for this; those are provided in a new
module `Text.Pandoc.Lua.Walk`.
2019-08-16 20:52:15 +02:00
Albert Krewinkel
903d2f98c6
pandoc.cabal: add cabal.project to extra-source-files. 2019-08-15 19:28:17 +02:00
John MacFarlane
79a3449eeb LaTeX reader: improve withRaw so it can handle cases where...
the token string is modified by a parser (e.g. accent when
it only takes part of a Word token).

Closes #5686.  Still not ideal, because we get the whole
`\t0BAR` and not just `\t0` as a raw latex inline command.
But I'm willing to let this be an edge case, since you
can easily work around this by inserting a space, braces,
or raw attribute.  The important thing is that we no longer
drop the rest of the document after a raw latex inline
command that gobbles only part of a Word token!
2019-08-14 14:34:44 -07:00
John MacFarlane
e85178c32a Removed some needless lookaheads in Markdown reader. 2019-08-14 11:43:08 -07:00
John MacFarlane
eb23527121 Rename test for 5685 -> 5684 (typo in last commit).
Closes #5684. (Note that #5685 is NOT closed by previous commit.)
2019-08-14 11:13:18 -07:00
John MacFarlane
0b2fb9b8f9 Add thin space when needed in LaTeX quote ligatures.
Closes #5685.
2019-08-14 11:07:02 -07:00
Mauro Bieg
ace4cdfc23 MANUAL: link to YAML spec (#5687) 2019-08-14 10:09:19 -07:00
Zihang Chen
d4fa38a0a5 Fix multiline table for XWiki writer (#5683)
Details at https://groups.google.com/forum/#!topic/pandoc-discuss/c861tTdCFTg

Fix XWiki output for

```
+----------+----------+
| Col A    | Col B    |
+==========+==========+
| Row A    | * Item A |
|          | * Item B |
+----------+----------+
```

from (notice that the following XWiki code renders as a table followed by a singleton list)

```
|=Col A|=Col B
|Row A|*. Item A
*. Item B
```

to

```
|=Col A|=Col B
|Row A|(((*. Item A
*. Item B
)))
```
2019-08-13 16:37:41 -07:00
Jan-Otto Kröpke
a0a41c7a8e JIRA writer: Remove escapeStringForJira for code blocks 2019-08-11 21:57:12 +02:00
Leif Metcalf
e53c952997 Remove blank line (#5679) 2019-08-08 16:02:14 -07:00
John MacFarlane
6dd689ad97 Revert "Avoid a pointless Text -> String conversion on output."
This reverts commit 87ce1ffbd9.

This change caused a problem on Windows that we didn't have
before; this needs looking into.

https://ci.appveyor.com/project/jgm/pandoc/build/job/fxq96log042df8dk

    .\pandoc.exe -s --toc ..\MANUAL.txt -o MANUAL.html
    pandoc.exe: MANUAL.html: commitAndReleaseBuffer: invalid argument (invalid character)
    Command exited with code 1
2019-08-08 13:39:12 -07:00
John MacFarlane
b6490de03b lua-filters - avoid duplicate id element-components. 2019-08-08 11:29:36 -07:00
John MacFarlane
01ad9399b9 Update lua-filters doc from lua sources. 2019-08-08 11:21:31 -07:00
John MacFarlane
808602ed8a Fix links to Attr in lua-filters.doc. 2019-08-08 11:14:43 -07:00
John MacFarlane
21c9548960 lua-filters.doc: make table narrower so it doesn't crowd out TOC. 2019-08-08 11:02:23 -07:00
John MacFarlane
87ce1ffbd9 Avoid a pointless Text -> String conversion on output. 2019-08-07 09:23:59 -07:00
John MacFarlane
ec55382f8d Fix stack.yaml. 2019-08-07 08:33:30 -07:00
John MacFarlane
ea3a779f7b Use dev version of pandoc-citeproc. 2019-08-05 10:51:06 -07:00
Urs Liska
b3ead7cdcc Treat ly as verbatim too (#5671)
According to https://github.com/jgm/pandoc/issues/4725#issuecomment-399772217 not only the `lilypond` environment but also `ly` should be included in the verbatim list.

@jperon
https://github.com/jperon/lyluatex/issues/203
2019-08-05 10:35:17 -07:00
John MacFarlane
c452744520 Version bump to 2.8 because of type changes for templates. 2019-08-05 10:29:12 -07:00
John MacFarlane
0b82661e59 Markdown writer: Don't assume Doc has Eq instance.
It won't in a future version.
2019-07-30 21:24:57 -07:00
John MacFarlane
699dd6c367 ConTeXt writer; don't use == empty with Doc, use isEmpty. 2019-07-30 17:30:05 -07:00
John MacFarlane
c7c7664403 Update emoji list in Text.Pandoc.Emoji.
Done using tools/emojis.hs, which uses the list from the
gem GitHub uses.  Future updates can be done with this tool.

Closes #5666.
2019-07-29 11:17:22 -07:00
John MacFarlane
82d94d1452 Use latest doctemplates. 2019-07-29 10:56:43 -07:00
John MacFarlane
3ab1f21568 Use latest pandoc-citeproc. 2019-07-28 23:43:04 -07:00
John MacFarlane
1afea63308 Update muse template to handle multiple authors better. 2019-07-28 19:25:44 -07:00
John MacFarlane
b35fae6511 Use doctemplates 0.3, change type of writerTemplate.
* Require recent doctemplates.  It is more flexible and
  supports partials.
* Changed type of writerTemplate to Maybe Template instead
  of Maybe String.
* Remove code from the LaTeX, Docbook, and JATS writers that looked in
  the template for strings to determine whether it is a book or an
  article, or whether csquotes is used. This was always kludgy and
  unreliable.  To use csquotes for LaTeX, set `csquotes` in your
  variables or metadata. It is no longer sufficient to put
  `\usepackage{csquotes}` in your template or header includes.
  To specify a book style, use the `documentclass` variable or
  `--top-level-division`.
* Change template code to use new API for doctemplates.
2019-07-28 19:25:45 -07:00
John MacFarlane
99e24cf183 LaTeX reader: handle \passthrough macro used by latex writer.
Closes #5659.
2019-07-24 10:18:09 -07:00
Philip Pesca
01a52e2300 HTML writer: ensure TeX formulas are rendered correctly (#5658)
The web service passed in to `--webtex` may render formulas using inline
or display style by default. Prefixing formulas with the appropriate
command ensures they are rendered correctly.

This is a followup to the discussion in #5656.
2019-07-24 10:10:36 -07:00
John MacFarlane
060141bf2c Templates: don't import/export varListToJSON.
We'll be removing that in doctemplates 0.3.
2019-07-23 21:49:13 -07:00
John MacFarlane
1187ca3517 Templates: Change type of renderTemplate'.
Return value is now Text rather than being polymorphic.
This makes room for upcoming removal of the TemplateTarget
class from doctemplates.

Other code modified accordingly, and should compile with
both current and upcoming version of doctemplates.
2019-07-23 21:40:24 -07:00
Mauro Bieg
54b50cb29a revealjs template: add navigationMode (#5657) 2019-07-23 12:21:55 -07:00
Philip Pesca
bc508534a6 HTML writer: render inline formulas correctly with --webtex (#5656)
We add `\textstyle` to the beginning of the formula to ensure it will be rendered in inline style.
Closes #5655.
2019-07-23 12:21:31 -07:00
John MacFarlane
db5f6dd4fe Fix error introduced in change to test for 4669. 2019-07-22 15:32:49 -07:00
John MacFarlane
d9960244d8 LaTeX reader: support tex \tt command.
Closes #5654.
2019-07-22 15:29:07 -07:00
Albert Krewinkel
63c65c89da
Org reader: accept ATTR_LATEX in block attributes
Attributes for LaTeX output are accepted as valid block attributes;
however, their values are ignored.

Fixes: #5648
2019-07-22 08:12:22 +02:00
John MacFarlane
91d4283263 LaTeX writer: fix line breaks at start of paragraph.
Previously we just omitted these. Now we render them
using `\hfill\break` instead of `\\`.  This is a revision
of a PR by @sabine (#5591) who should be credited with the
idea.

Closes #3324.
2019-07-20 17:12:53 -07:00
John MacFarlane
b6f9318c9b PDF: Better detection of a Cygwin environment.
Should close #5451.

Unlike the earlier fix, this one doesn't spill out to stderr
when 'uname -o' fails.
2019-07-20 16:50:53 -07:00
John MacFarlane
fb73b5c27b Revert "PDF: create temp dir in . on Cygwin."
This reverts commit 50885eabde.

Reopens #5451.

The problem with the previous commit is that it would lead to
spurious messages on stderr on platforms like macOS.
2019-07-20 12:59:34 -07:00
John MacFarlane
8435de3236 Removed an unnecessary liftIO. 2019-07-20 12:53:44 -07:00