Skip to content

Commit

Permalink
ci: update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed May 9, 2024
1 parent 754b7d8 commit 40e2612
Showing 1 changed file with 68 additions and 68 deletions.
136 changes: 68 additions & 68 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,41 @@ local _, namespace = ...
***

<!-- DOCSTART -->
### namespace:IsRetail()
### namespace:HookAddOn(_addonName_, _callback_)

Checks if the current client is running the "retail" version.
Registers a hook for when an addon with the name `addonName` loads with a `callback` function.

***

### namespace:IsClassic()
### namespace:OnLogin()

Checks if the current client is running the "classic" version.
Shorthand for the [`PLAYER_LOGIN`](https://warcraft.wiki.gg/wiki/PLAYER_LOGIN).

Usage:
```lua
function namespace:OnLogin()
-- player has logged in!
end
```

***

### namespace:RegisterSlash(_command_[, _commandN,..._], _callback_)

Registers chat slash `command`(s) with a `callback` function.

Usage:
```lua
namespace:RegisterSlash('/hello', '/hi', function(input)
print('Hi')
end)
```

***

### namespace:IsRetail()

Checks if the current client is running the "retail" version.

***

Expand All @@ -36,6 +62,12 @@ Checks if the current client is running the "classic era" version (e.g. vanilla)

***

### namespace:IsClassic()

Checks if the current client is running the "classic" version.

***

### namespace:Hide(_object_[, _child_,...])

Forcefully hide an `object`, or its `child`.
Expand Down Expand Up @@ -91,38 +123,6 @@ Returns the aura by `spellID` on the [`unit`](https://warcraft.wiki.gg/wiki/Unit

***

### namespace:HookAddOn(_addonName_, _callback_)

Registers a hook for when an addon with the name `addonName` loads with a `callback` function.

***

### namespace:OnLogin()

Shorthand for the [`PLAYER_LOGIN`](https://warcraft.wiki.gg/wiki/PLAYER_LOGIN).

Usage:
```lua
function namespace:OnLogin()
-- player has logged in!
end
```

***

### namespace:CreateFrame(_..._)

A wrapper for [`CreateFrame`](https://warcraft.wiki.gg/wiki/API_CreateFrame), mixed in with `namespace.eventMixin`.

***

### namespace:CreateButton(...)

A wrapper for `namespace:CreateFrame(...)`, but will handle key direction preferences of the client.
Use this specifically to create clickable buttons.

***

### namespace:Defer(_callback_[, _..._])

Defers a function `callback` (with optional arguments) until after combat ends.
Expand All @@ -137,30 +137,6 @@ Immediately triggers if player is not in combat.

***

### namespace:Print(_..._)

Prints out a message in the chat frame, prefixed with the addon name in color.

***

### namespace:Printf(_fmt_, _..._)

Wrapper for `namespace:Print(...)` and `string.format`.

***

### namespace:Dump(_object_[, _startKey_])

Wrapper for `DevTools_Dump`.

***

### namespace:DumpUI(_object_)

Similar to `namespace:Dump(object)`; a wrapper for the graphical version.

***

### namespace.L(_locale_)[`string`]

Sets a localization `string` for the given `locale`.
Expand All @@ -186,16 +162,27 @@ print(namespace.L['Unknown']) --> "Unknown" on all clients since there are no lo

***

### namespace:RegisterSlash(_command_[, _commandN,..._], _callback_)
### namespace:Print(_..._)

Registers chat slash `command`(s) with a `callback` function.
Prints out a message in the chat frame, prefixed with the addon name in color.

Usage:
```lua
namespace:RegisterSlash('/hello', '/hi', function(input)
print('Hi')
end)
```
***

### namespace:Printf(_fmt_, _..._)

Wrapper for `namespace:Print(...)` and `string.format`.

***

### namespace:Dump(_object_[, _startKey_])

Wrapper for `DevTools_Dump`.

***

### namespace:DumpUI(_object_)

Similar to `namespace:Dump(object)`; a wrapper for the graphical version.

***

Expand Down Expand Up @@ -318,6 +305,19 @@ namespace:BAG_UPDATE(1) -- triggers the above example

***

### namespace:CreateFrame(_..._)

A wrapper for [`CreateFrame`](https://warcraft.wiki.gg/wiki/API_CreateFrame), mixed in with `namespace.eventMixin`.

***

### namespace:CreateButton(...)

A wrapper for `namespace:CreateFrame(...)`, but will handle key direction preferences of the client.
Use this specifically to create clickable buttons.

***

### namespace:RegisterSettings(_savedvariables_, _settings_)

Registers a set of `settings` with the interface options panel.
Expand Down

0 comments on commit 40e2612

Please sign in to comment.