Commit Graph
15964 Commits
Author SHA1 Message Date
John MacFarlane 1612cc3bf4 Simplify some citation code in LaTeX writer. 2022-10-10 21:17:56 -07:00
Albert Krewinkel a088cbf563 Lua: support extensions in custom writers
Custom writers can define the extensions that they support via the
global `writer_extensions`. The variable's value must be a table with
all supported extensions as keys, and their default status as values.

E.g., the below specifies that the writer support the extensions `smart`
and `sourcepos`, but only the `smart` extension is enabled by default:

    writer_extensions = {
      smart = true,
      sourcepos = false,
    }
2022-10-10 09:39:18 -07:00
John MacFarlane e1e07cce65 MANUAL.txt: add note about MathJax fonts to --embed-resources. 2022-10-10 09:34:40 -07:00
Albert Krewinkel 44827c1161 doc/libraries.md: add hslua-cli and the hslua-module-* packages 2022-10-10 16:59:20 +02:00
Amir Dekel 31aa660e65 Org reader: make #+pandoc-emphasis-pre work as expected. (#8360)
So far, `orgStateLastPreCharPos` wasn't updated appropriately after each
parsing to native Str (by the parser `str`). In addition to solving
this, the guard `notAfterString` in `emphasisStart` is removed to allow
emphasis after Str at the first place.
2022-10-10 12:20:58 +02:00
Albert Krewinkel 8f4308f2e5 doc/lua-filters.md: deprecate PANDOC_WRITER_OPTIONS in custom writers 2022-10-10 12:09:09 +02:00
Albert Krewinkel a5ffaaa413 Lua: support custom bytestring readers. 2022-10-10 11:27:42 +02:00
Albert Krewinkel d6fb8fb20f Remove redundant import from T.P.Scripting 2022-10-10 09:25:01 +02:00
Albert Krewinkel 3e1d3b5e5e Lua: use Reader type for custom readers. 2022-10-10 09:13:09 +02:00
John MacFarlane 5d858e4119 HTML writer; Properly merge classes for headings of level > 6.
Previously we got two separate `class` attributes in the `p`
tag. Closes #8363.
2022-10-09 16:04:36 -07:00
Albert Krewinkel 6300c3e10d CI: build and test all components 2022-10-09 11:53:35 +02:00
Albert Krewinkel 654059efed doc/lua-filters.md: fix typos 2022-10-09 11:48:03 +02:00
Ian Max Andolina 2d27a06312 Update Lua filter doc: modify Zerobrane instructions to use Lua 5.4 (#8353) 2022-10-08 18:27:50 -07:00
Albert Krewinkel 5589b1f8f9 [API Change] Change argument type of getReader, getWriter.
The functions now take a `FlavoredFormat` instead of a text argument.
2022-10-08 16:05:48 -07:00
Albert Krewinkel a4218b9719 [API Change] Add new module "Text.Pandoc.Format"
The module provides functions and types for format spec parsing and
processing.

The function `parseFormatSpec` was moved from Text.Pandoc.Extensions to
the new module and renamed to `parseFlavoredFormat`. It now operates in
a PandocMonad and is based on the updated types.
2022-10-08 16:05:48 -07:00
Albert Krewinkel e663bb0e14 [API Change] T.P.Error: Add new constructor "PandocFormatError"
The new error is used to report problems with input or output format
specifications.

The use of PandocAppError is now limited to code in T.P.App and
T.P.Citeproc.
2022-10-08 16:05:48 -07:00
Albert Krewinkel 429606d5da Extensions: add new function readExtension
The function tries to read an extension from a string.
2022-10-08 16:05:48 -07:00
John MacFarlane 3cbf044f99 Update texmath version in stack.yaml. 2022-10-08 16:04:07 -07:00
John MacFarlane 199e4c5f15 Use texmath 0.12.5.4. 2022-10-08 13:55:40 -07:00
Albert Krewinkel 7b7a7d6742 LaTeX writer: add separator line between table's body and its foot.
The writer uses features from the longtable package to define the table
foot. Furthermore, the table's bottom rule is now part of the foot,
where it previously was given as part of the body.
2022-10-06 22:07:25 +02:00
Jeremie Knuesel 644c984169 latex template: set fonts after Beamer theme
Beamer themes such as metropolis and saintpetersburg change the default
fonts. This change gives precedence to the user font settings by moving
them after the loading of the Beamer theme.
2022-10-06 10:14:38 -07:00
Albert Krewinkel afbf732a83 Lua: cleanup module dependencies
Ensures a cleaner module dependency graph.
2022-10-06 13:45:55 +02:00
John MacFarlane 3206506696 Require citeproc >= 0.8.0.2. 2022-10-05 20:00:03 -07:00
Albert Krewinkel 96bdd34a90 Lua: fix tests on Windows broken in previous commit. 2022-10-05 22:07:38 +02:00
Albert Krewinkel 48ab7a17cf Lua: produce more informative error messages for pandoc errors
Errors are reported in Lua in the same words in which they would be
reported in the terminal.
2022-10-05 21:53:03 +02:00
John MacFarlane b05c380f6f HTML writer: replace deprecated aria roles for bibliography entries.
`doc-biblioentry` -> `listitem`
`doc-bibliography` -> `list`

Closes #8354.
2022-10-05 11:58:50 -07:00
John MacFarlane 2d888d19ac Tweaked RELEASE-CHECKLIST. 2022-10-05 11:58:50 -07:00
Albert Krewinkel 9e3a2e0dde Extensions: fix JSON decoding of Extensions
Closes: #8352
2022-10-05 12:40:59 +02:00
John MacFarlane 3151800f34 Add authors target to Makefile. 2022-10-04 21:48:17 -07:00
John MacFarlane 2c37fc5550 Improve 'make prerelease' (formerly check). 2022-10-04 21:48:17 -07:00
John MacFarlane 96cbd762a1 Makefile: Improve checkdocs. 2022-10-04 21:48:17 -07:00
John MacFarlane 87bff28298 Removed some final blank lines. 2022-10-04 21:48:17 -07:00
John MacFarlane 1f982ddf47 Extend check-cabal to check all packages 2022-10-04 21:48:17 -07:00
John MacFarlane 875747f351 Fix rc build for Windows. 2022-10-04 14:19:12 -07:00
John MacFarlane ee62618a80 Add pandoc-lua.1 man page. 2022-10-04 13:16:19 -07:00
John MacFarlane 11d010c455 More build-arm.sh fixes. 2022-10-04 13:16:19 -07:00
John MacFarlane 05505df2f0 Fix typo in build-arm.sh. 2022-10-04 13:16:19 -07:00
Albert Krewinkel 86e009b495 Lua: add new module pandoc.format.
The module provides functions to query the set of extensions supported
by formats, and the set of extension enabled per default.
2022-10-04 13:06:23 -07:00
John MacFarlane a50765b3e4 moduledeps.lua: avoid duplicates when multiple ROOTs. 2022-10-04 12:30:03 -07:00
John MacFarlane 11ec70cfeb Better 'make moduledeps' target.
ROOT can now be multiple modules, and the complete transitive
dependencies of all of them will be printed.

    make moduledeps ROOT="Text.Pandoc.Class Text.Pandoc.Parsing"
2022-10-04 10:17:33 -07:00
John MacFarlane e33d61dff9 Makefile: add modules.csv target. 2022-10-04 10:17:33 -07:00
Albert Krewinkel 6ad05b7451 Lua: ensure that extensions marshaling is consistent. 2022-10-04 16:55:51 +02:00
John MacFarlane 42566afa3f Rename T.P.Readers.LaTeX.Types -> T.P.TeX. 2022-10-03 22:49:22 -07:00
John MacFarlane d5c7996e21 Rename T.P.Network.HTTP -> T.P.URI.
This is still an unexported internal module.
Export `urlEncode`, `escapeURI`, `isURI`, `schemes`, `uriPathToPath`.

Re-export `escapeURI` and `isURI` from T.P.Shared (as they
were exported before); drop exports of `schemes` and `uriPathToPath`
[API change].

With this change, T.P.Class no longer depends on T.P.Shared.
2022-10-03 22:32:19 -07:00
John MacFarlane ad0532244a Separate out T.P.Data, T.P.Translations from T.P.Class. (#8348)
This makes T.P.Class more self-contained, and suitable for extraction
into a separate package if desired.

[API changes]

- T.P.Data is now an exported module, providing `readDataFile`,
  `readDefaultDataFile` (both formerly provided by T.P.Class),
  and also `getDataFileNames` (formerly unexported in
  T.P.App.CommandLineOptions).

- T.P.Translations is now an exported module (along with
  T.P.Translations.Types), providing `readTranslations`,
  `getTranslations`, `setTranslations`, `translateTerm`,
  `lookupTerm`, `readTranslations`, `Term(..)`, and `Translations`.

- T.P.Class: `readDataFile`, `readDefaultDataFile`, `setTranslations`,
  and `translateTerm` are no longer exported.
  `checkUserDataDir` is now exported.

- Text.Pandoc now exports Text.Pandoc.Data and `setTranslations`
  and `translateTerm`.
2022-10-03 13:05:38 -07:00
Albert Krewinkel 2d565eda9e doc/lua-filters.md: fix documentation of PANDOC_WRITER_OPTIONS. 2022-10-03 20:01:55 +02:00
Albert Krewinkel 59e9df4262 doc/lua-filters.md: document pandoc.write_classic. 2022-10-03 19:57:02 +02:00
Albert Krewinkel 8986c03f20 Add test for custom bytestring writers 2022-10-03 19:46:57 +02:00
John MacFarlane f315248865 Remove unused lua53 flag. 2022-10-03 08:50:20 -07:00
Albert Krewinkel 3324664aab [API Change] Support bytestring custom writers.
New-style custom Lua writers can now define an alternative entry function
`BinaryWriter`. If a function with that name is defined, then pandoc
will treat the returned string as binary output. This allows to generate
formats like docx and odt with custom writers.
2022-10-03 08:47:32 -07:00