Use LDoc commands to mark parameters as optional in the docs.

Signed-off-by: Julian Wollrath <jwollrath@web.de>
This commit is contained in:
Julian Wollrath 2015-02-26 22:06:34 +01:00 committed by Daniel Hahler
parent 781f0be520
commit ca89f0f311
26 changed files with 82 additions and 82 deletions

View File

@ -23,7 +23,7 @@
--- Emit a signal. --- Emit a signal.
-- @tparam string name A signal name. -- @tparam string name A signal name.
-- @param ... Various arguments, optional. -- @param[opt] ... Various arguments.
-- @function emit_signal -- @function emit_signal
--- Get the number of instances. --- Get the number of instances.

View File

@ -54,7 +54,7 @@
--- Get all clients into a table. --- Get all clients into a table.
-- --
-- @param screen An optional screen number. -- @param[opt] screen A screen number.
-- @return A table with all clients. -- @return A table with all clients.
-- @function get -- @function get
@ -147,7 +147,7 @@
--- Emit a signal. --- Emit a signal.
-- --
-- @param name A signal name. -- @param name A signal name.
-- @param ... Various arguments, optional. -- @param[opt] ... Various arguments.
-- @function emit_signal -- @function emit_signal
--- Get the number of instances. --- Get the number of instances.

View File

@ -34,7 +34,7 @@
--- Emit a signal. --- Emit a signal.
-- --
-- @param name A signal name. -- @param name A signal name.
-- @param ... Various arguments, optional. -- @param[opt] ... Various arguments.
-- @function emit_signal -- @function emit_signal
--- Get the number of instances. --- Get the number of instances.

View File

@ -67,7 +67,7 @@
--- Emit a signal. --- Emit a signal.
-- --
-- @param name A signal name. -- @param name A signal name.
-- @param ... Various arguments, optional. -- @param[opt] ... Various arguments.
-- @function emit_signal -- @function emit_signal
--- Get the number of instances. --- Get the number of instances.

View File

@ -29,7 +29,7 @@
--- Emit a signal. --- Emit a signal.
-- --
-- @param name A signal name. -- @param name A signal name.
-- @param ... Various arguments, optional. -- @param[opt] ... Various arguments.
-- @function emit_signal -- @function emit_signal
--- Get the number of instances. --- Get the number of instances.

View File

@ -36,5 +36,5 @@
--- Emit a signal to a screen. --- Emit a signal to a screen.
-- --
-- @string name A signal name. -- @string name A signal name.
-- @param ... Various arguments, optional. -- @param[opt] ... Various arguments.
-- @function emit_signal -- @function emit_signal

View File

@ -32,7 +32,7 @@
--- Emit a signal. --- Emit a signal.
-- --
-- @param name A signal name. -- @param name A signal name.
-- @param ... Various arguments, optional. -- @param[opt] ... Various arguments.
-- @function emit_signal -- @function emit_signal
--- Get the number of instances. --- Get the number of instances.

View File

@ -248,7 +248,7 @@ end
-- If no client is passed, the focused client will be used. -- If no client is passed, the focused client will be used.
-- --
-- @tparam int i The index. Use 1 to get the next, -1 to get the previous. -- @tparam int i The index. Use 1 to get the next, -1 to get the previous.
-- @client[opt] c Optional client. -- @client[opt] c The client.
-- @return A client, or nil if no client is available. -- @return A client, or nil if no client is available.
-- --
-- @usage -- focus the next window in the index -- @usage -- focus the next window in the index
@ -283,7 +283,7 @@ end
-- --
-- @tparam string dir The direction, can be either -- @tparam string dir The direction, can be either
-- `"up"`, `"down"`, `"left"` or `"right"`. -- `"up"`, `"down"`, `"left"` or `"right"`.
-- @client[opt] c Optional client. -- @client[opt] c The client.
function client.focus.bydirection(dir, c) function client.focus.bydirection(dir, c)
local sel = c or capi.client.focus local sel = c or capi.client.focus
if sel then if sel then
@ -305,7 +305,7 @@ end
--- Focus a client by the given direction. Moves across screens. --- Focus a client by the given direction. Moves across screens.
-- --
-- @param dir The direction, can be either "up", "down", "left" or "right". -- @param dir The direction, can be either "up", "down", "left" or "right".
-- @client[opt] c Optional client. -- @client[opt] c The client.
function client.focus.global_bydirection(dir, c) function client.focus.global_bydirection(dir, c)
screen = screen or require("awful.screen") screen = screen or require("awful.screen")
local sel = c or capi.client.focus local sel = c or capi.client.focus
@ -338,7 +338,7 @@ end
--- Focus a client by its relative index. --- Focus a client by its relative index.
-- --
-- @param i The index. -- @param i The index.
-- @client[opt] c Optional client. -- @client[opt] c The client.
function client.focus.byidx(i, c) function client.focus.byidx(i, c)
local target = client.next(i, c) local target = client.next(i, c)
if target then if target then
@ -348,7 +348,7 @@ end
--- Swap a client with another client in the given direction --- Swap a client with another client in the given direction
-- @param dir The direction, can be either "up", "down", "left" or "right". -- @param dir The direction, can be either "up", "down", "left" or "right".
-- @client[opt] c Optional client. -- @client[opt] c The client.
function client.swap.bydirection(dir, c) function client.swap.bydirection(dir, c)
local sel = c or capi.client.focus local sel = c or capi.client.focus
if sel then if sel then
@ -368,7 +368,7 @@ end
--- Swap a client with another client in the given direction. Swaps across screens. --- Swap a client with another client in the given direction. Swaps across screens.
-- @param dir The direction, can be either "up", "down", "left" or "right". -- @param dir The direction, can be either "up", "down", "left" or "right".
-- @client[opt] c Optional client. -- @client[opt] c The client.
function client.swap.global_bydirection(dir, c) function client.swap.global_bydirection(dir, c)
screen = screen or require("awful.screen") screen = screen or require("awful.screen")
local sel = c or capi.client.focus local sel = c or capi.client.focus
@ -403,7 +403,7 @@ end
--- Swap a client by its relative index. --- Swap a client by its relative index.
-- @param i The index. -- @param i The index.
-- @client[opt] c Optional client, otherwise focused one is used. -- @client[opt] c The client, otherwise focused one is used.
function client.swap.byidx(i, c) function client.swap.byidx(i, c)
local sel = c or capi.client.focus local sel = c or capi.client.focus
local target = client.next(i, sel) local target = client.next(i, sel)
@ -415,7 +415,7 @@ end
--- Cycle clients. --- Cycle clients.
-- --
-- @param clockwise True to cycle clients clockwise. -- @param clockwise True to cycle clients clockwise.
-- @param[opt] screen Optional screen where to cycle clients. -- @param[opt] screen The screen where to cycle clients.
function client.cycle(clockwise, screen) function client.cycle(clockwise, screen)
local screen = screen or capi.mouse.screen local screen = screen or capi.mouse.screen
local cls = client.visible(screen) local cls = client.visible(screen)
@ -436,7 +436,7 @@ end
--- Get the master window. --- Get the master window.
-- --
-- @param[opt] screen Optional screen number, otherwise screen mouse is used. -- @param[opt] screen The screen number, otherwise screen mouse is used.
-- @return The master window. -- @return The master window.
function client.getmaster(screen) function client.getmaster(screen)
local s = screen or capi.mouse.screen local s = screen or capi.mouse.screen
@ -467,7 +467,7 @@ end
-- @param y The relative y coordinate. -- @param y The relative y coordinate.
-- @param w The relative width. -- @param w The relative width.
-- @param h The relative height. -- @param h The relative height.
-- @client[opt] c The optional client, otherwise focused one is used. -- @client[opt] c The client, otherwise focused one is used.
function client.moveresize(x, y, w, h, c) function client.moveresize(x, y, w, h, c)
local sel = c or capi.client.focus local sel = c or capi.client.focus
local geometry = sel:geometry() local geometry = sel:geometry()
@ -480,7 +480,7 @@ end
--- Move a client to a tag. --- Move a client to a tag.
-- @param target The tag to move the client to. -- @param target The tag to move the client to.
-- @client[opt] c Optional client to move, otherwise the focused one is used. -- @client[opt] c The client to move, otherwise the focused one is used.
function client.movetotag(target, c) function client.movetotag(target, c)
local sel = c or capi.client.focus local sel = c or capi.client.focus
local s = tag.getscreen(target) local s = tag.getscreen(target)
@ -493,7 +493,7 @@ end
--- Toggle a tag on a client. --- Toggle a tag on a client.
-- @param target The tag to toggle. -- @param target The tag to toggle.
-- @client[opt] c Optional client to toggle, otherwise the focused one is used. -- @client[opt] c The client to toggle, otherwise the focused one is used.
function client.toggletag(target, c) function client.toggletag(target, c)
local sel = c or capi.client.focus local sel = c or capi.client.focus
-- Check that tag and client screen are identical -- Check that tag and client screen are identical

View File

@ -61,7 +61,7 @@ end
--- Change the layout of the current tag. --- Change the layout of the current tag.
-- @param i Relative index. -- @param i Relative index.
-- @param s The screen number. -- @param s The screen number.
-- @param layouts A table of layouts. (optional) -- @param[opt] layouts A table of layouts.
function layout.inc(i, s, layouts) function layout.inc(i, s, layouts)
local t = tag.selected(s) local t = tag.selected(s)
local layouts = layouts or layout.layouts local layouts = layouts or layout.layouts

View File

@ -366,11 +366,11 @@ function menu:get_root()
end end
--- Add a new menu entry. --- Add a new menu entry.
-- args.new (Default: awful.menu.entry) The menu entry constructor.
-- args.theme (Optional) The menu entry theme.
-- args.* params needed for the menu entry constructor. -- args.* params needed for the menu entry constructor.
-- @param args The item params -- @param args The item params
-- @param index (Optional) the index where the new entry will inserted -- @param args.new (Default: awful.menu.entry) The menu entry constructor.
-- @param[opt] args.theme The menu entry theme.
-- @param[opt] index The index where the new entry will inserted.
function menu:add(args, index) function menu:add(args, index)
if not args then return end if not args then return end
local theme = load_theme(args.theme or {}, self.theme) local theme = load_theme(args.theme or {}, self.theme)

View File

@ -194,7 +194,7 @@ end
--- Place the client centered with respect to a parent or the clients screen. --- Place the client centered with respect to a parent or the clients screen.
-- @param c The client. -- @param c The client.
-- @param p The parent (optional, nil for screen centering). -- @param[opt] p The parent (nil for screen centering).
-- @return The new client geometry. -- @return The new client geometry.
function placement.centered(c, p) function placement.centered(c, p)
local c = c or capi.client.focus local c = c or capi.client.focus
@ -212,7 +212,7 @@ end
--- Place the client centered on the horizontal axis with respect to a parent or the clients screen. --- Place the client centered on the horizontal axis with respect to a parent or the clients screen.
-- @param c The client. -- @param c The client.
-- @param p The parent (optional, nil for screen centering). -- @param[opt] p The parent (nil for screen centering).
-- @return The new client geometry. -- @return The new client geometry.
function placement.center_horizontal(c, p) function placement.center_horizontal(c, p)
local c = c or capi.client.focus local c = c or capi.client.focus
@ -229,7 +229,7 @@ end
--- Place the client centered on the vertical axis with respect to a parent or the clients screen. --- Place the client centered on the vertical axis with respect to a parent or the clients screen.
-- @param c The client. -- @param c The client.
-- @param p The parent (optional, nil for screen centering). -- @param[opt] p The parent (nil for screen centering).
-- @return The new client geometry. -- @return The new client geometry.
function placement.center_vertical(c, p) function placement.center_vertical(c, p)
local c = c or capi.client.focus local c = c or capi.client.focus

View File

@ -36,8 +36,8 @@ local function itera (inc,a, i)
end end
--- Load history file in history table --- Load history file in history table
-- @param id The data.history identifier which is the path to the filename -- @param id The data.history identifier which is the path to the filename.
-- @param max Optional parameter, the maximum number of entries in file -- @param[opt] max The maximum number of entries in file.
local function history_check_load(id, max) local function history_check_load(id, max)
if id and id ~= "" if id and id ~= ""
and not data.history[id] then and not data.history[id] then
@ -188,15 +188,15 @@ end
-- @param exe_callback The callback function to call with command as argument -- @param exe_callback The callback function to call with command as argument
-- when finished. -- when finished.
-- @param completion_callback The callback function to call to get completion. -- @param completion_callback The callback function to call to get completion.
-- @param history_path Optional parameter: file path where the history should be -- @param[opt] history_path File path where the history should be
-- saved, set nil to disable history -- saved, set nil to disable history
-- @param history_max Optional parameter: set the maximum entries in history -- @param[opt] history_max Set the maximum entries in history
-- file, 50 by default -- file, 50 by default
-- @param done_callback Optional parameter: the callback function to always call -- @param[opt] done_callback The callback function to always call
-- without arguments, regardless of whether the prompt was cancelled. -- without arguments, regardless of whether the prompt was cancelled.
-- @param changed_callback Optional parameter: the callback function to call -- @param[opt] changed_callback The callback function to call
-- with command as argument when a command was changed. -- with command as argument when a command was changed.
-- @param keypressed_callback Optional parameter: the callback function to call -- @param[opt] keypressed_callback The callback function to call
-- with mod table, key and command as arguments when a key was pressed. -- with mod table, key and command as arguments when a key was pressed.
function prompt.run(args, textbox, exe_callback, completion_callback, history_path, history_max, done_callback, changed_callback, keypressed_callback) function prompt.run(args, textbox, exe_callback, completion_callback, history_path, history_max, done_callback, changed_callback, keypressed_callback)
local grabber local grabber

View File

@ -180,7 +180,7 @@ end
--- Apply properties and callbacks to a client. --- Apply properties and callbacks to a client.
-- @client c The client. -- @client c The client.
-- @tab props Properties to apply. -- @tab props Properties to apply.
-- @tab callbacks Callbacks to apply (optional). -- @tab[opt] callbacks Callbacks to apply.
function rules.execute(c, props, callbacks) function rules.execute(c, props, callbacks)
for property, value in pairs(props) do for property, value in pairs(props) do
if property ~= "focus" and type(value) == "function" then if property ~= "focus" and type(value) == "function" then

View File

@ -30,7 +30,7 @@ data.padding = {}
-- `screen` table/object. -- `screen` table/object.
-- @param x The x coordinate -- @param x The x coordinate
-- @param y The y coordinate -- @param y The y coordinate
-- @param default Optional default return value. If unspecified, 1 is returned. -- @param[opt] default The default return value. If unspecified, 1 is returned.
function screen.getbycoord(x, y, default) function screen.getbycoord(x, y, default)
for i = 1, capi.screen:count() do for i = 1, capi.screen:count() do
local geometry = capi.screen[i].geometry local geometry = capi.screen[i].geometry

View File

@ -377,7 +377,7 @@ function tag.incmwfact(add, t)
end end
--- Get master width factor. --- Get master width factor.
-- @param t Optional tag. -- @param[opt] t The tag.
function tag.getmwfact(t) function tag.getmwfact(t)
local t = t or tag.selected() local t = t or tag.selected()
return tag.getproperty(t, "mwfact") or 0.5 return tag.getproperty(t, "mwfact") or 0.5
@ -385,7 +385,7 @@ end
--- Set the number of master windows. --- Set the number of master windows.
-- @param nmaster The number of master windows. -- @param nmaster The number of master windows.
-- @param t Optional tag. -- @param[opt] t The tag.
function tag.setnmaster(nmaster, t) function tag.setnmaster(nmaster, t)
local t = t or tag.selected() local t = t or tag.selected()
if nmaster >= 0 then if nmaster >= 0 then
@ -394,7 +394,7 @@ function tag.setnmaster(nmaster, t)
end end
--- Get the number of master windows. --- Get the number of master windows.
-- @param t Optional tag. -- @param[opt] t The tag.
function tag.getnmaster(t) function tag.getnmaster(t)
local t = t or tag.selected() local t = t or tag.selected()
return tag.getproperty(t, "nmaster") or 1 return tag.getproperty(t, "nmaster") or 1
@ -434,7 +434,7 @@ function tag.setncol(ncol, t)
end end
--- Get number of column windows. --- Get number of column windows.
-- @param t Optional tag. -- @param[opt] t The tag.
function tag.getncol(t) function tag.getncol(t)
local t = t or tag.selected() local t = t or tag.selected()
return tag.getproperty(t, "ncol") or 1 return tag.getproperty(t, "ncol") or 1
@ -448,7 +448,7 @@ function tag.incncol(add, t)
end end
--- View no tag. --- View no tag.
-- @tparam int screen Optional screen number. -- @tparam[opt] int screen The screen number.
function tag.viewnone(screen) function tag.viewnone(screen)
local tags = tag.gettags(screen or capi.mouse.screen) local tags = tag.gettags(screen or capi.mouse.screen)
for i, t in pairs(tags) do for i, t in pairs(tags) do
@ -458,7 +458,7 @@ end
--- View a tag by its taglist index. --- View a tag by its taglist index.
-- @param i The relative index to see. -- @param i The relative index to see.
-- @param screen Optional screen number. -- @param[opt] screen The screen number.
function tag.viewidx(i, screen) function tag.viewidx(i, screen)
local screen = screen or capi.mouse.screen local screen = screen or capi.mouse.screen
local tags = tag.gettags(screen) local tags = tag.gettags(screen)
@ -523,7 +523,7 @@ end
--- View only a set of tags. --- View only a set of tags.
-- @param tags A table with tags to view only. -- @param tags A table with tags to view only.
-- @param screen Optional screen number of the tags. -- @param[opt] screen The screen number of the tags.
function tag.viewmore(tags, screen) function tag.viewmore(tags, screen)
local screen = screen or capi.mouse.screen local screen = screen or capi.mouse.screen
local screen_tags = tag.gettags(screen) local screen_tags = tag.gettags(screen)

View File

@ -55,7 +55,7 @@ end
--- Get a client's titlebar --- Get a client's titlebar
-- @class function -- @class function
-- @param c The client for which a titlebar is wanted. -- @param c The client for which a titlebar is wanted.
-- @param args An optional table with extra arguments for the titlebar. The -- @param[opt] args A table with extra arguments for the titlebar. The
-- "size" is the height of the titlebar. Available "position" values are top, -- "size" is the height of the titlebar. Available "position" values are top,
-- left, right and bottom. Additionally, the foreground and background colors -- left, right and bottom. Additionally, the foreground and background colors
-- can be configured via e.g. "bg_normal" and "bg_focus". -- can be configured via e.g. "bg_normal" and "bg_focus".
@ -104,7 +104,7 @@ end
--- Show a client's titlebar. --- Show a client's titlebar.
-- @param c The client whose titlebar is modified -- @param c The client whose titlebar is modified
-- @param position Optional position of the titlebar. Must be one of "left", -- @param[opt] position The position of the titlebar. Must be one of "left",
-- "right", "top", "bottom". Default is "top". -- "right", "top", "bottom". Default is "top".
function titlebar.show(c, position) function titlebar.show(c, position)
local position = position or "top" local position = position or "top"
@ -116,7 +116,7 @@ end
--- Hide a client's titlebar. --- Hide a client's titlebar.
-- @param c The client whose titlebar is modified -- @param c The client whose titlebar is modified
-- @param position Optional position of the titlebar. Must be one of "left", -- @param[opt] position The position of the titlebar. Must be one of "left",
-- "right", "top", "bottom". Default is "top". -- "right", "top", "bottom". Default is "top".
function titlebar.hide(c, position) function titlebar.hide(c, position)
local position = position or "top" local position = position or "top"
@ -125,7 +125,7 @@ end
--- Toggle a client's titlebar, hiding it if it is visible, otherwise showing it. --- Toggle a client's titlebar, hiding it if it is visible, otherwise showing it.
-- @param c The client whose titlebar is modified -- @param c The client whose titlebar is modified
-- @param position Optional position of the titlebar. Must be one of "left", -- @param[opt] position The position of the titlebar. Must be one of "left",
-- "right", "top", "bottom". Default is "top". -- "right", "top", "bottom". Default is "top".
function titlebar.toggle(c, position) function titlebar.toggle(c, position)
local position = position or "top" local position = position or "top"

View File

@ -33,7 +33,7 @@ util.shell = os.getenv("SHELL") or "/bin/sh"
local displayed_deprecations = {} local displayed_deprecations = {}
--- Display a deprecation notice, but only once per traceback. --- Display a deprecation notice, but only once per traceback.
-- @param see Optional message to a new method / function to use. -- @param[opt] see The message to a new method / function to use.
function util.deprecate(see) function util.deprecate(see)
local tb = debug.traceback() local tb = debug.traceback()
if displayed_deprecations[tb] then if displayed_deprecations[tb] then
@ -190,7 +190,7 @@ end
-- @param iconname The name of the icon to search for. -- @param iconname The name of the icon to search for.
-- @param exts Table of image extensions allowed, otherwise { 'png', gif' } -- @param exts Table of image extensions allowed, otherwise { 'png', gif' }
-- @param dirs Table of dirs to search, otherwise { '/usr/share/pixmaps/' } -- @param dirs Table of dirs to search, otherwise { '/usr/share/pixmaps/' }
-- @tparam string size Optional size. If this is specified, subdirectories `x` -- @tparam[opt] string size The size. If this is specified, subdirectories `x`
-- of the dirs are searched first. -- of the dirs are searched first.
function util.geticonpath(iconname, exts, dirs, size) function util.geticonpath(iconname, exts, dirs, size)
local exts = exts or { 'png', 'gif' } local exts = exts or { 'png', 'gif' }

View File

@ -139,20 +139,20 @@ end
-- @param filter Filter function to define what clients will be listed. -- @param filter Filter function to define what clients will be listed.
-- @param buttons A table with buttons binding to set. -- @param buttons A table with buttons binding to set.
-- @param style The style overrides default theme. -- @param style The style overrides default theme.
-- @param update_function Optional function to create a tag widget on each -- @param[opt] update_function Function to create a tag widget on each
-- update. @see awful.widget.common. -- update. @see awful.widget.common.
-- @param base_widget Optional container widget for tag widgets. Default -- @param[opt] base_widget Optional container widget for tag widgets. Default
-- is wibox.layout.fixed.horizontal(). -- is wibox.layout.fixed.horizontal().
-- bg_focus The background color for focused client. -- @param base_widget.bg_focus The background color for focused client.
-- fg_focus The foreground color for focused client. -- @param base_widget.fg_focus The foreground color for focused client.
-- bg_urgent The background color for urgent clients. -- @param base_widget.bg_urgent The background color for urgent clients.
-- fg_urgent The foreground color for urgent clients. -- @param base_widget.fg_urgent The foreground color for urgent clients.
-- squares_sel Optional: a user provided image for selected squares. -- @param[opt] base_widget.squares_sel A user provided image for selected squares.
-- squares_unsel Optional: a user provided image for unselected squares. -- @param[opt] base_widget.squares_unsel A user provided image for unselected squares.
-- squares_sel_empty Optional: a user provided image for selected squares for empty tags. -- @param[opt] base_widget.squares_sel_empty A user provided image for selected squares for empty tags.
-- squares_unsel_empty Optional: a user provided image for unselected squares for empty tags. -- @param[opt] base_widget.squares_unsel_empty A user provided image for unselected squares for empty tags.
-- squares_resize Optional: true or false to resize squares. -- @param[opt] base_widget.squares_resize True or false to resize squares.
-- font The font. -- @param base_widget.font The font.
function taglist.new(screen, filter, buttons, style, update_function, base_widget) function taglist.new(screen, filter, buttons, style, update_function, base_widget)
local uf = update_function or common.list_update local uf = update_function or common.list_update
local w = base_widget or fixed.horizontal() local w = base_widget or fixed.horizontal()

View File

@ -122,9 +122,9 @@ end
-- @param filter Filter function to define what clients will be listed. -- @param filter Filter function to define what clients will be listed.
-- @param buttons A table with buttons binding to set. -- @param buttons A table with buttons binding to set.
-- @param style The style overrides default theme. -- @param style The style overrides default theme.
-- @param update_function Optional function to create a tag widget on each -- @param[opt] update_function Function to create a tag widget on each
-- update. See `awful.widget.common.list_update`. -- update. See `awful.widget.common.list_update`.
-- @tparam table base_widget Optional container widget for tag widgets. Default -- @tparam[opt] table base_widget Container widget for tag widgets. Default
-- is `wibox.layout.flex.horizontal`. -- is `wibox.layout.flex.horizontal`.
-- @param base_widget.bg_normal The background color for unfocused client. -- @param base_widget.bg_normal The background color for unfocused client.
-- @param base_widget.bg_normal The background color for unfocused client. -- @param base_widget.bg_normal The background color for unfocused client.

View File

@ -17,7 +17,7 @@ local debug = {}
--- Check that the given condition holds true, else throw an error --- Check that the given condition holds true, else throw an error
-- --
-- @param cond If this is false, throw a lua error with a backtrace. -- @param cond If this is false, throw a lua error with a backtrace.
-- @param[opt] message Message to print in the error (optional). -- @param[opt] message Message to print in the error.
function debug.assert(cond, message) function debug.assert(cond, message)
local message = message or cond local message = message or cond
if not cond then if not cond then

View File

@ -173,7 +173,7 @@ end
-- @param position top_right | top_left | bottom_right | bottom_left -- @param position top_right | top_left | bottom_right | bottom_left
-- | top_middle | bottom_middle -- | top_middle | bottom_middle
-- @param idx Index of the notification -- @param idx Index of the notification
-- @param width Popup width (optional) -- @param[opt] width Popup width.
-- @param height Popup height -- @param height Popup height
-- @return Absolute position and index in { x = X, y = Y, idx = I } table -- @return Absolute position and index in { x = X, y = Y, idx = I } table
local function get_offset(screen, position, idx, width, height) local function get_offset(screen, position, idx, width, height)

View File

@ -103,11 +103,11 @@ end
-- that respect the widget's size, eg. fixed layout. In layouts that don't -- that respect the widget's size, eg. fixed layout. In layouts that don't
-- (fully) respect widget's requested size, the inner widget still might get -- (fully) respect widget's requested size, the inner widget still might get
-- drawn with a size that does not fit the constraint, eg. in flex layout. -- drawn with a size that does not fit the constraint, eg. in flex layout.
-- @param widget A widget to use (optional) -- @param[opt] widget A widget to use.
-- @param strategy How to constraint the size. 'max' (default), 'min' or -- @param[opt] strategy How to constraint the size. 'max' (default), 'min' or
-- 'exact'. (optional) -- 'exact'.
-- @param width The maximum width of the widget. nil for no limit. (optional) -- @param[opt] width The maximum width of the widget. nil for no limit.
-- @param height The maximum height of the widget. nil for no limit. (optional) -- @param[opt] height The maximum height of the widget. nil for no limit.
local function new(widget, strategy, width, height) local function new(widget, strategy, width, height)
local ret = widget_base.make_widget() local ret = widget_base.make_widget()

View File

@ -120,12 +120,12 @@ for k, v in pairs({ "left", "right", "top", "bottom" }) do
end end
--- Returns a new margin layout. --- Returns a new margin layout.
-- @param widget A widget to use (optional) -- @param[opt] widget A widget to use.
-- @param left A margin to use on the left side of the widget (optional) -- @param[opt] left A margin to use on the left side of the widget.
-- @param right A margin to use on the right side of the widget (optional) -- @param[opt] right A margin to use on the right side of the widget.
-- @param top A margin to use on the top side of the widget (optional) -- @param[opt] top A margin to use on the top side of the widget.
-- @param bottom A margin to use on the bottom side of the widget (optional) -- @param[opt] bottom A margin to use on the bottom side of the widget.
-- @param color A color for the margins (optional) -- @param[opt] color A color for the margins.
local function new(widget, left, right, top, bottom, color) local function new(widget, left, right, top, bottom, color)
local ret = widget_base.make_widget() local ret = widget_base.make_widget()

View File

@ -98,8 +98,8 @@ end
-- :set_widget() to set the widget and -- :set_widget() to set the widget and
-- :set_horizontal() and :set_vertical() for the direction. -- :set_horizontal() and :set_vertical() for the direction.
-- horizontal and vertical are by default false which doesn't change anything. -- horizontal and vertical are by default false which doesn't change anything.
-- @param widget The widget to display (optional) -- @param[opt] widget The widget to display.
-- @param reflection A table describing the reflection to apply (optional) -- @param[opt] reflection A table describing the reflection to apply.
local function new(widget, reflection) local function new(widget, reflection)
local ret = widget_base.make_widget() local ret = widget_base.make_widget()
ret.horizontal = false ret.horizontal = false

View File

@ -99,8 +99,8 @@ end
--- Returns a new rotate layout. A rotate layout rotates a given widget. Use --- Returns a new rotate layout. A rotate layout rotates a given widget. Use
-- :set_widget() to set the widget and :set_direction() for the direction. -- :set_widget() to set the widget and :set_direction() for the direction.
-- The default direction is "north" which doesn't change anything. -- The default direction is "north" which doesn't change anything.
-- @param widget The widget to display (optional) -- @param[opt] widget The widget to display.
-- @param dir The direction to rotate to (optional) -- @param[opt] dir The direction to rotate to.
local function new(widget, dir) local function new(widget, dir)
local ret = widget_base.make_widget() local ret = widget_base.make_widget()

View File

@ -96,8 +96,8 @@ end
--- Returns a new background layout. A background layout applies a background --- Returns a new background layout. A background layout applies a background
-- and foreground color to another widget. -- and foreground color to another widget.
-- @param widget The widget to display (optional) -- @param[opt] widget The widget to display.
-- @param bg The background to use for that widget (optional) -- @param[opt] bg The background to use for that widget.
local function new(widget, bg) local function new(widget, bg)
local ret = base.make_widget() local ret = base.make_widget()