diff --git a/docs/common/cursor_c.ldoc b/docs/common/cursor_c.ldoc index 55ac684c..019d342f 100644 --- a/docs/common/cursor_c.ldoc +++ b/docs/common/cursor_c.ldoc @@ -1,30 +1,30 @@
- *
num_glyphs
+ *
num\_glyphs
*
arrow
- *
based_arrow_down
- *
based_arrow_up
+ *
based\_arrow\_down
+ *
based\_arrow\_up
*
boat
*
bogosity
- *
bottom_left_corner
- *
bottom_right_corner
- *
bottom_side
- *
bottom_tee
- *
box_spiral
- *
center_ptr
+ *
bottom\_left\_corner
+ *
bottom\_right\_corner
+ *
bottom\_side
+ *
bottom\_tee
+ *
box\_spiral
+ *
center\_ptr
*
circle
*
clock
- *
coffee_mug
+ *
coffee\_mug
*
cross
*
crosshair
- *
cross_reverse
+ *
cross\_reverse
*
cursor
- *
diamond_cross
+ *
diamond\_cross
*
dotbox
*
dot
- *
double_arrow
- *
draft_large
- *
draft_small
- *
draped_box
+ *
double\_arrow
+ *
draft\_large
+ *
draft\_small
+ *
draped\_box
*
exchange
*
fleur
*
gobbler
@@ -33,32 +33,32 @@ *
hand
*
heart
*
icon
- *
iron_cross
+ *
iron\_cross
*
leftbutton
- *
left_ptr
- *
left_side
- *
left_tee
- *
ll_angle
- *
lr_angle
+ *
left\_ptr
+ *
left\_side
+ *
left\_tee
+ *
ll\_angle
+ *
lr\_angle
*
man
*
middlebutton
*
mouse
*
pencil
*
pirate
*
plus
- *
question_arrow
+ *
question\_arrow
*
rightbutton
- *
right_ptr
- *
right_side
- *
right_tee
- *
rtl_logo
+ *
right\_ptr
+ *
right\_side
+ *
right\_tee
+ *
rtl\_logo
*
sailboat
- *
sb_down_arrow
- *
sb_h_double_arrow
- *
sb_left_arrow
- *
sb_right_arrow
- *
sb_up_arrow
- *
sb_v_double_arrow
+ *
sb\_down\_arrow
+ *
sb\_h\_double\_arrow
+ *
sb\_left\_arrow
+ *
sb\_right\_arrow
+ *
sb\_up\_arrow
+ *
sb\_v\_double\_arrow
*
shuttle
*
sizing
*
spider
@@ -66,15 +66,15 @@ *
star
*
target
*
tcross
- *
top_left_arrow
- *
top_left_corner
- *
top_right_corner
- *
top_side
- *
top_tee
+ *
top\_left\_arrow
+ *
top\_left\_corner
+ *
top\_right\_corner
+ *
top\_side
+ *
top\_tee
*
trek
- *
ul_angle
+ *
ul\_angle
*
umbrella
- *
ur_angle
+ *
ur\_angle
*
watch
*
xterm
*
diff --git a/docs/common/rule.ldoc b/docs/common/rule.ldoc index 357b27fc..403cc633 100644 --- a/docs/common/rule.ldoc +++ b/docs/common/rule.ldoc @@ -4,15 +4,17 @@ -- -- @rulecomponent properties -- @param table --- @see callbacks +-- @see callback --TODO add ^ -- @DOC_text_gears_matcher_properties_EXAMPLE@ ---- A list of callback function to call *after* the properties have been apploed. --- @rulecomponent callbacks --- @param table --- @see properties +--- A callback function to call *after* the `properties` have been applied. +-- +-- The callback is called with the current client as first argument. +-- +-- @rulecomponent callback +-- @param function --- A table whose content will be compared to the target object current properties. -- diff --git a/docs/ldoc.css b/docs/ldoc.css index f73a9e09..9857bcfb 100644 --- a/docs/ldoc.css +++ b/docs/ldoc.css @@ -47,7 +47,11 @@ p.name { font-family: monospace; } -kbd, p code, ol code { +kbd, +p code, +ol code, +ul code, +dd > code { background-color: #eaedf587; padding-left: 3px; padding-right: 3px; diff --git a/docs/ldoc.ltp b/docs/ldoc.ltp index f7c9b3db..2c518e30 100644 --- a/docs/ldoc.ltp +++ b/docs/ldoc.ltp @@ -395,7 +395,7 @@ # if def == true then (optional) # elseif def then - (default $(def)) + (default $(def)) # end # if item:readonly(p) then readonly @@ -535,7 +535,6 @@
generated by LDoc $(ldoc.version) -Last updated $(ldoc.updatetime)
diff --git a/lib/gears/timer.lua b/lib/gears/timer.lua index 20653a4b..839f3400 100644 --- a/lib/gears/timer.lua +++ b/lib/gears/timer.lua @@ -63,22 +63,27 @@ local protected_call = require("gears.protected_call") local gdebug = require("gears.debug") --- Timer objects. This type of object is useful when triggering events repeatedly. +-- -- The timer will emit the "timeout" signal every N seconds, N being the timeout -- value. Note that a started timer will not be garbage collected. Call `:stop` --- to enable garbage collection. +-- before dropping the last reference to prevent leaking the object. +-- -- @tfield number timeout Interval in seconds to emit the timeout signal. --- Can be any value, including floating point ones (e.g. 1.5 seconds). +-- Can be any value, including floating point ones (e.g. `1.5` seconds). -- @tfield boolean started Read-only boolean field indicating if the timer has been -- started. -- @table timer ---- When the timer is started. +--- Emitted when the timer is started. -- @signal start ---- When the timer is stopped. +--- Emitted when the timer is stopped. -- @signal stop ---- When the timer had a timeout event. +--- Emitted when `timeout` seconds have elapsed. +-- +-- This will be emitted repeatedly, unless `single_shot` has been set to `true` +-- for the timer. -- @signal timeout local timer = { mt = {} } @@ -156,11 +161,18 @@ local timer_instance_mt = { } --- Create a new timer object. +-- +-- `call_now` only takes effect when a `callback` is provided. `single_shot`, +-- on the other hand, also stops signals connected to the `timeout` signal. +-- +-- Specifying a function `func` as `args.callback` is equivalent to calling +-- `:connect_signal(func)` on the timer object. +-- -- @tparam table args Arguments. --- @tparam number args.timeout Timeout in seconds (e.g. 1.5). +-- @tparam number args.timeout Timeout in seconds (e.g. `1.5`). -- @tparam[opt=false] boolean args.autostart Automatically start the timer. -- @tparam[opt=false] boolean args.call_now Call the callback at timer creation. --- @tparam[opt=nil] function args.callback Callback function to connect to the +-- @tparam[opt] function args.callback Callback function to connect to the -- "timeout" signal. -- @tparam[opt=false] boolean args.single_shot Run only once then stop. -- @treturn timer diff --git a/lib/wibox/widget/textbox.lua b/lib/wibox/widget/textbox.lua index f12fda16..3a295a8f 100644 --- a/lib/wibox/widget/textbox.lua +++ b/lib/wibox/widget/textbox.lua @@ -301,19 +301,21 @@ function textbox:set_wrap(mode) end end ---- The textbox' vertical alignment. +--- The vertical text alignment. +-- +-- This aligns the text within the widget's bounds. In some situations this may +-- differ from aligning the widget with `wibox.container.place`. -- -- Valid values are: -- --- * **top** --- * **center** --- * **bottom** +-- * `"top"` +-- * `"center"` +-- * `"bottom"` -- --@DOC_wibox_widget_textbox_valign1_EXAMPLE@ -- -- @property valign --- @tparam[opt="center"] string mode Where should the textbox be drawn? "top", "center" or --- "bottom". +-- @tparam[opt="center"] string mode The vertical alignment -- @propemits true false function textbox:set_valign(mode) @@ -329,19 +331,21 @@ function textbox:set_valign(mode) end end ---- Set a textbox horizontal alignment. +--- The horizontal text alignment. +-- +-- This aligns the text within the widget's bounds. In some situations this may +-- differ from aligning the widget with `wibox.container.place`. -- -- Valid values are: -- --- * **left** --- * **center** --- * **right** +-- * `"left"` +-- * `"center"` +-- * `"right"` -- --@DOC_wibox_widget_textbox_align1_EXAMPLE@ -- -- @property align --- @tparam[opt="left"] string mode Where should the textbox be drawn? "left", "center" or --- "right". +-- @tparam[opt="left"] string mode The horizontal alignment -- @propemits true false function textbox:set_align(mode) diff --git a/tests/examples/wibox/widget/defaults/slider.lua b/tests/examples/wibox/widget/defaults/slider.lua index 94c3012e..1450a871 100644 --- a/tests/examples/wibox/widget/defaults/slider.lua +++ b/tests/examples/wibox/widget/defaults/slider.lua @@ -1,12 +1,12 @@ ---DOC_GEN_IMAGE --DOC_HIDE -local parent = ... --DOC_HIDE -local wibox = require( "wibox" ) --DOC_HIDE -local beautiful = require( "beautiful" ) --DOC_HIDE -local gears = {shape=require("gears.shape") } --DOC_HIDE +--DOC_GEN_IMAGE --DOC_HIDE_START +local parent = ... +local wibox = require( "wibox" ) +local beautiful = require( "beautiful" ) +local gears = {shape=require("gears.shape") } +local naughty = { notify = function(_) end } -parent:add( --DOC_HIDE - -wibox.widget { +--DOC_HIDE_END +local widget = wibox.widget { bar_shape = gears.shape.rounded_rect, bar_height = 3, bar_color = beautiful.border_color, @@ -19,6 +19,19 @@ wibox.widget { forced_height = 50, --DOC_HIDE forced_width = 100, --DOC_HIDE } +--DOC_NEWLINE +-- Connect to `property::value` to use the value on change +widget:connect_signal("property::value", function(_, new_value) + --DOC_HIDE_START + if new_value ~= 10 then + error(string.format("unexpected value %s", new_value)) + end + --DOC_HIDE_END + naughty.notify { title = "Slider changed", message = new_value } +end) -) --DOC_HIDE ---DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 +--DOC_HIDE_START +widget.value = 10 +parent:add(widget) + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80