Commit graph

14873 commits

Author SHA1 Message Date
John MacFarlane
70eeeca9c7 Docx writer: use getTimestamp for modification times in reference.docx.
This ensures that when `SOURCE_DATE_EPOCH` is set, the
modification times of files taken from the reference.docx will
be set deterministically, allowing for reproducible builds.

Closes #7654.
2021-11-02 09:29:34 -07:00
Albert Krewinkel
b26f950cca
Lua: display Attr values using their native Haskell representation 2021-11-02 17:25:47 +01:00
Albert Krewinkel
c467f0fed1
Lua: allow omitting the 2nd parameter in pandoc.Code constructor
Fixes a regression introduced in 2.15 which required users to always
specify an Attr value when constructing a Code element.
2021-11-02 17:23:24 +01:00
Albert Krewinkel
210e4c98b0
Lua: allow to compare, show Citation values
Comparisons of Citation values are performed in Haskell; values are
equal if they represent the same Haskell value. Converting a Citation
value to a string now yields its native Haskell string representation.
2021-11-02 16:49:50 +01:00
Albert Krewinkel
3a0ac52f7b
Lua tests: ensure Block elements have expected properties 2021-11-02 10:23:14 +01:00
Albert Krewinkel
759aa50951
Lua: restore content property on Header elements 2021-11-01 15:43:51 +01:00
Albert Krewinkel
1c02145d93
Lua: load module pandoc.path on startup
Previously the module always had to be loaded via
`require 'pandoc.path'`.

Closes: #7524
2021-11-01 13:48:36 +01:00
Albert Krewinkel
96e76d4cd4
Lua: restore List behavior of MetaList
Fixes a regression introduced in 2.16 which had MetaList elements loose
the `pandoc.List` properties.

Fixes #7650
2021-11-01 08:27:14 +01:00
John MacFarlane
171bfd3d65 Makefile: use --nonmoving-gc RTS option when running benchmarks.
As recommended by tasty maintainers.
2021-10-31 13:17:57 -07:00
John MacFarlane
64eb59a7a0 Makefile: remove man/pandoc.1 dependency for debpkg. 2021-10-31 11:12:48 -07:00
John MacFarlane
a99269eef0 Update changelog. 2021-10-31 09:58:39 -07:00
John MacFarlane
d405846873 Regenerate man page. 2021-10-31 09:39:56 -07:00
Albert Krewinkel
3de8f4fdc5
Lua: re-add content property to Link elements
This was a regression introduced in version 2.15.

Fixes: #7647
2021-10-31 11:15:50 +01:00
John MacFarlane
40655b54a2 Bump to 2.16, update changelog. 2021-10-31 00:01:03 -07:00
John MacFarlane
621397f42e Allow time 1.13 2021-10-30 23:48:06 -07:00
Joseph C. Sible
b3d09ebe01 Fix build on GHC 9.2 2021-10-30 11:39:20 -07:00
John MacFarlane
2894c10b28 Fix trypandoc so it builds with aeson > 2. 2021-10-29 09:50:32 -07:00
Tristan Stenner
2444cbc668 Docx writer: add IDs to native_numbering test 2021-10-29 08:40:20 -07:00
Tristan Stenner
31d6a494de Update test golden master for docx native numbering 2021-10-29 08:40:20 -07:00
Tristan Stenner
6509ff6204 Docx writer: move ": " out of the caption bookmark.
This is needed so that native references to the figure are included as
"As seen in Figure X, it is..." instead of
"As seen in [Figure: , it is..."
2021-10-29 08:40:20 -07:00
Albert Krewinkel
f4d9b443d8
Lua: use hslua module abstraction where possible
This will make it easier to generate module documentation in the future.
2021-10-29 17:08:30 +02:00
Albert Krewinkel
e1cf0ad1be
Lua: fix placement of tests for Block elements in pandoc module tests 2021-10-28 14:10:54 +02:00
Albert Krewinkel
af97598954
Lua: increase strictness when getting attribute keys 2021-10-28 10:32:00 +02:00
John MacFarlane
a1e422097a Require latest skylighting (0.12.1). 2021-10-27 21:13:29 -07:00
John MacFarlane
84e4222fed short-guide: Transitions -> Transformations. 2021-10-27 16:19:39 -07:00
Albert Krewinkel
3849e12d45 Update description of T.P.PDF
Co-authored-by: Mauro Bieg <mb21@users.noreply.github.com>
2021-10-27 16:16:53 -07:00
Albert Krewinkel
25b031e3c3 Add a short guide to pandoc's sources 2021-10-27 16:16:53 -07:00
Albert Krewinkel
7fcf1d6184
Lua: re-add t and tag property to Attr values
Removal of these properties from Attr values was a regression.
2021-10-27 22:32:19 +02:00
John MacFarlane
25a86fc06f Markdown writer: Be sure to quote special values in YAML metadata.
E.g. "Y", "yes", which are now (with yaml library) considered
boolean values, as well as "null".

This fixes a bug with roundtripping markdown -> markdown:

```
---
foo: "true"
...
```
2021-10-27 12:50:51 -07:00
John MacFarlane
26a8de684e Change JSON encodings of some types.
- For LineEnding use lowercase constructors, e.g. `crlf`, `native`.
  This was the original intent, but there was a bug in the
  implementation.
- For HTMLSlideVariant use lowercase constructors.
- For ReaderOptions use e.g. `default-image-extension`
  instead of `readerDefaultImageExtension` for field names.
- For Extension, use e.g. `tex_math_dollars` instead of
  `Ext_tex_math_dollars` as constructor.
- For Extensions, use an array of Extensions, instead of
  an object wrapping the tag `Extensions` and an integer.
  (The representation is not supposed to be part of the
  public API.)
- For Opt, use field names like `tab-stop` instead of `optTabStop`.
2021-10-27 12:50:51 -07:00
John MacFarlane
d226a35c0a Switch back from HsYAML to yaml.
Reasons:

- Performance: HsYAML is around 20 times slower in parsing
  large YAML bibliographies (#6084).
- An issue was submitted to HsYAML, but it hasn't gotten
  any attention.  HsYAML seems borderline unmaintained; it hasn't
  had a commit in over a year.
- Unfortunately this goes back on our attempts to free ourselves
  from C dependencies (#4535).  But I don't see a better alternative
  until a better pure Haskell parser is available.

Closes #6084.

Notes:

- We've removed the FromYAML instances for all types that had
  them, since this is a HsYAML-specific typeclass [API change].
  (The yaml package just uses From/ToJSON.)
- Unlike HsYAML (in the configuration we were using), yaml
  parses 'Y', 'N', 'Yes', 'No', 'On', 'Off' as boolean values.
  Users may need to quote these when they are meant to be
  interpreted as strings.  Similarly, 'null' is parsed as
  a YAML null value (and will be treated as an empty string
  by pandoc rather than the string 'null').  Quoting it will
  force it to be interpreted as a string.
- Some tests had to be adjusted accordingly.
- Pandoc now behaves better when the YAML metadata contains
  escaping errors: instead of just falling back on treating
  the section as a table, it raises a YAML parsing error.
2021-10-27 12:50:51 -07:00
Albert Krewinkel
b990ca3c4c
Lua: fix pandoc.utils.stringify regression
The `pandoc.utils.stringify` function returned empty strings when called
with a string argument.
2021-10-27 20:56:30 +02:00
John MacFarlane
2910f9f3f8 Fix a copy/paste bug in Lua marshalling code.
This led changes in link properties in Lua filters to
change the links into images!

Closes #7639.
2021-10-26 21:48:56 -07:00
Albert Krewinkel
b95e864ecf
Lua: marshal SimpleTable values as userdata objects 2021-10-26 21:45:16 +02:00
Albert Krewinkel
80ed81822e
Lua: generate constants in module pandoc programmatically 2021-10-26 14:40:11 +02:00
Albert Krewinkel
f56d870631
Lua: marshal ListAttributes values as userdata objects 2021-10-26 14:40:11 +02:00
Albert Krewinkel
a493c7029c
Lua: marshal Block values as userdata objects
Properties of Block values are marshalled lazily, which generally
improves performance considerably. Script users may also notice the
following differences:

  - Block element properties can no longer be accessed by numerical
    indexing of the `.c` field. The `.c` property now serves as an alias
    for `.content`, so some filter that used this undocumented method
    for property access may continue to work, while others will need to
    be updated and use proper property names.

  - The marshalled Block elements now have a `show` method, and a
    `__tostring` metamethod. Both return the Haskell string
    representation of the element.

  - Block values now have the Lua type `userdata` instead of `table`.
2021-10-26 14:40:10 +02:00
Albert Krewinkel
230b133db5
Lua: marshal Citation values as userdata objects 2021-10-25 09:08:58 +02:00
John MacFarlane
113a66bd08 Fix more epub files in epub reader tests.
Closes #7586.
2021-10-24 15:24:59 -07:00
John MacFarlane
73a105f59c Clean up wasteland.epub and formatting.epub from reader tests.
Make them valid according to epubcheck.
2021-10-24 15:11:02 -07:00
John MacFarlane
c282451fb2 Fixed test/epub/img.epub and img_no_cover.epub...
so they're valid epubs.
2021-10-24 14:13:04 -07:00
John MacFarlane
6df9dc1262 Fix conformance errors in test/epub/features.epub and
test/epub/formatting.epub.  See #7586.
2021-10-23 23:23:22 -07:00
John MacFarlane
a140633400 Fix description of sandbox feature in changelog. 2021-10-23 19:35:05 -07:00
John MacFarlane
c41ea00820 Update AUTHORS.md 2021-10-23 19:33:09 -07:00
John MacFarlane
6dc56ee4f0 Fix 2.15 release date on changelog. 2021-10-23 19:25:31 -07:00
John MacFarlane
94bf66c27e CircleCI: use homebrew not curl to install stack. 2021-10-23 19:03:08 -07:00
John MacFarlane
844a080d2a Update changelog. 2021-10-23 16:32:29 -07:00
John MacFarlane
87a98b76ce Use ipynb 0.1.0.2.
With this change pandoc can be built with aeson >= 2.
2021-10-23 16:27:51 -07:00
Albert Krewinkel
2d3813e0dd Lua: convert IOErrors to PandocErrors in pandoc.pipe function
Fixes: #7523
2021-10-23 11:12:39 -07:00
Albert Krewinkel
c8fb168027
changelog.md: update some Lua-related entries 2021-10-23 16:07:02 +02:00