texlive[65298] Master/texmf-dist: nodetree (17dec22)
commits+karl at tug.org
commits+karl at tug.org
Sat Dec 17 21:54:43 CET 2022
Revision: 65298
http://tug.org/svn/texlive?view=revision&revision=65298
Author: karl
Date: 2022-12-17 21:54:42 +0100 (Sat, 17 Dec 2022)
Log Message:
-----------
nodetree (17dec22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/luatex/nodetree/README.md
trunk/Master/texmf-dist/doc/luatex/nodetree/nodetree.pdf
trunk/Master/texmf-dist/source/luatex/nodetree/nodetree.dtx
trunk/Master/texmf-dist/source/luatex/nodetree/nodetree.ins
trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree-embed.sty
trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree.lua
trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree.sty
trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree.tex
Modified: trunk/Master/texmf-dist/doc/luatex/nodetree/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/nodetree/README.md 2022-12-17 00:51:17 UTC (rev 65297)
+++ trunk/Master/texmf-dist/doc/luatex/nodetree/README.md 2022-12-17 20:54:42 UTC (rev 65298)
@@ -1,4 +1,4 @@
-![nodetree](https://raw.githubusercontent.com/Josef-Friedrich/nodetree/master/graphics/packagename.png)
+![nodetree](https://raw.githubusercontent.com/Josef-Friedrich/nodetree/main/graphics/packagename.png)
# Abstract
@@ -18,7 +18,7 @@
# License
-Copyright (C) 2016-2020 by Josef Friedrich <josef at friedrich.rocks>
+Copyright (C) 2016-2022 by Josef Friedrich <josef at friedrich.rocks>
------------------------------------------------------------------------
This work may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.3 of this license
@@ -32,10 +32,10 @@
# CTAN
-Since July 2016 the cloze package is included in the Comprehensive TeX
+Since July 2016 the nodetree package is included in the Comprehensive TeX
Archive Network (CTAN).
-* TeX archive: http://mirror.ctan.org/tex-archive/macros/luatex/generic/nodetree
+* TeX archive: http://mirror.ctan.org/macros/luatex/generic/nodetree
* Package page: http://www.ctan.org/pkg/nodetree
# Repository
@@ -85,7 +85,7 @@
\end{document}
```
-![nodetree](https://raw.githubusercontent.com/Josef-Friedrich/nodetree/master/graphics/math.png)
+![nodetree](https://raw.githubusercontent.com/Josef-Friedrich/nodetree/main/graphics/math.png)
## The node list of the word 'Office'
@@ -99,7 +99,7 @@
\end{document}
```
-![nodetree](https://raw.githubusercontent.com/Josef-Friedrich/nodetree/master/graphics/ligatures.png)
+![nodetree](https://raw.githubusercontent.com/Josef-Friedrich/nodetree/main/graphics/ligatures.png)
# Development
@@ -150,8 +150,8 @@
### Update the copyright year:
```
-sed -i 's/(C) 2016-2020/(C) 2016-2021/g' nodetree.ins
-sed -i 's/(C) 2016-2020/(C) 2016-2021/g' nodetree.dtx
+sed -i 's/(C) 2016-2022/(C) 2016-2021/g' nodetree.ins
+sed -i 's/(C) 2016-2022/(C) 2016-2021/g' nodetree.dtx
```
### Command line tasks:
Modified: trunk/Master/texmf-dist/doc/luatex/nodetree/nodetree.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/luatex/nodetree/nodetree.dtx
===================================================================
--- trunk/Master/texmf-dist/source/luatex/nodetree/nodetree.dtx 2022-12-17 00:51:17 UTC (rev 65297)
+++ trunk/Master/texmf-dist/source/luatex/nodetree/nodetree.dtx 2022-12-17 20:54:42 UTC (rev 65298)
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2016-2020 by Josef Friedrich <josef at friedrich.rocks>
+% Copyright (C) 2016-2022 by Josef Friedrich <josef at friedrich.rocks>
% ----------------------------------------------------------------------
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3 of this license
@@ -28,7 +28,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{nodetree}
%<*package>
- [2020/10/23 v2.2 Visualize node lists in a tree view]
+ [2022/12/17 v2.2.1 Visualize node lists in a tree view]
%</package>
% \fi
%
@@ -70,8 +70,14 @@
% * Print node properties of copied nodes.
% }
% \changes{v2.2}{2020/10/23}{
-% * Fix unavailable library error (utf8 not in Lua5.1)
+% * Fix unavailable library error (utf8 not in Lua5.1)
% }
+% \changes{v2.2.1}{2022/12/17}{
+% * Replace non-printable unicode symbols with ???.
+% * Add missing newlines for callbacks with multiple node lists.
+% * Print subtype fields with value 0.
+% * Fix the presentation of the subtype field of a glyph as a bit field.
+% }
% \DoNotIndex{\newcommand,\newenvironment,\def,\directlua}
%
% \StopEventually{}
@@ -234,7 +240,7 @@
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{nodetree-embed}
- [2020/10/23 v2.2 Embed node trees into a LaTeX document]
+ [2022/12/17 v2.2.1 Embed node trees into a LaTeX document]
% \end{macrocode}
%
% \begin{macrocode}
Modified: trunk/Master/texmf-dist/source/luatex/nodetree/nodetree.ins
===================================================================
--- trunk/Master/texmf-dist/source/luatex/nodetree/nodetree.ins 2022-12-17 00:51:17 UTC (rev 65297)
+++ trunk/Master/texmf-dist/source/luatex/nodetree/nodetree.ins 2022-12-17 20:54:42 UTC (rev 65298)
@@ -1,4 +1,4 @@
-% Copyright (C) 2016-2020 by Josef Friedrich <josef at friedrich.rocks>
+% Copyright (C) 2016-2022 by Josef Friedrich <josef at friedrich.rocks>
% ----------------------------------------------------------------------
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3c of this license
@@ -21,7 +21,7 @@
This is a generated file.
-Copyright (C) 2016-2020 by Josef Friedrich <josef at friedrich.rocks>
+Copyright (C) 2016-2022 by Josef Friedrich <josef at friedrich.rocks>
----------------------------------------------------------------------
This work may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.3c of this license
Modified: trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree-embed.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree-embed.sty 2022-12-17 00:51:17 UTC (rev 65297)
+++ trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree-embed.sty 2022-12-17 20:54:42 UTC (rev 65298)
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2016-2020 by Josef Friedrich <josef at friedrich.rocks>
+%% Copyright (C) 2016-2022 by Josef Friedrich <josef at friedrich.rocks>
%% ----------------------------------------------------------------------
%% This work may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3c of this license
@@ -22,7 +22,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{nodetree-embed}
- [2020/10/23 v2.2 Embed node trees into a LaTeX document]
+ [2022/12/17 v2.2.1 Embed node trees into a LaTeX document]
\RequirePackage{xcolor,mdframed,expl3,xparse,fontspec}
\input{nodetree}
\RequirePackage{kvoptions}
Modified: trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree.lua 2022-12-17 00:51:17 UTC (rev 65297)
+++ trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree.lua 2022-12-17 20:54:42 UTC (rev 65298)
@@ -15,8 +15,21 @@
-- luacheck: globals node tex luatexbase lfs callback os unicode status modules
+--- at class Node
+--- at field next Node|nil # the next node in a list, or nil
+--- at field id number # the node’s type (id) number
+--- at field subtype number # the node subtype identifier
+
+--- at alias ColorName `black` | `red` | `green` | `yellow` | `blue` | `magenta` | `cyan` | `white`
+--- at alias ColorMode `bright` | `dim`
+
+--- at alias ConnectionType `list` | `field` # A literal
+-- is a string, which can be either `list` or `field`.
+--- at alias ConnectionState `stop` | `continue` # A literal which can
+-- be either `continue` or `stop`.
+
if not modules then modules = { } end modules ['nodetree'] = {
- version = '2.2',
+ version = '2.2.1',
comment = 'nodetree',
author = 'Josef Friedrich',
copyright = 'Josef Friedrich',
@@ -78,34 +91,41 @@
-- @section format
local format = {
+ --- at param input string
---
- -- @treturn string
- underscore = function(string)
+ --- at return string
+ underscore = function(input)
if options.channel == 'tex' then
- return string.gsub(string, '_', '\\_')
+ local result = input.gsub(input, '_', '\\_')
+ return result
else
- return string
+ return input
end
end,
+ --- at param input string
---
- -- @treturn string
- escape = function(string)
+ --- at return string
+ escape = function(input)
if options.channel == 'tex' then
- return string.gsub(string, [[\]], [[\string\]])
+ local result = input.gsub(input, [[\]], [[\string\]])
+ return result
else
- return string
+ return input
end
end,
- -- @treturn number
- number = function(number)
+ --- at param input number
+ ---
+ --- at return number
+ number = function(input)
local mult = 10^(options.decimalplaces or 0)
- return math.floor(number * mult + 0.5) / mult
+ return math.floor(input * mult + 0.5) / mult
end,
+ --- at param count? number # how many spaces should be output
---
- -- @treturn string
+ --- at return string
whitespace = function(count)
local whitespace
local output = ''
@@ -123,14 +143,15 @@
return output
end,
+ --- at param code number
---
- -- @treturn string
+ --- at return string
color_code = function(code)
return string.char(27) .. '[' .. tostring(code) .. 'm'
end,
---
- -- @treturn string
+ --- at return string
color_tex = function(color, mode)
if not mode then mode = '' end
return 'NTE' .. color .. mode
@@ -137,7 +158,7 @@
end,
---
- -- @treturn string
+ --- at return string
node_begin = function()
if options.channel == 'tex' then
return '\\mbox{'
@@ -147,7 +168,7 @@
end,
---
- -- @treturn string
+ --- at return string
node_end = function()
if options.channel == 'tex' then
return '}'
@@ -156,8 +177,9 @@
end
end,
+ --- at param count? number # how many new lines should be output
---
- -- @treturn string
+ --- at return string
new_line = function(count)
local output = ''
if not count then
@@ -176,8 +198,9 @@
return output
end,
+ --- at param id number
---
- -- @treturn string
+ --- at return string
type_id = function(id)
return '[' .. tostring(id) .. ']'
end
@@ -186,8 +209,7 @@
--- Print the output to stdout or write it into a file (`output_file`).
-- New text is appended.
--
--- @tparam string text A text string.
---
+--- at param text string # A text string.
local function nodetree_print(text)
if options.channel == 'log' or options.channel == 'tex' then
output_file:write(text)
@@ -295,12 +317,11 @@
-- | oncyan | 46 |
-- | onwhite | 47 |
--
- -- @tparam string color A color name (`black`, `red`, `green`,
- -- `yellow`, `blue`, `magenta`, `cyan`, `white`).
- -- @tparam string mode `bright` or `dim`.
- -- @tparam boolean background Colorize the background not the text.
+ --- at param color ColorName # A color name.
+ --- at param mode? ColorMode
+ --- at param background? boolean # Colorize the background not the text.
--
- -- @treturn string
+ --- at return string
color = function(color, mode, background)
if options.color ~= 'colored' then
return ''
@@ -371,36 +392,36 @@
-- It should also noted that this mapping is not unique, the same glyph
-- can represent different characters in different context.
--
- -- @tparam node head The head node of a node list.
- --
- -- @treturn string A textual representation of the `char` number.
- -- In verbosity level 2 or great suffixed with `[char number]`
+ --- at param head Node # The head node of a node list.
+ ---
+ --- at return string # A textual representation of the `char` number. In verbosity level 2 or great suffixed with `[char number]`
char = function(head)
- -- See Issue #6
+ -- See Issues #6 and #9
local node_id = todirect(head) -- Convert to node id
local props = properties[node_id]
local info = props and props.glyph_info
-
- local output
+ local textual
+ local character_index = getchar(node_id)
if info then
- output = info
- end
- local c = getchar(node_id)
- if c == 0 then
- output = '^^@'
- elseif c < 0x110000 then
- output = utfchar(c)
+ textual = info
+ elseif character_index == 0 then
+ textual = '^^@'
+ elseif character_index <= 31 or (character_index >= 127 and character_index <= 159) then
+ -- The C0 range [c-zero] is the characters from U+0000 to U+001F
+ -- (decimal 0-31) and U+007F (decimal 127), the C1 range is the
+ -- characters from U+0080 to U+009F (decimal 128-159).
+ textual = '???'
+ elseif character_index < 0x110000 then
+ textual = utfchar(character_index)
else
- output = string.format("^^^^^^%06X", c)
+ textual = string.format("^^^^^^%06X", character_index)
end
- if options.verbosity > 1 then
- return output .. ' [' .. head.char .. ']'
- end
- return output
+ return character_index .. ' (' .. string.format('0x%x', character_index) .. ', \''.. textual .. '\')'
end,
+ --- at param length? `long`
---
- -- @treturn string
+ --- at return string
line = function(length)
local output
if length == 'long' then
@@ -411,8 +432,11 @@
return output .. format.new_line()
end,
+ --- at param connection_type ConnectionType
+ --- at param connection_state ConnectionState
+ --- at param last boolean
---
- -- @treturn string
+ --- at return string
branch = function(connection_type, connection_state, last)
local c = connection_type
local s = connection_state
@@ -438,8 +462,11 @@
end,
}
----
--- @treturn string
+--- at param number number
+--- at param order number
+--- at param field string
+--
+--- at return string
function template.fill(number, order, field)
local output
if order ~= nil and order ~= 0 then
@@ -463,13 +490,12 @@
--- Colorize a text string.
--
--- @tparam string text A text string.
--- @tparam string color A color name (`black`, `red`, `green`,
--- `yellow`, `blue`, `magenta`, `cyan`, `white`).
--- @tparam string mode `bright` or `dim`.
--- @tparam boolean background Colorize the background not the text.
+--- at param text string A text string.
+--- at param color ColorName A color name.
+--- at param mode ColorMode
+--- at param background? boolean # Colorize the background not the text.
--
--- @treturn string
+--- at return string
function template.colored_string(text, color, mode, background)
if options.channel == 'tex' then
if mode == 'dim' then
@@ -488,12 +514,14 @@
--- Format a scaled point input value into dimension string (`12pt`,
-- `1cm`)
--
--- @tparam number input
+--- at param input number
--
--- @treturn string
+--- at return string
function template.length (input)
- input = tonumber(input)
- input = input / tex.sp('1' .. options.unit)
+ local i = tonumber(input)
+ if i ~= nil then
+ input = i / tex.sp('1' .. options.unit)
+ end
return string.format(
'%g%s',
format.number(input),
@@ -512,41 +540,40 @@
-- Source: https://stackoverflow.com/a/5639667 Works if __index returns
-- table, which it should as per luatex manual
--
--- @tparam table table A Lua table.
--- @tparam table previous_data table The of data of
--- a Lua table of a previous recursive call.
---
--- @treturn table A merged table.
-local function get_all_table_data(table, previous_data)
+--- at param data table # A Lua table.
+--- at param previous_data? table # The data of a Lua table of a previous recursive call.
+---
+--- at return table # A merged table.
+local function get_all_table_data(data, previous_data)
-- If previous_data is nil, start empty, otherwise start with previous_data.
- local data = previous_data or {}
+ local output = previous_data or {}
-- Copy all the attributes from the table.
- for key, value in pairs(table) do
- data[key] = data[key] or value
+ for key, value in pairs(data) do
+ output[key] = output[key] or value
end
-- Get table’s metatable, or exit if not existing
- local metatable = getmetatable(table)
+ local metatable = getmetatable(data)
if type(metatable) ~= 'table' then
- return data
+ return output
end
-- Get the `__index` from metatable, or exit if not table.
local index = metatable.__index
if type(index) ~= 'table' then
- return data
+ return output
end
-- Include the data from index into data, recursively, and return.
- return get_all_table_data(index, data)
+ return get_all_table_data(index, output)
end
--- Convert a Lua table into a format string.
--
--- @tparam table table A table to generate a inline view of.
+--- at param table table A table to generate a inline view of.
--
--- @treturn string
+--- at return string
function template.table_inline(table)
local tex_escape = ''
if options.channel == 'tex' then
@@ -573,12 +600,11 @@
--- Format a key value pair (`key: value, `).
--
--- @tparam string key A key
--- @tparam string|number value A value
--- @tparam string color A color name (`black`, `red`, `green`,
--- `yellow`, `blue`, `magenta`, `cyan`, `white`).
+--- at param key string # A key.
+--- at param value string|number # A value.
+--- at param color? ColorName # A color name.
--
--- @treturn string
+--- at return string
function template.key_value(key, value, color)
if type(color) ~= 'string' then
color = 'yellow'
@@ -593,8 +619,10 @@
return output
end
+--- at param type string
+--- at param id number
---
--- @treturn string
+--- at return string
function template.type(type, id)
local output
if options.channel == 'tex' then
@@ -613,8 +641,10 @@
)
end
+--- at param callback_name string
+--- at param variables? table
---
--- @treturn string
+--- at return string
function template.callback(callback_name, variables)
nodetree_print(
format.new_line(2) ..
@@ -638,8 +668,10 @@
nodetree_print(template.line('long'))
end
+--- at param level number
+--- at param connection_type ConnectionType
---
--- @treturn string
+--- at return string
function template.branches(level, connection_type)
local output = ''
for i = 1, level - 1 do
@@ -668,11 +700,12 @@
-- node into a string it looks like: `<node nil < 172 > nil :
-- hlist 2>`.
--
--- @tparam node n A node.
+--- at param n Node # A node.
--
--- @treturn string
+--- at return string
function node_extended.node_id(n)
- return string.gsub(tostring(n), '^<node%s+%S+%s+<%s+(%d+).*', '%1')
+ local result = string.gsub(tostring(n), '^<node%s+%S+%s+<%s+(%d+).*', '%1')
+ return result
end
--- A table of all node subtype names.
@@ -716,7 +749,7 @@
-- * `passive` (48)
-- * `shape` (49)
--
--- @treturn table
+--- at return table
local function get_node_subtypes ()
local subtypes = {
-- hlist (0)
@@ -890,8 +923,9 @@
[1] = 'right',
},
-- glyph (29)
+ -- the subtype for this node is a bit field, not an enumeration;
+ -- bit 0 gets handled separately
glyph = {
- [0] = 'character',
[1] = 'ligature',
[2] = 'ghost',
[3] = 'left',
@@ -902,15 +936,36 @@
return subtypes
end
+--- at param n Node
---
--- @treturn string
+--- at return string
function node_extended.subtype(n)
local typ = node.type(n.id)
local subtypes = get_node_subtypes()
+ local output = ''
+ if subtypes[typ] then
+ if typ == 'glyph' then
+ -- only handle the lowest five bits
+ if n.subtype & 1 == 0 then
+ output = output .. 'glyph'
+ else
+ output = output .. 'character'
+ end
+ local mask = 2
+ for i = 1,4,1 do
+ if n.subtype & mask ~= 0 then
+ output = output .. ' ' .. subtypes[typ][i]
+ end
+ mask = mask << 1
+ end
+ else
+ if subtypes[typ][n.subtype] then
+ output = subtypes[typ][n.subtype]
+ else
+ return tostring(n.subtype)
+ end
+ end
- local output
- if subtypes[typ] and subtypes[typ][n.subtype] then
- output = subtypes[typ][n.subtype]
if options.verbosity > 1 then
output = output .. format.type_id(n.subtype)
end
@@ -926,15 +981,21 @@
local tree = {}
---
--- @tparam node head The head node of a node list.
--- @tparam string field
+--- at param head Node # The head node of a node list.
+--- at param field string
--
--- @treturn string
+--- at return string
function tree.format_field(head, field)
local output
--- Character "0" should be printed in a tree, because in TeX fonts the
--- 0 slot usually has a symbol.
- if not head[field] or (head[field] == 0 and field ~= "char") then
+
+ -- subtypes with IDs 0 are were not printed, see #12
+ if head[field] ~= nil and field == "subtype" then
+ return template.key_value(field, format.underscore(node_extended.subtype(head)))
+ end
+
+ -- Character "0" should be printed in a tree, because in TeX fonts the
+ -- 0 slot usually has a symbol.
+ if head[field] == nil or (head[field] == 0 and field ~= "char") then
return ''
end
@@ -962,8 +1023,6 @@
if field == 'prev' or field == 'next' then
output = node_extended.node_id(head[field])
- elseif field == 'subtype' then
- output = format.underscore(node_extended.subtype(head))
elseif
field == 'width' or
field == 'height' or
@@ -989,9 +1048,9 @@
-- list. The attribute `0` with the value `0` is skipped because this
-- attribute is in every node by default.
--
--- @tparam node head The head node of a node list.
+--- at param head Node # The head node of a node list.
--
--- @treturn string
+--- at return string
function tree.format_attributes(head)
if not head then
return ''
@@ -1008,11 +1067,9 @@
end
---
--- @tparam number level `level` is a integer beginning with 1.
--- @tparam number connection_type The variable `connection_type`
--- is a string, which can be either `list` or `field`.
--- @tparam connection_state `connection_state` is a string, which can
--- be either `continue` or `stop`.
+--- at param level number # `level` is a integer beginning with 1.
+--- at param connection_type ConnectionType
+--- at param connection_state ConnectionState
function tree.set_state(level, connection_type, connection_state)
if not tree_state[level] then
tree_state[level] = {}
@@ -1021,8 +1078,8 @@
end
---
--- @tparam table fields
--- @tparam number level
+--- at param fields table
+--- at param level number
function tree.analyze_fields(fields, level)
local max = 0
local connection_state
@@ -1050,8 +1107,8 @@
end
---
--- @tparam node head The head node of a node list.
--- @tparam number level
+--- at param head Node # The head node of a node list.
+--- at param level number
function tree.analyze_node(head, level)
local connection_state
local output
@@ -1120,8 +1177,8 @@
end
---
--- @tparam node head The head node of a node list.
--- @tparam number level
+--- at param head Node # The head node of a node list.
+--- at param level number
function tree.analyze_list(head, level)
while head do
tree.analyze_node(head, level)
@@ -1130,7 +1187,7 @@
end
---
--- @tparam node head The head node of a node list.
+--- at param head Node # The head node of a node list.
function tree.analyze_callback(head)
tree.analyze_list(head, 1)
nodetree_print(template.line('short') .. format.new_line())
@@ -1142,7 +1199,9 @@
local callbacks = {
---
- -- @tparam string extrainfo
+ --- at param extrainfo string
+ ---
+ --- at return boolean
contribute_filter = function(extrainfo)
template.callback('contribute_filter', {extrainfo = extrainfo})
return true
@@ -1149,7 +1208,9 @@
end,
---
- -- @tparam string extrainfo
+ --- at param extrainfo string
+ ---
+ --- at return boolean
buildpage_filter = function(extrainfo)
template.callback('buildpage_filter', {extrainfo = extrainfo})
return true
@@ -1156,17 +1217,20 @@
end,
---
- -- @tparam string n
- -- @tparam string i
+ --- at param n string
+ --- at param i string
+ ---
+ --- at return number
build_page_insert = function(n, i)
- print('lol')
template.callback('build_page_insert', {n = n, i = i})
return 0
end,
---
- -- @tparam node head The head node of a node list.
- -- @tparam string groupcode
+ --- at param head Node # The head node of a node list.
+ --- at param groupcode string
+ ---
+ --- at return boolean
pre_linebreak_filter = function(head, groupcode)
template.callback('pre_linebreak_filter', {groupcode = groupcode})
tree.analyze_callback(head)
@@ -1174,8 +1238,10 @@
end,
---
- -- @tparam node head The head node of a node list.
- -- @tparam boolean is_display
+ --- at param head Node # The head node of a node list.
+ --- at param is_display boolean
+ ---
+ --- at return boolean
linebreak_filter = function(head, is_display)
template.callback('linebreak_filter', {is_display = is_display})
tree.analyze_callback(head)
@@ -1183,10 +1249,10 @@
end,
---
- -- @tparam node box
- -- @tparam string locationcode
- -- @tparam number prevdepth
- -- @tparam boolean mirrored
+ --- at param box Node
+ --- at param locationcode string
+ --- at param prevdepth number
+ --- at param mirrored boolean
append_to_vlist_filter = function(box, locationcode, prevdepth, mirrored)
local variables = {
locationcode = locationcode,
@@ -1199,8 +1265,10 @@
end,
---
- -- @tparam node head The head node of a node list.
- -- @tparam string groupcode
+ --- at param head Node # The head node of a node list.
+ --- at param groupcode string
+ ---
+ --- at return boolean
post_linebreak_filter = function(head, groupcode)
template.callback('post_linebreak_filter', {groupcode = groupcode})
tree.analyze_callback(head)
@@ -1208,12 +1276,14 @@
end,
---
- -- @tparam node head The head node of a node list.
- -- @tparam string groupcode
- -- @tparam number size
- -- @tparam string packtype
- -- @tparam string direction
- -- @tparam node attributelist
+ --- at param head Node # The head node of a node list.
+ --- at param groupcode string
+ --- at param size number
+ --- at param packtype string
+ --- at param direction string
+ --- at param attributelist Node
+ ---
+ --- at return boolean
hpack_filter = function(head, groupcode, size, packtype, direction, attributelist)
local variables = {
groupcode = groupcode,
@@ -1228,13 +1298,15 @@
end,
---
- -- @tparam node head The head node of a node list.
- -- @tparam string groupcode
- -- @tparam number size
- -- @tparam string packtype
- -- @tparam number maxdepth
- -- @tparam string direction
- -- @tparam node attributelist
+ --- at param head Node # The head node of a node list.
+ --- at param groupcode string
+ --- at param size number
+ --- at param packtype string
+ --- at param maxdepth number
+ --- at param direction string
+ --- at param attributelist Node
+ ---
+ --- at return boolean
vpack_filter = function(head, groupcode, size, packtype, maxdepth, direction, attributelist)
local variables = {
groupcode = groupcode,
@@ -1250,11 +1322,11 @@
end,
---
- -- @tparam string incident
- -- @tparam number detail
- -- @tparam node head The head node of a node list.
- -- @tparam number first
- -- @tparam number last
+ --- at param incident string
+ --- at param detail number
+ --- at param head Node # The head node of a node list.
+ --- at param first number
+ --- at param last number
hpack_quality = function(incident, detail, head, first, last)
local variables = {
incident = incident,
@@ -1267,11 +1339,11 @@
end,
---
- -- @tparam string incident
- -- @tparam number detail
- -- @tparam node head The head node of a node list.
- -- @tparam number first
- -- @tparam number last
+ --- at param incident string
+ --- at param detail number
+ --- at param head Node # The head node of a node list.
+ --- at param first number
+ --- at param last number
vpack_quality = function(incident, detail, head, first, last)
local variables = {
incident = incident,
@@ -1284,9 +1356,11 @@
end,
---
- -- @tparam node head The head node of a node list.
- -- @tparam number width
- -- @tparam number height
+ --- at param head Node # The head node of a node list.
+ --- at param width number
+ --- at param height number
+ ---
+ --- at return boolean
process_rule = function(head, width, height)
local variables = {
width = width,
@@ -1298,12 +1372,14 @@
end,
---
- -- @tparam node head The head node of a node list.
- -- @tparam string groupcode
- -- @tparam number size
- -- @tparam string packtype
- -- @tparam number maxdepth
- -- @tparam string direction
+ --- at param head Node # The head node of a node list.
+ --- at param groupcode string
+ --- at param size number
+ --- at param packtype string
+ --- at param maxdepth number
+ --- at param direction string
+ ---
+ --- at return boolean
pre_output_filter = function(head, groupcode, size, packtype, maxdepth, direction)
local variables = {
groupcode = groupcode,
@@ -1318,41 +1394,43 @@
end,
---
- -- @tparam node head The head node of a node list.
- -- @tparam node tail
+ --- at param head Node # The head node of a node list.
+ --- at param tail Node
hyphenate = function(head, tail)
template.callback('hyphenate')
- nodetree_print('head:')
+ nodetree_print('head:' .. format.new_line())
tree.analyze_callback(head)
- nodetree_print('tail:')
+ nodetree_print('tail:' .. format.new_line())
tree.analyze_callback(tail)
end,
---
- -- @tparam node head The head node of a node list.
- -- @tparam node tail
+ --- at param head Node # The head node of a node list.
+ --- at param tail Node
ligaturing = function(head, tail)
template.callback('ligaturing')
- nodetree_print('head:')
+ nodetree_print('head:' .. format.new_line())
tree.analyze_callback(head)
- nodetree_print('tail:')
+ nodetree_print('tail:' .. format.new_line())
tree.analyze_callback(tail)
end,
---
- -- @tparam node head The head node of a node list.
- -- @tparam node tail
+ --- at param head Node # The head node of a node list.
+ --- at param tail Node
kerning = function(head, tail)
template.callback('kerning')
- nodetree_print('head:')
+ nodetree_print('head:' .. format.new_line())
tree.analyze_callback(head)
- nodetree_print('tail:')
+ nodetree_print('tail:' .. format.new_line())
tree.analyze_callback(tail)
end,
---
- -- @tparam node local_par
- -- @tparam string location
+ --- at param local_par Node
+ --- at param location string
+ ---
+ --- at return boolean
insert_local_par = function(local_par, location)
template.callback('insert_local_par', {location = location})
tree.analyze_callback(local_par)
@@ -1360,9 +1438,9 @@
end,
---
- -- @tparam node head The head node of a node list.
- -- @tparam string display_type
- -- @tparam boolean need_penalties
+ --- at param head Node # The head node of a node list.
+ --- at param display_type string
+ --- at param need_penalties boolean
mlist_to_hlist = function(head, display_type, need_penalties)
local variables = {
display_type = display_type,
@@ -1376,8 +1454,8 @@
--- Set a single option key value pair.
--
--- @tparam string key The key of the option pair.
--- @tparam number|string value The value of the option pair.
+--- at param key string # The key of the option pair.
+--- at param value number|string # The value of the option pair.
local function set_option(key, value)
if not options then
options = {}
@@ -1391,7 +1469,7 @@
--- Set multiple key value pairs using a table.
--
--- @tparam table opts Options
+--- at param opts table # Options
local function set_options(opts)
if not options then
options = {}
@@ -1405,9 +1483,9 @@
--
-- Throw an error if it doen’t.
--
--- @tparam string callback_name The name of a callback to check.
+--- at param callback_name string # The name of a callback to check.
--
--- @treturn string The unchanged input of the function.
+--- at return string # The unchanged input of the function.
local function check_callback_name(callback_name)
local info = callback.list()
if info[callback_name] == nil then
@@ -1422,10 +1500,10 @@
--- Get the real callback name from an alias string.
--
--- @tparam string alias The alias of a callback name or the callback
+--- at param alias string The alias of a callback name or the callback
-- name itself.
--
--- @treturn string The real callback name.
+--- at return string # The real callback name.
local function get_callback_name(alias)
local callback_name
-- Listed as in the LuaTeX reference manual.
@@ -1494,7 +1572,7 @@
--- Register a callback.
--
--- @tparam string cb The name of a callback.
+--- at param cb string # The name of a callback.
local function register_callback(cb)
if luatexbase then
luatexbase.add_to_callback(cb, callbacks[cb], 'nodetree')
@@ -1505,7 +1583,7 @@
--- Unregister a callback.
--
--- @tparam string cb The name of a callback.
+--- at param cb string # The name of a callback.
local function unregister_callback(cb)
if luatexbase then
luatexbase.remove_from_callback(cb, 'nodetree')
@@ -1549,9 +1627,9 @@
-- file using `latexmk` and read the generated `*.nttex` file and
-- return its content.
--
- -- @tparam string tex_markup
+ --- at param tex_markup string
--
- -- @treturn string
+ --- at return string
compile_include = function(tex_markup)
-- Generate a subfolder for all tempory files: _nodetree-jobname.
local parent_path = lfs.currentdir() .. '/' .. '_nodetree-' .. tex.jobname
@@ -1605,8 +1683,8 @@
--- Print a node tree.
---
- -- @tparam node head The head node of a node list.
- -- @tparam table opts Options as a table.
+ --- at param head Node # The head node of a node list.
+ --- at param opts table # Options as a table.
print = function(head, opts)
if opts and type(opts) == 'table' then
set_options(opts)
@@ -1617,17 +1695,17 @@
--- Format a scaled point value into a formated string.
--
- -- @tparam number sp A scaled point value
+ --- at param sp number # A scaled point value
--
- -- @treturn string
+ --- at return string
format_dim = function(sp)
return template.length(sp)
end,
--- Get a default option that is not changed.
- -- @tparam string key The key of the option.
+ --- at param key string # The key of the option.
--
- -- @treturn string|number|boolean
+ --- at return string|number|boolean
get_default_option = function(key)
return default_options[key]
end
@@ -1635,7 +1713,7 @@
--- Use export.print
--
--- @tparam node head The head node of a node list.
+--- at param head Node # The head node of a node list.
export.analyze = export.print
return export
Modified: trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree.sty 2022-12-17 00:51:17 UTC (rev 65297)
+++ trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree.sty 2022-12-17 20:54:42 UTC (rev 65298)
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2016-2020 by Josef Friedrich <josef at friedrich.rocks>
+%% Copyright (C) 2016-2022 by Josef Friedrich <josef at friedrich.rocks>
%% ----------------------------------------------------------------------
%% This work may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3c of this license
@@ -22,7 +22,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{nodetree}
- [2020/10/23 v2.2 Visualize node lists in a tree view]
+ [2022/12/17 v2.2.1 Visualize node lists in a tree view]
\input{nodetree}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
Modified: trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree.tex
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree.tex 2022-12-17 00:51:17 UTC (rev 65297)
+++ trunk/Master/texmf-dist/tex/luatex/nodetree/nodetree.tex 2022-12-17 20:54:42 UTC (rev 65298)
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2016-2020 by Josef Friedrich <josef at friedrich.rocks>
+%% Copyright (C) 2016-2022 by Josef Friedrich <josef at friedrich.rocks>
%% ----------------------------------------------------------------------
%% This work may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3c of this license
More information about the tex-live-commits
mailing list.