Skip to content

Commit

Permalink
Fixed documentation strings 3
Browse files Browse the repository at this point in the history
  • Loading branch information
gitmsr committed Aug 9, 2024
1 parent aeba38e commit 59380ca
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions Source/CountDown.spoon/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
---
--- 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

-- Metadata
obj.name = "CountDown"
obj.version = "2"
obj.author = "ashfinal <[email protected]> and Daniel Marques <[email protected]>" ..
" and Omar El-Domeiri <[email protected]> and Daniel German <[email protected]>"
obj.author = "ashfinal <[email protected]> and Daniel Marques <[email protected]> and Omar El-Domeiri <[email protected]> and Daniel German <[email protected]>"
obj.homepage = "https://github.com/Hammerspoon/Spoons"
obj.license = "MIT - https://opensource.org/licenses/MIT"

Expand All @@ -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
Expand All @@ -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?
Expand Down Expand 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
Expand All @@ -172,7 +174,6 @@ obj.menuBar = nil
obj.barProgress = 0
obj.barCanvas = nil


-- events

-- callback when timer is up
Expand Down Expand 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.
---
Expand Down Expand Up @@ -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.
---
Expand Down Expand Up @@ -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
Expand All @@ -697,7 +703,7 @@ function obj:cancel()
end
end

--- CountDown:bindHotkeys()
--- CountDown:bindHotkeys(mapping)
--- Method
--- Bind hotkeys for this spoon
---
Expand Down

0 comments on commit 59380ca

Please sign in to comment.