Commit graph

10247 commits

Author SHA1 Message Date
Albert Krewinkel
6528082401
Lua filters: improve error messages
Provide more context about the task which caused an error.
2018-01-12 21:28:27 +01:00
Jesse Rosenthal
f130109b90 Powerpoint writer: Include Notes slide in TOC 2018-01-12 14:27:53 -05:00
Albert Krewinkel
5b852f8d2a
Lua filters: make PANDOC_READER_OPTIONS available
The options which were used to read the document are made available to
Lua filters via the `PANDOC_READER_OPTIONS` global.
2018-01-12 18:54:19 +01:00
Jesse Rosenthal
624abeec5c Powerpoint writer: allow setting toc-title in metadata.
Accompanying change in MANUAL.txt
2018-01-12 11:09:17 -05:00
Jesse Rosenthal
6d74b35751 Move metaValueToInlines to T.P.W.Shared
This will allow the Powerpoint writer to use it as well.
2018-01-12 11:06:03 -05:00
Jesse Rosenthal
1d9c2770e3 Powerpoint writer: Set notes slide header with slide-level
It used to be hardcoded to 2. This will set it to the appropriate
slide-level.
2018-01-12 10:48:28 -05:00
Jesse Rosenthal
021e5ac89d Powerpoint writer: Add table of contents
This is triggered by the `--toc` flag. Note that in a long slide deck
this risks overrunning the text box. The user can address this by
setting `--toc-depth=1`.
2018-01-12 10:43:02 -05:00
Jesse Rosenthal
4ce07c20d7 Powerpoint writer: Set notes slide number correctly
Previously, this hadn't been aware of a metadata slide. We also
clarify the logic for setting the startnumber of different slide
sections correctly.
2018-01-12 10:00:59 -05:00
Jesse Rosenthal
53c48dd2c9 Powerpoint writer: Ignore internal links without targets.
If the user entered an internal link without a corresponding anchor,
it would produce a corrupted file. Now we check the anchor map, and
make sure the target is in the file. If it isn't, we ignore it.
2018-01-12 09:45:01 -05:00
Jesse Rosenthal
0b66b56523 Powerpoint writer: Clean up adding metadata slide
We want to count the slide numbers correctly if it's in there.
2018-01-12 09:24:15 -05:00
Jesse Rosenthal
2afca42f77 Powerpoint writer: Add anchor links
For anchor-type links (`[foo](#bar)`) we produce an anchor link. In
powerpoint these are links to slides, so we keep track of a map
relating anchors to the slides they occur on.
2018-01-12 06:56:09 -05:00
Jesse Rosenthal
da72d0f412 Powerpoint writer: Make the slide number available to the blocks.
For anchors, block-processing functions need to know what slide number
they're in. We make the envCurSlideId available to blocks.
2018-01-12 06:56:09 -05:00
Jesse Rosenthal
206545c675 Powerpoint writer: move curSlideId to environment.
It really isn't a moving state, and that can be misleading.
2018-01-12 06:56:09 -05:00
John MacFarlane
9f888659f7 MANUAL.txt: clarify otherlangs in LaTeX.
Closes #4072.
2018-01-11 21:03:09 -08:00
John MacFarlane
c5ba3b8ee3 LaTeX reader: fix inconsistent column widths.
This fixes a bug whereby column widths for the body were
different from widths for the header in some tables.

Closes #4238.
2018-01-10 12:28:42 -08:00
John MacFarlane
49007ded7b RST reader: better handling for headers with an anchor.
Instead of creating a div containing the header, we put
the id directly on the header. This way header promotion
will work properly. Closes #4240.
2018-01-10 12:07:33 -08:00
John MacFarlane
13f7c2cf83 Fixed a test case so it works on windows too. 2018-01-09 17:45:02 -08:00
John MacFarlane
e3f01235e9 HTML writer: Fixed footnote backlinks with --id-prefix.
Closes #4235.
2018-01-09 15:29:27 -08:00
John MacFarlane
87e16563f4 Bump criterion upper bound. 2018-01-09 14:58:51 -08:00
Albert Krewinkel
f5e021998e
data/pandoc.lua: fix access to Attr components
Accessing an Attr value (e.g., ` Attr().classes`) was broken; the more
common case of accessing it via an Inline or Block element was
unaffected by this.
2018-01-09 19:44:42 +01:00
Albert Krewinkel
bf944e0aeb
data/pandoc.lua: slightly de-complicate accessor code
Change: minor
2018-01-09 07:44:09 +01:00
John MacFarlane
1d8f2edff0 Allow tasty 1.0. 2018-01-08 17:08:46 -08:00
Albert Krewinkel
78b142b880
data/pandoc.lua: cleanup code, remove cruft 2018-01-08 23:26:38 +01:00
mb21
9f2707818b MANUAL.txt update ICML link 2018-01-08 13:19:01 +01:00
John MacFarlane
5e3b465cd6 Fixed an item that went missing in changelog for 2.1. 2018-01-07 22:41:11 -08:00
John MacFarlane
b017ddf044 Added oltolm to AUTHORS 2018-01-07 22:39:58 -08:00
John MacFarlane
ecc3f09dfc More RELEASE_CHECKLIST tweaks. 2018-01-07 21:31:32 -08:00
John MacFarlane
00b9ca018f Update RELEASE_CHECKLIST. 2018-01-07 21:29:03 -08:00
John MacFarlane
5ca99f2cea Update changelog and man page. 2018-01-07 21:28:04 -08:00
John MacFarlane
ae6ba1533b Use latest skylighting and omit the 'missingincludes' check.
If you use a custom syntax definition that refers to a syntax
you haven't loaded, pandoc will now complain when it is highlighting
the text, rather than at the start.

This saves a huge performance hit from the `missingIncludes` check.

Closes #4226.
2018-01-07 19:24:08 -08:00
Albert Krewinkel
b6cec3da3f
data/pandoc.lua: fix docstrings
Change: minor
2018-01-07 22:41:59 +01:00
Albert Krewinkel
f277ac1338
data/pandoc.lua: make Attr an AstElement
Attr is an AST element, which is now reflected in the type hierarchy.
2018-01-07 22:41:59 +01:00
Albert Krewinkel
967a54dea3
data/pandoc.lua: drop 'pandoc-api-version' from Pandoc objects
This attribute was out-of-sync with the actual version as is mostly
irrelevant in the context Lua filters and custom writers.  Use the
global `PANDOC_API_VERSION` instead.
2018-01-07 14:06:34 +01:00
Albert Krewinkel
f5dec4bdc1
Lua: make pandoc-types version available as PANDOC_API_VERSION
The current pandoc-types version is made available to Lua programs in
the global PANDOC_API_VERSION. It contains the version as a list of
numbers.
2018-01-07 14:06:34 +01:00
Albert Krewinkel
043740d32b
Lua: make pandoc version available as PANDOC_VERSION
The current pandoc version is made available to Lua programs in the
global PANDOC_VERSION.  It contains the version as a list of numbers.
2018-01-07 13:43:03 +01:00
Albert Krewinkel
458e633bc4
data/pandoc.lua: make all types subtypes of AstElement
*Pandoc*, *Meta*, and *Citation* were just plain functions and did not
set a metatable on the returned value, which made it difficult to amend
objects of these types with new behavior. They are now subtypes of
AstElement, meaning that all their objects can gain new features when a
method is added to the behavior object (e.g., `pandoc.Pandoc.behavior`).
2018-01-07 11:22:53 +01:00
Albert Krewinkel
b70079fbfa
data/pandoc.lua: split type and behavior tables
Clearly distinguish between a type and the behavioral properties of an instance
of that type. The behavior of a type (and all its subtypes) can now be amended
by adding methods to that types `behavior` object, without exposing the type
objects internals.

E.g.:

    pandoc.Inline.behavior.frob = function () print'42' end
    local str = pandoc.Str'hello'
    str.frob() -- outputs '42'
2018-01-06 23:25:08 +01:00
Albert Krewinkel
a2e327f0db
data/pandoc.lua: rename Element to AstElement
This avoids confusion with the Element type from Text.Pandoc.Shared.

Change: minor
2018-01-06 23:25:08 +01:00
Albert Krewinkel
5942da4ff7
data/pandoc.lua: remove dead code
A `Element:new` method was a left-over was never called.

Change: minor
2018-01-06 23:25:08 +01:00
Albert Krewinkel
f492f5a6dd
data/pandoc.lua: fix Element inheritance
Extending all elements of a given type (e.g., all inline elements) was
difficult, as the table used to lookup unknown methods would be reset
every time a new element of that type was created, preventing recursive
property lookup. This is was changed in that all methods and attributes
of supertypes are now available to their subtypes.
2018-01-06 23:25:08 +01:00
John MacFarlane
3a22907306 Don't use missingIncludes unless custom syntax defs have been given.
This avoids a huge performance sink that comes from evaluating
all the elements of the default syntax map.

Better just to have run-time errors for missing includes?

See #4226.
2018-01-06 00:33:34 -08:00
Albert Krewinkel
0d935bd081
Update copyright notices to include 2018 2018-01-05 20:39:12 +01:00
Albert Krewinkel
4f564b9203
data/pandoc.lua: fix attribute names of Citation
The fields were named like the Haskell fields, not like the documented,
shorter version.  The names are changed to match the documentation and
Citations are given a shared metatable to enable simple extensibility.

Fixes: #4222
2018-01-05 08:20:59 +01:00
Albert Krewinkel
856bc54526
Use hslua utils where possible
Some helper functions and types have been moved to hslua.

Change: minor
2018-01-04 23:15:28 +01:00
Albert Krewinkel
bdb911550c
Bump hslua version to 0.9.5
This version fixes a bug that made it difficult to handle failures while
getting lists or a Map from Lua. A bug in pandoc, which made it
necessary to always pass a tag when using MetaList or MetaBlock, is
fixed as a result. Using the pandoc module's constructor functions for
these values is now optional (if still recommended).
2018-01-04 23:15:28 +01:00
Jesse Rosenthal
7c8a6feaf2 Powerpoint writer: remove some code duplication. 2018-01-04 09:46:34 -05:00
Jesse Rosenthal
85f8d92850 Powerpoint writer: Ignore Notes div
For now, ignore notes div for parity with other slide outputs.
2018-01-03 22:07:07 -05:00
Jesse Rosenthal
bf15258d3b Powerpoint writer: Set default slidelevel correctly.
We had previously defaulted to slideLevel 2. Now we use the correct
behavior of defaulting to the highest level header followed by
content. We change an expected test result to match this behavior.
2018-01-03 21:58:39 -05:00
Jesse Rosenthal
41dc65b37f Powerpoint writer: Split blocks correctly for linked images
We treat links with an image as the first inline as an image with a
link picProp -- so we have to split on it the same as if it were an
image.
2018-01-03 20:52:48 -05:00
Jesse Rosenthal
101aece6cc Powerpoint writer: combine adjacent runs.
This will make the xml easier to read for debugging purposes. It
should also make links behave more consistently across numerous words.
2018-01-03 17:54:43 -05:00