New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to represent an argument that's a table? #265
Comments
I've been using the following:
|
Don't think that worked right for me: -- @tparam {{highlightText=string,highlightType=IOE.Core.HighlightTypes},...} cons
function Geyser.Label:addChild(cons, container)
cons = cons or {} My current and rather contrived workaround is: --- cons argument for @{Geyser.Label:addChild}
-- @field name a unique name for the label
-- @field height height of the label - specify it as the defaults are huge
-- @field width width of the label - specify it as the defaults are huge
-- @field[opt='LV'] layoutDir specifies in which direction and axis should the labels align, where 2 letters combine into the option: first letter R for right, L for left, T for top, B for bottom, followed by the orientation: V for vertical or H for horizontal. So options are: layoutDir="RV", layoutDir="RH", layoutDir="LV", layoutDir="LH", and so on
-- @field[opt=false] flyOut allows labels to show up when mouse is hovered over
-- @field[opt=''] message initial message to show on the label
-- @field[opt='white'] fgColor optional foreground colour - colour to use for text on the label
-- @field[opt='black'] bgColor optional background colour - colour of the whole label
-- @field[opt=1] fillBg 1 if the background is to be filled, 0 for no background
addChildCons = {
name = "",
height = 30,
width = 70,
layoutDir = "RV",
flyOut = true,
message = "",
fgColor = "white",
bgColor = "black",
fillBig = 1,
}
addChildCons = nil
--- adds a flyout label to an existing label that is marked with nestable=true
--- see http://wiki.mudlet.org/w/Manual:Geyser#Flyout_Labels for examples
-- @tparam table cons see @{addChildCons}
function Geyser.Label:addChild(cons, container)
cons = cons or {} |
It is supported, although not well documented. Look at tests/styles/subparams.lua -------
-- A function with subfield arguments.
-- @param s string
-- @param opts multibyte encoding options
-- @param opts.charset string
-- @param opts.strict bool
-- @param verbose bool
-- @return its length
function with_options (s,opts,verbose)
end The other alternative of course, is to document that table separately and use a reference to it. |
Thank you, that works great! |
vadi2
added a commit
to vadi2/mudlet-lua
that referenced
this issue
Mar 11, 2017
lunarmodules/ldoc#265 explained how to document table parameters.
Yeah, I really need to revise the docs and cover all the nice little
features.
…On Sun, Mar 12, 2017 at 12:23 AM, Vadim Peretokin ***@***.***> wrote:
Thank you, that works great!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#265 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANXDROf9cfET9WRAdrghNxvzgaEErVOks5rkx7OgaJpZM4MTDDh>
.
|
vadi2
added a commit
to vadi2/Mudlet
that referenced
this issue
Apr 4, 2017
lunarmodules/ldoc#265 explained how to document table parameters.
@stevedonovan But the [opt] flag is not support while use subparams. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have an argument that's a table of values, how can I document it using ldoc? @table seems to be for stand-alone tables.
The text was updated successfully, but these errors were encountered: