diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/strc-blk.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/strc-blk.lua | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/context/base/strc-blk.lua b/Master/texmf-dist/tex/context/base/strc-blk.lua index ce3304d59af..0ababcfc09c 100644 --- a/Master/texmf-dist/tex/context/base/strc-blk.lua +++ b/Master/texmf-dist/tex/context/base/strc-blk.lua @@ -16,6 +16,8 @@ local allocate = utilities.storage.allocate local context = context local commands = commands +local implement = interfaces.implement + local structures = structures structures.blocks = structures.blocks or { } @@ -78,13 +80,19 @@ end function blocks.select(state,name,tag,criterium) criterium = criterium or "text" - if find(tag,"=",1,true) then tag = "" end - local names = settings_to_set(name) - local all = tag == "" - local tags = not all and settings_to_set(tag) - local hide = state == "process" - local n = sections.numberatdepth(criterium) - local result = lists.filtercollected("all", criterium, n, collected, { }) + if find(tag,"=",1,true) then + tag = "" + end + local names = settings_to_set(name) + local all = tag == "" + local tags = not all and settings_to_set(tag) + local hide = state == "process" + local result = lists.filter { + names = "all", + criterium = criterium, + number = sections.numberatdepth(criterium), -- not needed + collected = collected, + } for i=1,#result do local ri = result[i] local metadata = ri.metadata @@ -148,8 +156,7 @@ end -- interface - -commands.definestructureblock = blocks.define -commands.savestructureblock = blocks.save -commands.selectstructureblock = blocks.select -commands.setstructureblockstate = blocks.setstate +implement { name = "definestructureblock", actions = blocks.define, arguments = "string" } +implement { name = "savestructureblock", actions = blocks.save, arguments = { "string", "string" ,"string" } } +implement { name = "selectstructureblock", actions = blocks.select, arguments = { "string", "string" ,"string", "string" } } +implement { name = "setstructureblockstate", actions = blocks.setstate, arguments = { "string", "string" ,"string" } } |