Commit graph

10413 commits

Author SHA1 Message Date
Albert Krewinkel
2c71604554
data/pandoc.lua: add attr, listAttributes accessors
Elements with attributes got an additional `attr` accessor. Attributes
were accessible only via the `identifier`, `classes`, and `attributes`,
which was in conflict with the documentation, which indirectly states
that such elements have the an `attr` property.
2018-01-13 23:24:13 +01:00
Albert Krewinkel
e0cb0dab18
data/pandoc.lua: accept single block as singleton list
Every constructor which accepts a list of blocks now also accepts a
single block element for convenience.  Furthermore, strings are accepted as
shorthand for `{pandoc.Str "text"}` in constructors.
2018-01-13 22:32:22 +01:00
John MacFarlane
e5e69e68c9 MANUAL: recommend use of raw_attribute extension in header includes.
See #4253.
2018-01-13 12:22:25 -08:00
John MacFarlane
dca0032b0e LaTeX reader: allow macro definitions inside macros.
Previously we went into an infinite loop with

```
\newcommand{\noop}[1]{#1}
\noop{\newcommand{\foo}[1]{#1}}
\foo{hi}
```

See #4253.
2018-01-13 12:22:25 -08:00
John MacFarlane
44222e0373 LaTeX reader: allow macro definitions inside macros.
Previously we went into an infinite loop with

```
\newcommand{\noop}[1]{#1}
\noop{\newcommand{\foo}[1]{#1}}
\foo{hi}
```

See #4253.
2018-01-13 12:11:36 -08:00
Jesse Rosenthal
944ed5e098 Powerpoint writer: read presentation size from reference file.
Our presentation size is now dependent on the reference/template file
we use. This will make it easier to set different output sizes by
supplying different reference files. The alternative (allowing a user
to explicitly set output size regardless of the template) will lead to
too many thorny issues, as explicitly set sizes at the various level
of powerpoint layout would have to be reset.
2018-01-13 14:58:46 -05:00
Albert Krewinkel
9fdd266677
data/pandoc.lua: accept singleton inline as a list
Every constructor which accepts a list of inlines now also accepts a
single inline element for convenience.
2018-01-13 18:52:17 +01:00
Albert Krewinkel
1d639456d3
data/pandoc.lua: drop _VERSION
Having a _VERSION became superfluous, as this module is closely tied to
the pandoc version, which is available via PANDOC_VERSION.
2018-01-13 15:38:15 +01:00
Jesse Rosenthal
e08776b9d5 Powerpoint writer: code cleanup
Last commit accidentally left commented-out code in.
2018-01-13 09:34:03 -05:00
Jesse Rosenthal
a842d3ae7d Powerpoint writer: Handle (sub)headers above slidelevel correctly.
Above the slidelevel, subheaders will be printed in bold and given a
bit of extra space before them. Note that at the moment, no
distinction is made between levels of headers above the slide header,
though that can be changed. (It has to be changed in pandoc, since
PowerPoint has no concept of paragraph or character classes.)

This allows us to clean up the code as well: the code in
`blockToParagraphs` since it will only touch content blocks, and
therefore will not deal with headers at or below the slidelevel.
2018-01-13 09:08:28 -05:00
Jesse Rosenthal
194f08d17a Powerpoint writer: Check for required files
Since we now import from reference/dist file by glob, we need to make
sure that we're getting the files we need to make a non-corrupt
Powerpoint. This performs that check.

(In the process, this change also cleaned up a lot of commented-out
code left from the switch to the new reference-doc method.)
2018-01-13 07:37:02 -05:00
Jesse Rosenthal
a2870a1aeb Powerpoint writer: Improve templating using --reference-doc
Templating should work much more reliably now. There is still some
problem with image placement when we change sizes. A further commit
will address this.
2018-01-12 22:59:03 -05:00
Albert Krewinkel
8d5422f36b
Lua modules: add function pandoc.utils.run_json_filter
Runs a JSON filter on a Pandoc document.
2018-01-13 00:07:03 +01:00
Albert Krewinkel
5d49cbd35e
Move filter functions to separate module 2018-01-13 00:05:11 +01:00
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
newmana
6b40b8c27c Add header and footer parameters 2018-01-10 13:58:35 +10: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