Improve textclock property docs (#2926)

* Add format docs to the constructor.
* Add timezone docs to the property.
* Give the argument to set_refresh a name other than "How".
* Fix bug in constructor argument "format" rendering.
This commit is contained in:
Jordan Christiansen 2019-11-25 15:35:41 -06:00 committed by Emmanuel Lepage Vallée
parent 76f8c11776
commit f8a9c59d50
1 changed files with 5 additions and 5 deletions

View File

@ -44,6 +44,8 @@ function textclock:get_format()
end
--- Set the clock's timezone
-- e.g. "Z" for UTC, "±hh:mm" or "Europe/Amsterdam". See
-- [GTimeZone](https://developer.gnome.org/glib/stable/glib-GTimeZone.html#g-time-zone-new).
-- @property timezone
-- @tparam string timezone
@ -59,7 +61,7 @@ end
--- Set the clock's refresh rate
-- @property refresh
-- @tparam number How often the clock is updated, in seconds
-- @tparam number refresh How often the clock is updated, in seconds
function textclock:set_refresh(refresh)
self._private.refresh = refresh or self._private.refresh
@ -84,11 +86,9 @@ end
--- Create a textclock widget. It draws the time it is in a textbox.
--
-- @tparam[opt=" %a %b %d, %H:%M "] string format The time format.
-- @tparam[opt=" %a %b %d, %H:%M "] string format The time [format](#format).
-- @tparam[opt=60] number refresh How often to update the time (in seconds).
-- @tparam[opt=local timezone] string timezone The timezone to use,
-- e.g. "Z" for UTC, "±hh:mm" or "Europe/Amsterdam". See
-- https://developer.gnome.org/glib/stable/glib-GTimeZone.html#g-time-zone-new.
-- @tparam[opt=local timezone] string timezone The [timezone](#timezone) to use.
-- @treturn table A textbox widget.
-- @constructorfct wibox.widget.textclock
local function new(format, refresh, tzid)