Skip to content

Commit 35a52e1

Browse files
authored
Merge pull request #1752 from sewbacca/feature/love2d-meta-links
Added links to all love2d functions in documentation
2 parents 2dab40c + 608a0c8 commit 35a52e1

20 files changed

+3184
-25
lines changed

meta/3rd/love2d/library/love/audio.lua

+258
Large diffs are not rendered by default.

meta/3rd/love2d/library/love/data.lua

+54
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
---
44
---Provides functionality for creating and transforming data.
55
---
6+
---
7+
---[Open in Browser](https://love2d.org/wiki/love.data)
8+
---
69
---@class love.data
710
love.data = {}
811

912
---
1013
---Compresses a string or data using a specific compression algorithm.
1114
---
15+
---
16+
---[Open in Browser](https://love2d.org/wiki/love.data.compress)
17+
---
1218
---@overload fun(container: love.ContainerType, format: love.CompressedDataFormat, data: love.Data, level?: number):love.CompressedData|string
1319
---@param container love.ContainerType # What type to return the compressed data as.
1420
---@param format love.CompressedDataFormat # The format to use when compressing the string.
@@ -20,6 +26,9 @@ function love.data.compress(container, format, rawstring, level) end
2026
---
2127
---Decode Data or a string from any of the EncodeFormats to Data or string.
2228
---
29+
---
30+
---[Open in Browser](https://love2d.org/wiki/love.data.decode)
31+
---
2332
---@overload fun(container: love.ContainerType, format: love.EncodeFormat, sourceData: love.Data):love.ByteData|string
2433
---@param container love.ContainerType # What type to return the decoded data as.
2534
---@param format love.EncodeFormat # The format of the input data.
@@ -30,6 +39,9 @@ function love.data.decode(container, format, sourceString) end
3039
---
3140
---Decompresses a CompressedData or previously compressed string or Data object.
3241
---
42+
---
43+
---[Open in Browser](https://love2d.org/wiki/love.data.decompress)
44+
---
3345
---@overload fun(container: love.ContainerType, format: love.CompressedDataFormat, compressedString: string):love.Data|string
3446
---@overload fun(container: love.ContainerType, format: love.CompressedDataFormat, data: love.Data):love.Data|string
3547
---@param container love.ContainerType # What type to return the decompressed data as.
@@ -40,6 +52,9 @@ function love.data.decompress(container, compressedData) end
4052
---
4153
---Encode Data or a string to a Data or string in one of the EncodeFormats.
4254
---
55+
---
56+
---[Open in Browser](https://love2d.org/wiki/love.data.encode)
57+
---
4358
---@overload fun(container: love.ContainerType, format: love.EncodeFormat, sourceData: love.Data, linelength?: number):love.ByteData|string
4459
---@param container love.ContainerType # What type to return the encoded data as.
4560
---@param format love.EncodeFormat # The format of the output data.
@@ -53,13 +68,19 @@ function love.data.encode(container, format, sourceString, linelength) end
5368
---
5469
---This function behaves the same as Lua 5.3's string.packsize.
5570
---
71+
---
72+
---[Open in Browser](https://love2d.org/wiki/love.data.getPackedSize)
73+
---
5674
---@param format string # A string determining how the values are packed. Follows the rules of Lua 5.3's string.pack format strings.
5775
---@return number size # The size in bytes that the packed data will use.
5876
function love.data.getPackedSize(format) end
5977

6078
---
6179
---Compute the message digest of a string using a specified hash algorithm.
6280
---
81+
---
82+
---[Open in Browser](https://love2d.org/wiki/love.data.hash)
83+
---
6384
---@overload fun(hashFunction: love.HashFunction, data: love.Data):string
6485
---@param hashFunction love.HashFunction # Hash algorithm to use.
6586
---@param string string # String to hash.
@@ -71,6 +92,9 @@ function love.data.hash(hashFunction, string) end
7192
---
7293
---Data:getPointer along with LuaJIT's FFI can be used to manipulate the contents of the ByteData object after it has been created.
7394
---
95+
---
96+
---[Open in Browser](https://love2d.org/wiki/love.data.newByteData)
97+
---
7498
---@overload fun(Data: love.Data, offset?: number, size?: number):love.ByteData
7599
---@overload fun(size: number):love.ByteData
76100
---@param datastring string # The byte string to copy.
@@ -80,6 +104,9 @@ function love.data.newByteData(datastring) end
80104
---
81105
---Creates a new Data referencing a subsection of an existing Data object.
82106
---
107+
---
108+
---[Open in Browser](https://love2d.org/wiki/love.data.newDataView)
109+
---
83110
---@param data love.Data # The Data object to reference.
84111
---@param offset number # The offset of the subsection to reference, in bytes.
85112
---@param size number # The size in bytes of the subsection to reference.
@@ -91,6 +118,9 @@ function love.data.newDataView(data, offset, size) end
91118
---
92119
---This function behaves the same as Lua 5.3's string.pack.
93120
---
121+
---
122+
---[Open in Browser](https://love2d.org/wiki/love.data.pack)
123+
---
94124
---@param container love.ContainerType # What type to return the encoded data as.
95125
---@param format string # A string determining how the values are packed. Follows the rules of Lua 5.3's string.pack format strings.
96126
---@param v1 number|boolean|string # The first value (number, boolean, or string) to serialize.
@@ -103,6 +133,9 @@ function love.data.pack(container, format, v1, ...) end
103133
---
104134
---This function behaves the same as Lua 5.3's string.unpack.
105135
---
136+
---
137+
---[Open in Browser](https://love2d.org/wiki/love.data.unpack)
138+
---
106139
---@overload fun(format: string, data: love.Data, pos?: number):number|boolean|string, number|boolean|string, number
107140
---@param format string # A string determining how the values were packed. Follows the rules of Lua 5.3's string.pack format strings.
108141
---@param datastring string # A string containing the packed (serialized) data.
@@ -116,6 +149,9 @@ function love.data.unpack(format, datastring, pos) end
116149
---
117150
---There are currently no LÖVE functions provided for manipulating the contents of a ByteData, but Data:getPointer can be used with LuaJIT's FFI to access and write to the contents directly.
118151
---
152+
---
153+
---[Open in Browser](https://love2d.org/wiki/love.data)
154+
---
119155
---@class love.ByteData: love.Object, love.Data
120156
local ByteData = {}
121157

@@ -124,18 +160,27 @@ local ByteData = {}
124160
---
125161
---love.data.decompress can be used to de-compress the data (or love.math.decompress in 0.10.2 or earlier).
126162
---
163+
---
164+
---[Open in Browser](https://love2d.org/wiki/love.data)
165+
---
127166
---@class love.CompressedData: love.Data, love.Object
128167
local CompressedData = {}
129168

130169
---
131170
---Gets the compression format of the CompressedData.
132171
---
172+
---
173+
---[Open in Browser](https://love2d.org/wiki/CompressedData:getFormat)
174+
---
133175
---@return love.CompressedDataFormat format # The format of the CompressedData.
134176
function CompressedData:getFormat() end
135177

136178
---
137179
---Compressed data formats.
138180
---
181+
---
182+
---[Open in Browser](https://love2d.org/wiki/CompressedDataFormat)
183+
---
139184
---@alias love.CompressedDataFormat
140185
---
141186
---The LZ4 compression format. Compresses and decompresses very quickly, but the compression ratio is not the best. LZ4-HC is used when compression level 9 is specified. Some benchmarks are available here.
@@ -157,6 +202,9 @@ function CompressedData:getFormat() end
157202
---
158203
---Return type of various data-returning functions.
159204
---
205+
---
206+
---[Open in Browser](https://love2d.org/wiki/ContainerType)
207+
---
160208
---@alias love.ContainerType
161209
---
162210
---Return type is ByteData.
@@ -170,6 +218,9 @@ function CompressedData:getFormat() end
170218
---
171219
---Encoding format used to encode or decode data.
172220
---
221+
---
222+
---[Open in Browser](https://love2d.org/wiki/EncodeFormat)
223+
---
173224
---@alias love.EncodeFormat
174225
---
175226
---Encode/decode data as base64 binary-to-text encoding.
@@ -183,6 +234,9 @@ function CompressedData:getFormat() end
183234
---
184235
---Hash algorithm of love.data.hash.
185236
---
237+
---
238+
---[Open in Browser](https://love2d.org/wiki/HashFunction)
239+
---
186240
---@alias love.HashFunction
187241
---
188242
---MD5 hash algorithm (16 bytes).

meta/3rd/love2d/library/love/event.lua

+24
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,26 @@
33
---
44
---Manages events, like keypresses.
55
---
6+
---
7+
---[Open in Browser](https://love2d.org/wiki/love.event)
8+
---
69
---@class love.event
710
love.event = {}
811

912
---
1013
---Clears the event queue.
1114
---
15+
---
16+
---[Open in Browser](https://love2d.org/wiki/love.event.clear)
17+
---
1218
function love.event.clear() end
1319

1420
---
1521
---Returns an iterator for messages in the event queue.
1622
---
23+
---
24+
---[Open in Browser](https://love2d.org/wiki/love.event.poll)
25+
---
1726
---@return function i # Iterator function usable in a for loop.
1827
function love.event.poll() end
1928

@@ -26,13 +35,19 @@ function love.event.poll() end
2635
---
2736
---and if you want to handle OS-generated events at all (think callbacks).
2837
---
38+
---
39+
---[Open in Browser](https://love2d.org/wiki/love.event.pump)
40+
---
2941
function love.event.pump() end
3042

3143
---
3244
---Adds an event to the event queue.
3345
---
3446
---From 0.10.0 onwards, you may pass an arbitrary amount of arguments with this function, though the default callbacks don't ever use more than six.
3547
---
48+
---
49+
---[Open in Browser](https://love2d.org/wiki/love.event.push)
50+
---
3651
---@param n love.Event # The name of the event.
3752
---@param a? any # First event argument.
3853
---@param b? any # Second event argument.
@@ -48,13 +63,19 @@ function love.event.push(n, a, b, c, d, e, f, ...) end
4863
---
4964
---The quit event is a signal for the event handler to close LÖVE. It's possible to abort the exit process with the love.quit callback.
5065
---
66+
---
67+
---[Open in Browser](https://love2d.org/wiki/love.event.quit)
68+
---
5169
---@overload fun('restart': string|'restart')
5270
---@param exitstatus? number # The program exit status to use when closing the application.
5371
function love.event.quit(exitstatus) end
5472

5573
---
5674
---Like love.event.poll(), but blocks until there is an event in the queue.
5775
---
76+
---
77+
---[Open in Browser](https://love2d.org/wiki/love.event.wait)
78+
---
5879
---@return love.Event n # The name of event.
5980
---@return any a # First event argument.
6081
---@return any b # Second event argument.
@@ -69,6 +90,9 @@ function love.event.wait() end
6990
---
7091
---Since 0.8.0, event names are no longer abbreviated.
7192
---
93+
---
94+
---[Open in Browser](https://love2d.org/wiki/Event)
95+
---
7296
---@alias love.Event
7397
---
7498
---Window focus gained or lost

0 commit comments

Comments
 (0)