165 Commits
Author SHA1 Message Date
John MacFarlane ed3690afcd Use ipynb 0.2. 2022-01-12 00:09:16 -08:00
John MacFarlane a416a2f243 Use citeproc 0.6.0.1. 2022-01-11 23:52:57 -08:00
John MacFarlane a30b29624e Use latest texmath (0.12.4). 2022-01-11 19:19:27 -08:00
John MacFarlane 33da5833de Update commits for dev dependencies, allow text 2.0. 2022-01-09 15:30:22 -08:00
John MacFarlane 1dab8e57d3 Use dev version of citeproc. 2022-01-09 12:09:01 -08:00
John MacFarlane 2811468016 Use latest commonmark-hs.
This allows a bare-word class attribute on fenced divs,
as pandoc's Markdown reader now does.
2021-12-30 21:26:30 -08:00
Albert Krewinkel fae63b09bb Lua: use released pandoc-lua-marshal-0.1.3.
Inlines, Blocks, and List objects now have an `__eq` metamethod, testing
equality by comparing two lists element-wise.
2021-12-23 16:04:35 +01:00
Albert Krewinkel 17a32a99a5 Lua: simplify and deprecate function pandoc.utils.equals
The function is no longer required for element comparisons; it is now an
alias for the `==` operator.
2021-12-21 19:01:11 +01:00
John MacFarlane 8734057dff Put sourcepos attribute on header, not enclosing div...
with `-f commonmark+sourcepos`.

Closes #7769.
2021-12-21 09:55:17 -08:00
Albert Krewinkel a0af1b5926 Lua: change representation of TableHead, TableFoot, and Row values.
The objects now also follow the principle that element attributes are
accessible through the `.attr` field. Rows in `TableHead` and
`TableFoot` are available via the `.rows` field. Row objects have a
`.cells` field, containing the list of table cells.

Closes: #7718
2021-12-19 09:44:56 +01:00
John MacFarlane 6303952623 Use dev texmath. 2021-12-14 22:22:09 -08:00
Albert Krewinkel b79bf192ec Lua: support topdown traversals
The traversal order of filters can now be selected by setting the key
`traverse` of the filter to either `'topdown'` or `'typewise'`; the
default remains `'typewise'`.

Topdown traversals can be cut short by returning `false` as a second
value from the filter function. No child-element of the returned element
is processed in that case.
2021-12-13 08:52:19 -08:00
Albert Krewinkel 3e7b46af64 Switch to released pandoc-lua-marshal-0.1.2
Cell values are now marshaled as userdata objects; a constructor
function for table cells is provided as `pandoc.Cell`.
2021-12-10 17:24:50 +01:00
Albert Krewinkel fa643ba6d7 Lua: update to latest pandoc-lua-marshal (0.1.1)
- `walk` methods are added to `Block` and `Inline` values; the methods
  are similar to `pandoc.utils.walk_block` and
  `pandoc.utils.walk_inline`, but apply to filter also to the element
  itself, and therefore return a list of element instead of a single
  element.

- Functions of name `Doc` are no longer accepted as alternatives for
  `Pandoc` filter functions. This functionality was undocumented.
2021-12-09 09:22:29 -08:00
John MacFarlane 8215ca081d Use latest dev version of ipynb.
This should give us deterministic JSON output for mime bundles.
2021-12-08 08:55:26 -08:00
John MacFarlane 51142c6803 Ipynb reader & writer: properly handle cell "id".
This is passed through if it exists (in Nb4); otherwise
the writer will add a random one so that cells all have
an "id".

Closes #7728.
2021-12-06 23:40:51 -08:00
Albert Krewinkel 4874f2dbd2 Use published pandoc-lua-marshal package 2021-11-28 10:23:31 +01:00
Albert Krewinkel 3692a1d1e8 Lua: use package pandoc-lua-marshal (#7719)
The marshaling functions for pandoc's AST are extracted into a separate
package. The package comes with a number of changes:

  - Pandoc's List module was rewritten in C, thereby improving error
    messages.

  - Lists of `Block` and `Inline` elements are marshaled using the new
    list types `Blocks` and `Inlines`, respectively. These types
    currently behave identical to the generic List type, but give better
    error messages. This also opens up the possibility of adding
    element-specific methods to these lists in the future.

  - Elements of type `MetaValue` are no longer pushed as values which
    have `.t` and `.tag` properties. This was already true for
    `MetaString` and `MetaBool` values, which are still marshaled as Lua
    strings and booleans, respectively. Affected values:

      + `MetaBlocks` values are marshaled as a `Blocks` list;

      + `MetaInlines` values are marshaled as a `Inlines` list;

      + `MetaList` values are marshaled as a generic pandoc `List`s.

      + `MetaMap` values are marshaled as plain tables and no longer
        given any metatable.

  - The test suite for marshaled objects and their constructors has
    been extended and improved.

  - A bug in Citation objects, where setting a citation's suffix
    modified it's prefix, has been fixed.
2021-11-27 17:08:01 -08:00
John MacFarlane a19134f74d cabal.project: remove spurious source package stanza for texmath.
Unfortunately this means that the release binaries for 2.16.2
weren't built with all of the texmath improvements.
2021-11-21 17:51:28 -08:00
John MacFarlane 3ac7deadce Use latest dev texmath. 2021-11-16 21:47:27 -08:00
John MacFarlane 03f9a0c61e Require ghc >= 8.6, base >= 4.12.
This allows us to get rid of the old custom prelude and
some crufty cpp.  But the primary reason for this is that
conduit has bumped its base lower bound to 4.12, making it
impossible for us to support lower base versions.
2021-11-09 23:43:12 -08:00
John MacFarlane 6bec746074 cabal.project: Require transformers >= 0.5.6.
For some reason the CI build is trying to use an older version.
2021-11-09 23:09:43 -08: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
John MacFarlane 45054733fa Use citeproc 0.6, commonmark 0.2.2.1, commonmark-extensions 0.2.2 2021-10-22 17:31:40 -07:00
John MacFarlane ce1aca4a32 Use texmath 0.12.3.2 2021-10-22 16:42:21 -07:00
John MacFarlane a9f4bff5e2 Use pandoc-types 1.22.1. 2021-10-22 14:34:58 -07:00
Albert Krewinkel 9e74826ba9 Switch to hslua-2.0
The new HsLua version takes a somewhat different approach to marshalling
and unmarshalling, relying less on typeclasses and more on specialized
types. This allows for better performance and improved error messages.

Furthermore, new abstractions allow to document the code and exposed
functions.
2021-10-22 11:16:51 -07:00
John MacFarlane afc16f2f4b cabal build: go back to using aeson < 2 for now. 2021-10-12 21:00:26 -07:00
John MacFarlane c636b5dd16 Revert "Depend on pandoc-types 1.23, remove Null constructor on Block."
This reverts commit fb0d6c7cb6.
2021-10-12 21:00:15 -07:00
John MacFarlane 6593f9638e cabal.project: Dependencies to build with aeson 2. 2021-10-12 19:39:47 -07:00
John MacFarlane 051c366029 Depend on latest dev version of commonmark. 2021-10-12 17:44:59 -07:00
John MacFarlane 6742e77d1e Update cabal.project 2021-10-02 11:02:28 -07:00
John MacFarlane b34dc28926 Use latest dev version of texmath. 2021-09-13 22:36:14 -07:00
John MacFarlane 84b5c55448 Use latest dev citeproc. 2021-09-10 21:29:44 -07:00
John MacFarlane 37e30560ad Use dev version of citeproc. 2021-09-09 23:27:58 -07:00
John MacFarlane 4c6af94f1c Use released citeproc 0.5. 2021-08-17 14:31:00 -07:00
John MacFarlane 15683bb607 Citeproc: avoid odd handling of quotes.
citeproc changes allow us to ignore Quoted elements;
citeproc now uses its own method for represented quoted
things, and only localizes and flipflops quotes it adds itself.

See #87.

The one thing left to do is to convert Quoted elements in
bibliography databases (esp. titles) to `Span ("",["csl-quoted"],[])`
before passing them to citeproc, IF the localized quotes
for the quote type match the standard inverted commas.
2021-08-13 18:13:06 -07:00
John MacFarlane 05640f9a21 Removed quote localization from citeproc processing.
This is now done in citeproc itself.
2021-08-13 17:30:54 -07:00
John MacFarlane 92efc60571 Fix comment syntax in cabal.project 2021-07-18 11:10:45 -07:00
John MacFarlane 168b559c96 Use doctemplates 0.4.1 and citeproc 0.10. 2021-07-18 10:55:27 -07:00
John MacFarlane ff26af59ac Revamp note citation handling.
Use latest citeproc, which uses a Span with a class rather
than a Note for notes.  This helps us distinguish between
user notes and citation notes.

Don't put citations at the beginning of a note in parentheses.
(Closes #7394.)
2021-07-05 13:19:33 -07:00
John MacFarlane b7572db224 Use dev version of citeproc.
This eliminates double hyperlinks in author-in-text citations.
Author-only citations are no longer hyperlinked.
See jgm/citeproc#77.
2021-06-29 09:18:49 -07:00
John MacFarlane 382be73d77 Use dev version of citeproc.
This fixes moving of punctuation inside quotes to conform to
the CSL spec: only comma and period are moved, not question
mark or exclamation point.
2021-06-28 22:56:16 -07:00
John MacFarlane 7dcf727382 Use dev version of doctemplates. 2021-06-22 23:58:24 -07:00
John MacFarlane 697d149733 Use released citeproc 0.4. 2021-05-12 14:35:06 -07:00
John MacFarlane 853f24f5ca Fixed another typo in cabal.project. 2021-04-25 23:11:53 -07:00
John MacFarlane 1f72a50627 Fix typo in cabal.project. 2021-04-25 22:52:07 -07:00
John MacFarlane 16b64bda38 Use dev texmath, citeproc. 2021-04-25 21:56:54 -07:00
John MacFarlane 9d6c3fa41f Use lastest citeproc. 2021-04-18 11:35:09 -07:00
John MacFarlane a478a5c4c8 Update to released unicode-collation, latest citeproc dev version.
Update citeproc test.
2021-04-17 16:15:14 -07:00