Commit graph

9473 commits

Author SHA1 Message Date
Alexander
5d74932578 Muse reader: avoid crashes on multiparagraph inline tags (#3866)
Test checks that behavior is consistent with Amusewiki
2017-08-22 23:12:34 -07:00
Alexander
c7d4fd8cf1 Muse reader: do not allow closing tags with EOF (#3863)
This behavior is compatible to Amusewiki
2017-08-22 16:34:18 -07:00
Albert Krewinkel
41baaff327
Text.Pandoc.Lua: support Inline and Block catch-alls
Try function `Inline`/`Block` if no other filter function of the
respective type matches an element.

Closes: #3859
2017-08-22 23:30:48 +02:00
Albert Krewinkel
56fb854ad8
Text.Pandoc.Lua: respect metatable when getting filters
This change makes it possible to define a catch-all function using lua's
metatable lookup functionality.

    function catch_all(el)
      …
    end

    return {
      setmetatable({}, {__index = function(_) return catch_all end})
    }

A further effect of this change is that the map with filter functions
now only contains functions corresponding to AST element constructors.
2017-08-22 22:56:51 +02:00
John MacFarlane
915f201c78 Travis: Use ghc 8.2.1 in nightly stack build. 2017-08-22 11:03:49 -07:00
John MacFarlane
19440cd5dc Undid last travis changes. 2017-08-22 10:07:25 -07:00
John MacFarlane
c5bb16b06b Travis: Removed sudos. 2017-08-22 09:46:54 -07:00
John MacFarlane
761a61b53e Travis: shut down essential services and show memory.
Also after failure.
2017-08-22 09:39:36 -07:00
John MacFarlane
cefdc01a93 Updated stack.pkg.yaml. 2017-08-21 22:27:26 -07:00
John MacFarlane
d3df168896 Travis: use lts-9 with ghc 8.0.2 stack build. Remove swap stuff.
It didn't help.
2017-08-21 22:20:54 -07:00
John MacFarlane
f2dfb3f23b Added introduction and lightly edited rest of lua-filters document.
See #3608.
2017-08-21 22:14:26 -07:00
John MacFarlane
c462fcafef travis: create some swap space.
This may help with regex-tdfa build failures...
2017-08-21 21:24:21 -07:00
John MacFarlane
6cba21b4d3 Small improvement to #3855 - move lang attribute up.
So we don't have a dangling line with the closing `>` when
`lang` is not set.
2017-08-21 21:16:55 -07:00
Jens Getreu
9375e50b96 docbook5 template: use lang and subtitle variables (#3855) 2017-08-21 21:10:41 -07:00
Alexander
0a839cbdc9 Muse reader: add definition list support (#3860) 2017-08-21 21:08:44 -07:00
Albert Krewinkel
4567105f6c
doc/lua-filter.md: Add metadata variable replacment example 2017-08-21 19:00:51 +02:00
Albert Krewinkel
8ef200b80f
data/pandoc.lua: fix documentation
Multiple documentation mistakes were fixed.
2017-08-21 17:47:54 +02:00
Albert Krewinkel
29a6793811
lua-filters.md: update docs and mention implicit filters 2017-08-21 16:53:00 +02:00
Albert Krewinkel
b81cff4357
data/pandoc.lua: Include Pandoc, Meta in implicit filters
Functions with a name that corresponds to an AST element are included in
implicit pandoc filter, but both `Meta` and `Pandoc` were wrongly
ignored till now.
2017-08-21 16:47:05 +02:00
John MacFarlane
d70b89c0d9 Use pandoc-types 1.17.1. Tests updated for new simpleTable behavior...
with empty headers.
2017-08-20 23:24:51 -07:00
John MacFarlane
9cc128b579 LaTeX reader: Set identifiers on Spans used for \label. 2017-08-20 16:52:03 -07:00
John MacFarlane
f2fdd275fd LaTeX reader: allow ] inside group in option brackets.
Closes #3857.
2017-08-20 13:42:43 -07:00
John MacFarlane
e334d7dc38 Protect OVERLAPS pragma with CPP. 2017-08-20 11:13:42 -07:00
John MacFarlane
ba3088f0b3 Use OverlappingInstances instead of OVERLAPS for ghc 7.8.4. 2017-08-20 10:43:31 -07:00
John MacFarlane
40d1246629 Removed redundant import. 2017-08-20 09:37:18 -07:00
John MacFarlane
8b8c94552f Simplify instances in Class by parameterizing on MonadTrans. 2017-08-19 16:39:22 -07:00
John MacFarlane
a31241a08b Markdown reader: use CommonMark rules for list item nesting.
Closes #3511.

Previously pandoc used the four-space rule: continuation paragraphs,
sublists, and other block level content had to be indented 4
spaces.  Now the indentation required is determined by the
first line of the list item:  to be included in the list item,
blocks must be indented to the level of the first non-space
content after the list marker. Exception: if are 5 or more spaces
after the list marker, then the content is interpreted as an
indented code block, and continuation paragraphs must be indented
two spaces beyond the end of the list marker.  See the CommonMark
spec for more details and examples.

Documents that adhere to the four-space rule should, in most cases,
be parsed the same way by the new rules.  Here are some examples
of texts that will be parsed differently:

    - a
      - b

will be parsed as a list item with a sublist; under the four-space
rule, it would be a list with two items.

    - a

          code

Here we have an indented code block under the list item, even though it
is only indented six spaces from the margin, because it is four spaces
past the point where a continuation paragraph could begin.  With the
four-space rule, this would be a regular paragraph rather than a code
block.

    - a

            code

Here the code block will start with two spaces, whereas under
the four-space rule, it would start with `code`.  With the four-space
rule, indented code under a list item always must be indented eight
spaces from the margin, while the new rules require only that it
be indented four spaces from the beginning of the first non-space
text after the list marker (here, `a`).

This change was motivated by a slew of bug reports from people
who expected lists to work differently (#3125, #2367, #2575, #2210,
 #1990, #1137, #744, #172, #137, #128) and by the growing prevalance
of CommonMark (now used by GitHub, for example).

Users who want to use the old rules can select the `four_space_rule`
extension.

* Added `four_space_rule` extension.
* Added `Ext_four_space_rule` to `Extensions`.
* `Parsing` now exports `gobbleAtMostSpaces`, and the type
  of `gobbleSpaces` has been changed so that a `ReaderOptions`
  parameter is not needed.
2017-08-19 15:45:01 -07:00
John MacFarlane
5ab1162def Markdown reader: fixed parsing of fenced code after list...
...when there is no intervening blank line.

Closes #3733.
2017-08-18 21:46:55 -07:00
John MacFarlane
fbb79c1bcd Strip executables in linux package. 2017-08-18 14:37:44 -07:00
John MacFarlane
995d17353b make_macos_package.sh: use strip to reduce executable size. 2017-08-18 14:34:46 -07:00
John MacFarlane
7cac58f126 Markdown reader: parse -@roe as suppress-author citation.
Previously only `[-@roe]` (with brackets) was recognized as
suppress-author, and `-@roe` was treated the same as `@roe`.

Closes jgm/pandoc-citeproc#237.
2017-08-18 11:40:57 -07:00
John MacFarlane
bfbdfa646a LaTeX reader: implement \newtoggle, \iftoggle, \toggletrue|false
from etoolbox.

Closes #3853.
2017-08-18 10:13:41 -07:00
John MacFarlane
d1444b4ecd RST reader/writer: support unknown interpreted text roles...
...by parsing them as Span with "role" attributes.
This way they can be manipulated in the AST.

Closes #3407.
2017-08-17 16:01:44 -07:00
John MacFarlane
b1f6fb4af5 HTML reader: support column alignments.
These can be set either with a `width` attribute or
with `text-width` in a `style` attribute.

Closes #1881.
2017-08-17 12:08:32 -07:00
John MacFarlane
b9b35059f6 LaTeX reader: support \lq, \rq. 2017-08-17 12:08:32 -07:00
ickc
2a0e2e6fd6 slidy uses https instead of http (#3848)
grep -rl 'http://www.w3.org/Talks/Tools/Slidy2' . | xargs sed -i 's/http:\/\/www\.w3\.org\/Talks\/Tools\/Slidy2/https:\/\/www\.w3\.org\/Talks\/Tools\/Slidy2/g'
2017-08-17 10:11:49 -07:00
John MacFarlane
c175317d03 LaTeX reader: support \textquoteleft|right, \textquotedblleft|right.
Closes #3849.
2017-08-17 10:09:35 -07:00
John MacFarlane
ae61d5f57d LaTeX reader: rudimentary support for \hyperlink. 2017-08-16 10:56:16 -07:00
John MacFarlane
db715ca847 LaTeX reader: use Link instead of Span for \ref.
This makes more sense semantically and avoids unnecessary
Span [Link] nestings when references are resolved.
2017-08-16 10:56:12 -07:00
John MacFarlane
c6ec189a96 Revision to binary format output to stdout:
We now allow default output to stdout when it can be
determined that the output is being piped.  (On Windows,
as mentioned before, this can't be determined.)

Using '-o -' forces output to stdout regardless.
2017-08-16 10:39:34 -07:00
schrieveslaach
cf4b40162d LaTeX reader: add Support for glossaries and acronym package (#3589)
Acronyms are not resolved by the reader, but acronym and glossary information is put into attributes on Spans so that they can be processed in filters.
2017-08-16 10:24:46 -07:00
John MacFarlane
708bb8afe4 Fix import in PDF. 2017-08-16 10:13:16 -07:00
John MacFarlane
68434957d6 Fixed command test #2994 on Windows. 2017-08-16 09:47:25 -07:00
John MacFarlane
61cf3affa9 Change behavior with binary format output to stdout.
Previously, for binary formats, output to stdout was disabled
unless we could detect that the output was being piped (and not
sent to the terminal).  Unfortunately, such detection is not
possible on Windows, leaving windows users no way to pipe binary
output.  So we have changed the behavior in the following way:

* If the -o option is not used, binary output is never sent
  to stdout by default; instead, an error is raised.
* IF '-o -' is used, binary output is sent to stdout, regardless
  of whether it is being piped. This works on Windows too.
2017-08-16 09:45:12 -07:00
Albert Krewinkel
7a40f4865f Ensure hslua is build for 32 bits on windows i386
This prevents some otherwise hard to find and hard miscalculations in
lua filters.
2017-08-16 15:47:05 +02:00
Albert Krewinkel
9b31835530 Update to hslua-0.8.0
hslua no longer provides lua stack instances for Int and Double, the
necessary instances are added to the Custom writer and the lua filtering
system.
2017-08-16 15:47:05 +02:00
John MacFarlane
f8b6a224ae Remove initial check for pdf creating program.
Instead, just try running it and raise the exception if it
isn't found at that point.

This improves things for users of Cygwin on Windows, where
the executable won't be found by `findExecutable` unless
`.exe` is added.

The same exception is raised as before, but at a later
point.

Closes #3819.
2017-08-15 21:17:20 -07:00
John MacFarlane
97fe6c35b5 Docx writer: fixed a regression (infinite loop on certain lists).
Bug was introduced by commit a868b238f2.
2017-08-15 14:05:10 -07:00
John MacFarlane
892a4edeb1 Implement multicolumn support for slide formats.
The structure expected is:

    <div class="columns">
      <div class="column" width="40%">
        contents...
      </div>
      <div class="column" width="60%">
        contents...
      </div>
    </div>

Support has been added for beamer and all HTML slide formats.

Closes #1710.

Note:  later we could add a more elegant way to create
this structure in Markdown than to use raw HTML div elements.
This would come for free with a "native div syntax" (#168).
Or we could devise something specific to slides
2017-08-14 23:17:44 -07:00
John MacFarlane
23d29ee10c Use latest commit for pandoc-citeproc. 2017-08-14 15:45:18 -07:00