ldoc icon indicating copy to clipboard operation
ldoc copied to clipboard

Support nested subparams

Open DifferentialOrange opened this issue 2 years ago • 2 comments
trafficstars

ldoc has support of subparams (even though the feature is a bit hidden):

https://github.com/lunarmodules/ldoc/blob/e4940daf748affb86489b0782ed8abab2e88bebc/tests/styles/subparams.lua#L8-L13

Since Lua does not have support of named params, it is not rare to have multiple level nested tables. Unfortunately, now ldoc doesn't have nested subparams support.

The following script

-- @table opts
--
-- @table opts.mytarg1
--  My table arg 1
--
-- @string opts.mytarg1.field1
--  My table arg 1 string field
--
-- @bool opts.mytarg1.field2
--  My table arg 1 bool field

is compiled to image even though it would be nice to see something like image

Restricting max nesting depth with configuration may also be useful here.

DifferentialOrange avatar Aug 15 '23 11:08 DifferentialOrange

This does seem like something we should surface. I don't have much dev time to contribute right now but I am keeping an eye on PRs and if anybody chips in to contribute this I think we can facilitate it getting included.

alerque avatar Aug 16 '23 19:08 alerque

It can be done by making a custom LTP template, see https://awesomewm.org/apidoc/core_components/client.html#shape

Elv13 avatar Mar 29 '24 07:03 Elv13