git.iko.soy/typeable/pandoc
on master help sign in
data/pandoc.lua: re-export List and utils module
713ed7cAlbert Krewinkel
data/pandoc.lua+4
@@ -24,9 +24,13 @@ THIS SOFTWARE.
24-- @license MIT
24-- @license MIT
25local M = {}
25local M = {}
26
26
27+-- Other modules used here; those are also re-exported.
27local List = require 'pandoc.List'
28local List = require 'pandoc.List'
28local utils = require 'pandoc.utils'
29local utils = require 'pandoc.utils'
29
30
31+M.List = List
32+M.utils = utils
33+
30------------------------------------------------------------------------
34------------------------------------------------------------------------
31-- Accessor objects
35-- Accessor objects
32--
36--
doc/lua-filters.md+21−1
@@ -2192,11 +2192,20 @@ Usage:
2192 -- The inline element in that block is an `Emph`
2192 -- The inline element in that block is an `Emph`
2193 assert(block.content[1].t == "Emph")
2193 assert(block.content[1].t == "Emph")
2194
2194
2195+
2195# Module pandoc.utils
2196# Module pandoc.utils
2196
2197
2197This module exposes internal pandoc functions and utility
2198This module exposes internal pandoc functions and utility
2198functions.
2199functions.
2199
2200
2201+The module is loaded as part of the `pandoc` module and available
2202+as `pandoc.utils`. In versions up-to and including pandoc 2.6,
2203+this module had to be loaded explicitly. Example:
2204+
2205+ local utils = require 'pandoc.utils'
2206+
2207+Use this for backwards compatibility.
2208+
2200### blocks\_to\_inlines {#utils-blocks_to_inlines}
2209### blocks\_to\_inlines {#utils-blocks_to_inlines}
2201
2210
2202`blocks_to_inlines (blocks[, sep])`
2211`blocks_to_inlines (blocks[, sep])`
@@ -2468,9 +2477,20 @@ Usage:
2468 local diagram_url = "https://pandoc.org/diagram.jpg"
2477 local diagram_url = "https://pandoc.org/diagram.jpg"
2469 local contents = pandoc.mediabag.fetch(diagram_url, ".")
2478 local contents = pandoc.mediabag.fetch(diagram_url, ".")
2470
2479
2480+
2471# Module pandoc.List
2481# Module pandoc.List
2472
2482
2473−Pandoc\'s List type and helper methods
2483+Pandoc's List type and helper methods.
2484+
2485+This module is loaded and available as `pandoc.List`. Older
2486+versions up-to and including pandoc 2.6 require the module to be
2487+loaded explicitly. Example:
2488+
2489+ local List = require 'pandoc.List'
2490+
2491+The above remains the recommended method to use this module; it
2492+provides the List type under an idiomatic name and is fully
2493+backwards compatible.
2474
2494
2475## Metamethods
2495## Metamethods
2476
2496