From 59380ca521675bac24696e4cb82fe7d0b0f8b23c Mon Sep 17 00:00:00 2001 From: Daniel M German Date: Fri, 9 Aug 2024 15:37:00 -0700 Subject: [PATCH] Fixed documentation strings 3 --- Source/CountDown.spoon/init.lua | 42 +++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/Source/CountDown.spoon/init.lua b/Source/CountDown.spoon/init.lua index f4c1f0e3..e97b453f 100644 --- a/Source/CountDown.spoon/init.lua +++ b/Source/CountDown.spoon/init.lua @@ -2,6 +2,8 @@ --- --- Countdown with visual indicator --- +--- Download: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/CountDown.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/CountDown.spoon.zip) +--- local obj = {} obj.__index = obj @@ -9,8 +11,7 @@ obj.__index = obj -- Metadata obj.name = "CountDown" obj.version = "2" -obj.author = "ashfinal and Daniel Marques " .. - " and Omar El-Domeiri and Daniel German " +obj.author = "ashfinal and Daniel Marques and Omar El-Domeiri and Daniel German " obj.homepage = "https://github.com/Hammerspoon/Spoons" obj.license = "MIT - https://opensource.org/licenses/MIT" @@ -27,12 +28,12 @@ obj.license = "MIT - https://opensource.org/licenses/MIT" --- CountDown.defaultLenMinutes --- Variable ---- Default timer in minutes. +--- Default timer in minutes. obj.defaultLenMinutes = 25 --- CountDown.useLastTimerAsDefault --- Variable ---- if true, make defaultLenMinutes the last time length used +--- if true, make defaultLenMinutes the last time length used obj.useLastTimerAsDefault = true --- CountDown.nofity @@ -42,43 +43,44 @@ obj.notify = true --- CountDown.defaultKeyBindings --- Variable ---- default key bindings +--- default key bindings obj.defaultKeyBindings = { startFor = {{"cmd", "ctrl", "alt"}, "T"}, startInteractive = {{"cmd", "ctrl", "alt", "shift"}, "T"}, pauseOrResume = {{"cmd", "ctrl", "alt"}, "P"}, - cancel = {{"cmd", "ctrl", "alt"}, "C"}, + cancel = {{"cmd", "ctrl", "alt"}, "C"} } --- CountDown.messageDuration --- Variable --- Duration of notification messages +--- Duration of notification messages obj.messageDuration = 2 + --- CountDown.messageAttributes --- Variable --- Properties of progress message +--- Properties of progress message obj.messageAttributes = {atScreenEdge = 0, textSize = 40} -- bar: progress bar at the bottom of the screen --- CountDown.barCanvasHeight --- Variable ---- indicator bar at the bottom of the screen +--- indicator bar at the bottom of the screen obj.barCanvasHeight = 5 --- CountDown.barTransparency --- Variable ---- Transparency for progress bar +--- Transparency for progress bar obj.barTransparency = 0.8 --- CountDown.barFillColorPassed --- Variable ---- Color for time passed in progress bar +--- Color for time passed in progress bar obj.barFillColorPassed = hs.drawing.color.osx_green --- CountDown.barFillColorToPass --- Variable ---- Color for time to pass in progress bar +--- Color for time to pass in progress bar obj.barFillColorToPass = hs.drawing.color.osx_red -- alert: what happens when the timer is up? @@ -148,7 +150,7 @@ obj.menuBarIconPause = "⏸️" --- icon for cancelling timer in menu bar submenu obj.menuBarIconStop = "🛑" --------- state variables +-- state variables obj.barTimer= nil -- timerRunning true if current timer running @@ -172,7 +174,6 @@ obj.menuBar = nil obj.barProgress = 0 obj.barCanvas = nil - -- events -- callback when timer is up @@ -504,10 +505,10 @@ function obj:create_tick_timer() 1) end -- API ------------------------------- +-- API ------------------------------- ---- CountDown:startFor(minutes) +--- CountDown:startFor(minutes, callback) --- Method --- Start a countdown for `minutes` minutes immediately. Calling this method again will kill the existing countdown instance. --- @@ -570,7 +571,7 @@ function obj:startFor(minutes, callback) return self end ---- CountDown:startUntil(time) +--- CountDown:startUntil(time, callback) --- Method --- Start a countdown until time indicated in parameter. --- @@ -683,6 +684,11 @@ end --- CountDown:cancel() --- Method --- Reset the timer +--- +--- Parameters: +--- * None +--- Returns: +--- * None function obj:cancel() if obj.timerRunning then local minLeft = obj.timeLeft/60 @@ -697,7 +703,7 @@ function obj:cancel() end end ---- CountDown:bindHotkeys() +--- CountDown:bindHotkeys(mapping) --- Method --- Bind hotkeys for this spoon ---