aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2017-12-29 09:40:22 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2017-12-29 10:04:55 +0100
commit9be2c7624cb0cf3ef63516e5df959672958058bc (patch)
tree4e6bf5cb65a094fcf85ac4c3f284c16726da6786 /data
parent820ee07f729e759d0e1da160c87b527881ee00e8 (diff)
downloadpandoc-9be2c7624cb0cf3ef63516e5df959672958058bc.tar.gz
data/pandoc.lua: drop function pandoc.global_filter
The function `global_filter` was used internally to get the implicitly defined global filter. It was of little value to end-users, but caused unnecessary code duplication in pandoc. The function has hence been dropped. Internally, the global filter is now received by interpreting the global table as lua filter. This is a Lua API change.
Diffstat (limited to 'data')
-rw-r--r--data/pandoc.lua37
1 files changed, 1 insertions, 36 deletions
diff --git a/data/pandoc.lua b/data/pandoc.lua
index 551a59d27..e56df3b6d 100644
--- a/data/pandoc.lua
+++ b/data/pandoc.lua
@@ -23,7 +23,7 @@ THIS SOFTWARE.
-- @copyright © 2017 Albert Krewinkel
-- @license MIT
local M = {
- _VERSION = "0.3.0"
+ _VERSION = "0.4.0"
}
local List = require 'pandoc.List'
@@ -868,41 +868,6 @@ M.LowerAlpha = "LowerAlpha"
-- @see OrderedList
M.UpperAlpha = "UpperAlpha"
-
-------------------------------------------------------------------------
--- Helper Functions
--- @section helpers
-
---- Use functions defined in the global namespace to create a pandoc filter.
--- All globally defined functions which have names of pandoc elements are
--- collected into a new table.
--- @return A list of filter functions
--- @usage
--- -- within a file defining a pandoc filter:
--- text = require 'text'
--- function Str(elem)
--- return pandoc.Str(text.upper(elem.text))
--- end
---
--- return {pandoc.global_filter()}
--- -- the above is equivalent to
--- -- return {{Str = Str}}
-function M.global_filter()
- local res = {}
- function is_filter_function(k)
- return M.Inline.constructor[k] or
- M.Block.constructor[k] or
- k == "Meta" or k == "Doc" or k == "Pandoc" or
- k == "Block" or k == "Inline"
- end
- for k, v in pairs(_G) do
- if is_filter_function(k) then
- res[k] = v
- end
- end
- return res
-end
-
------------------------------------------------------------------------
-- Functions which have moved to different modules
local utils = require 'pandoc.utils'