diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-12-25 01:51:30 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-12-25 01:51:30 +0100 |
commit | cefe8d703dd66048fa9d259b697609bd539a7bce (patch) | |
tree | 4f8f77e3d0cc04d1566a22d83ca875063475150b /tex/context/base/mkiv | |
parent | 1cc6c316feae649d3c8b64ef0c980dfd792c2347 (diff) | |
download | context-cefe8d703dd66048fa9d259b697609bd539a7bce.tar.gz |
2021-12-25 00:57:00
Diffstat (limited to 'tex/context/base/mkiv')
-rw-r--r-- | tex/context/base/mkiv/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/mkiv/status-files.pdf | bin | 24314 -> 24743 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/status-lua.pdf | bin | 236799 -> 257235 bytes | |||
-rw-r--r-- | tex/context/base/mkiv/strc-lst.lua | 51 |
5 files changed, 43 insertions, 12 deletions
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 98dbc868f..383351dd3 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2021.12.24 19:07} +\newcontextversion{2021.12.25 00:55} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index bc37c8aab..3d9e02e03 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -49,7 +49,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2021.12.24 19:07} +\edef\contextversion{2021.12.25 00:55} %D Kind of special: diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex 64c9917b6..94dd23ff5 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 38d788622..a9934cf42 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/strc-lst.lua b/tex/context/base/mkiv/strc-lst.lua index a6799d80f..96ad7c8ed 100644 --- a/tex/context/base/mkiv/strc-lst.lua +++ b/tex/context/base/mkiv/strc-lst.lua @@ -445,7 +445,8 @@ local function filtercollected(specification) elseif not wantedcriterium then block = documents.data.block else - block, criterium = wantedblock, wantedcriterium + block = wantedblock + criterium = wantedcriterium end if block == "" then block = false @@ -468,6 +469,10 @@ local function filtercollected(specification) specification.block = block specification.all = all -- + if specification.atmost then + criterium = v_text + end + -- if trace_lists then report_lists("filtering names %,t, criterium %a, block %a",sortedkeys(names), criterium, block or "*") end @@ -476,6 +481,31 @@ local function filtercollected(specification) report_lists("criterium %a, block %a, found %a",specification.criterium, specification.block or "*", #result) end -- + local levels = tonumber(specification.levels) + if levels then + local minlevel = 1000 + local found = result + local nofresult = #result + for i=1,nofresult do + local v = found[i] + local l = v.metadata.level or 1 + if l < minlevel then + minlevel = l + end + end + local maxlevel = minlevel + levels - 1 + result = { } + nofresult = 0 + for i=1,#found do + local v = found[i] + local l = v.metadata.level or 1 + if l >= minlevel and l <= maxlevel then + nofresult = nofresult + 1 + result[nofresult] = v + end + end + end + -- if sortorder then -- experiment local sorter = listsorters[sortorder] if sorter then @@ -495,7 +525,7 @@ end filters[v_intro] = function(specification) local collected = specification.collected local result = { } - local nofresult = #result + local nofresult = 0 local all = specification.all local names = specification.names for i=1,#collected do @@ -515,7 +545,7 @@ end filters[v_reference] = function(specification) local collected = specification.collected local result = { } - local nofresult = #result + local nofresult = 0 local names = specification.names local sections = sections.collected local reference = specification.reference @@ -554,7 +584,7 @@ end filters[v_all] = function(specification) local collected = specification.collected local result = { } - local nofresult = #result + local nofresult = 0 local block = specification.block local all = specification.all local forced = specification.forced @@ -566,7 +596,7 @@ filters[v_all] = function(specification) if r and (not block or not r.block or block == r.block) then local metadata = v.metadata if metadata then - local name = metadata.name or false + local name = metadata.name or false local sectionnumber = (r.section == 0) or sections[r.section] if forced[name] or (sectionnumber and not metadata.nolist and (all or names[name])) then -- and not sectionnumber.hidenumber then nofresult = nofresult + 1 @@ -588,7 +618,7 @@ filters[v_current] = function(specification) end local collected = specification.collected local result = { } - local nofresult = #result + local nofresult = 0 local depth = specification.depth local block = specification.block local all = specification.all @@ -634,7 +664,7 @@ filters[v_here] = function(specification) end local collected = specification.collected local result = { } - local nofresult = #result + local nofresult = 0 local depth = specification.depth local block = specification.block local all = specification.all @@ -679,7 +709,7 @@ filters[v_previous] = function(specification) end local collected = specification.collected local result = { } - local nofresult = #result + local nofresult = 0 local block = specification.block local all = specification.all local names = specification.names @@ -740,7 +770,7 @@ filters[v_component] = function(specification) -- special case, no structure yet local collected = specification.collected local result = { } - local nofresult = #result + local nofresult = 0 local all = specification.all local names = specification.names local component = resolvers.jobs.currentcomponent() or "" @@ -766,7 +796,7 @@ end filters[v_default] = function(specification) -- is named local collected = specification.collected local result = { } - local nofresult = #result + local nofresult = 0 ----- depth = specification.depth local block = specification.block local criterium = specification.criterium @@ -1111,6 +1141,7 @@ implement { { "reference" }, { "extras" }, { "order" }, + { "levels" }, } } } |