From 9be2c7624cb0cf3ef63516e5df959672958058bc Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 29 Dec 2017 09:40:22 +0100 Subject: 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. --- data/pandoc.lua | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'data') 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' -- cgit v1.2.3