Commit Graph
17 Commits
Author SHA1 Message Date
John MacFarlane 5f398e9698 Fix a couple small documentation errors.
Closes #11408.
2026-01-21 09:54:35 +01:00
Albert Krewinkel 20d957a325 docs/custom-readers.md: Update JSON parsing example
The example now uses the built-in `pandoc.json` library to parse the API
output.
2023-02-12 11:21:14 +01:00
Ilona Silverwood 671cfcd869 doc/custom-reader.md: rewrite BytestringReader paragraph 2023-01-18 17:24:00 +01:00
Albert Krewinkel a36f12119f Lua: allow table structure as format spec.
This allows to pass structured values as format specifiers to
`pandoc.write` and `pandoc.read`.
2022-12-16 10:43:01 -08:00
John MacFarlane 6e1cfa2af5 Lua: rename reader_extensions/writer_extensions globals...
...as `Extensions`.

Update documnetation.

Include a custom extension in the documentation example.

See #8390.
2022-10-25 10:17:23 -07:00
Albert Krewinkel 253d2e768a Lua: support extensions in custom readers.
Like custom readers, like writers, can define the set of supported
extensions by setting a global. E.g.:

``` lua
reader_extensions = {
  smart = true,
  citations = false,
}
```
2022-10-12 11:58:18 +02:00
Albert Krewinkel a5ffaaa413 Lua: support custom bytestring readers. 2022-10-10 11:27:42 +02:00
John MacFarlane 2b3433404e Remove sample RIS custom reader (since we now have a native one). 2022-02-06 19:13:34 -08:00
John MacFarlane 1e48297304 Fix pattern syntax in sample readability custom reader. 2022-01-16 11:02:03 -08:00
John MacFarlane 039c7e925a Minor edits to new custom reader example. 2022-01-16 10:44:26 -08:00
John MacFarlane 1be49f11f7 doc/custom-readers.lua: add example for "readable HTML." 2022-01-16 10:41:04 -08:00
Albert Krewinkel e88224621d Custom reader: ensure old Readers continue to work
Retry conversion by passing a string instead of sources when the
`Reader` fails with a message that hints at an outdated function. A
deprecation notice is reported in that case.
2021-12-11 08:59:11 -08:00
Albert Krewinkel 83b5b79c0e Custom reader: pass list of sources instead of concatenated text
The first argument passed to Lua `Reader` functions is no longer a plain
string but a richer data structure. The structure can easily be
converted to a string by applying `tostring`, but is also a list with
elements that contain each the *text* and *name* of each input source as
a property of the respective name.

A small example is added to the custom reader documentation, showcasing
its use in a reader that creates a syntax-highlighted code block for
each source code file passed as input.

Existing readers must be updated.
2021-12-11 08:59:11 -08:00
Mauro Bieg 136739b7ed fix typo in custom-readers.md (#7722) 2021-11-29 08:59:37 -08:00
John MacFarlane b72ba3ed6d Simplify sample ris reader in doc/custom-readers.md.
Made possible by #7712.
2021-11-23 09:57:09 -08:00
John MacFarlane a039f024f2 Add an example to custom-readers.md. 2021-11-22 14:58:18 -08:00
Albert Krewinkel 464abdc854 Rename doc/custom-reader.lua to doc/custom-readers.md 2021-11-21 10:16:20 +01:00