Skip to content

Commit 0223803

Browse files
authored
Merge pull request #192 from evo-lua/add-since-props
Add availability data to the existing API references
2 parents 4506a35 + a7dd453 commit 0223803

File tree

13 files changed

+108
-105
lines changed

13 files changed

+108
-105
lines changed

docs/references/api/bindings/json.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ All of the [lua-rapidjson](https://github.com/xpol/lua-rapidjson/blob/master/API
2222

2323
Returns the embedded rapidjson library version as a Lua string. The lua-rapidjson (bindings) version can be queried via `_VERSION`.
2424

25-
<Function>
25+
<Function since="v0.0.3">
2626
<Returns>
2727
<Return name="rapidjsonLibraryVersion" type="string"/>
2828
</Returns>
@@ -32,7 +32,7 @@ Returns the embedded rapidjson library version as a Lua string. The lua-rapidjso
3232

3333
Parses the given input as a JSON string and returns a Lua table containing the equivalent data. Alias for `json.decode(...)`.
3434

35-
<Function>
35+
<Function since="v0.0.3">
3636
<Parameters>
3737
<Parameter name="jsonString" type="string"/>
3838
</Parameters>
@@ -45,7 +45,7 @@ Parses the given input as a JSON string and returns a Lua table containing the e
4545

4646
Converts the given input table to a JSON string containing the equivalent data. Alias for `json.encode(...)`.
4747

48-
<Function>
48+
<Function since="v0.0.3">
4949
<Parameters>
5050
<Parameter name="luaTable" type="table"/>
5151
</Parameters>
@@ -58,7 +58,7 @@ Converts the given input table to a JSON string containing the equivalent data.
5858

5959
Identical to `json.encode(...)`, but accepts both strings and tables. Returns a human-readable JSON string with indentation and key sorting enabled. Indentation uses four spaces (lua-rapidjson default). You probably don't want to use this for performance-critical code.
6060

61-
<Function>
61+
<Function since="v0.0.3">
6262
<Parameters>
6363
<Parameter name="jsonStringOrTable"/>
6464
</Parameters>
@@ -71,7 +71,7 @@ Identical to `json.encode(...)`, but accepts both strings and tables. Returns a
7171

7272
Identical to `json.pretty`, but uses tabs for indentation (instead of four spaces). This saves some space, but is still unsuitable for performance-critical code paths due to the overhead of sorting and possibly redundantly re-encoding the provided string value.
7373

74-
<Function>
74+
<Function since="v0.0.3">
7575
<Parameters>
7676
<Parameter name="jsonStringOrTable"/>
7777
</Parameters>

docs/references/api/bindings/miniz.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Most of the time, you'll want to pass `"no"` or `"finish"` for asynchronous and
5454

5555
:::
5656

57-
<Function>
57+
<Function since="v0.0.5">
5858
<Parameters>
5959
<Parameter name="self" type="Deflator"/>
6060
<Parameter name="input" type="string"/>
@@ -73,7 +73,7 @@ Created by [new_inflator](#new_inflator). You can use this to decompress large a
7373

7474
Applies [INFLATE](https://en.wikipedia.org/wiki/Deflate#Decoder/decompressor) to the given (DEFLATE-compressed) `input` and returns the decompressed bytes as a Lua string.
7575

76-
<Function>
76+
<Function since="v0.0.5">
7777
<Parameters>
7878
<Parameter name="self" type="Inflator"/>
7979
<Parameter name="input" type="string"/>
@@ -91,7 +91,7 @@ Created by [new_reader](#new_reader) or [new_reader_memory](#new_reader_memory).
9191

9292
Extracts the file referenced by the given `fileTableIndex` and returns the file contents (or `""` on failure). The `flags` are passed to `miniz` directly. Since the extraction happens entirely in memory, this method may not be well-suited for extracting very large files.
9393

94-
<Function>
94+
<Function since="v0.0.5">
9595
<Parameters>
9696
<Parameter name="self" type="ZipFileReader"/>
9797
<Parameter name="fileTableIndex" type="number"/>
@@ -105,7 +105,7 @@ Extracts the file referenced by the given `fileTableIndex` and returns the file
105105

106106
Returns the file name referenced by the given `fileTableIndex`, or `nil` and an error message if the given index was invalid.
107107

108-
<Function>
108+
<Function since="v0.0.5">
109109
<Parameters>
110110
<Parameter name="self" type="ZipFileReader"/>
111111
<Parameter name="fileTableIndex" type="number"/>
@@ -120,7 +120,7 @@ Returns the file name referenced by the given `fileTableIndex`, or `nil` and an
120120

121121
Returns the total number of files within the ZIP archive. This is the maximum `fileTableIndex` that you can pass to other functions.
122122

123-
<Function>
123+
<Function since="v0.0.5">
124124
<Parameters>
125125
<Parameter name="self" type="ZipFileReader"/>
126126
</Parameters>
@@ -139,7 +139,7 @@ This offset is likely zero for normal archives, but the file format allows stori
139139

140140
:::
141141

142-
<Function>
142+
<Function since="v0.0.5">
143143
<Parameters>
144144
<Parameter name="self" type="ZipFileReader"/>
145145
</Parameters>
@@ -152,7 +152,7 @@ This offset is likely zero for normal archives, but the file format allows stori
152152

153153
Returns `true` if the entry referenced by the given `fileTableIndex` is a directory entry, and `false` otherwise.
154154

155-
<Function>
155+
<Function since="v0.0.5">
156156
<Parameters>
157157
<Parameter name="self" type="ZipFileReader"/>
158158
<Parameter name="fileTableIndex" type="number"/>
@@ -166,7 +166,7 @@ Returns `true` if the entry referenced by the given `fileTableIndex` is a direct
166166

167167
Searches the internal file system table of the given ZIP archive for an entry that matches `fileSystemPath` and returns the corresponding `fileTableIndex`, or `nil` and an error message if no match was found. It uses a simple linear search method that might have to iterate over the entire table, which is slow for very large files. The `flags` passed to `miniz` can control the way that the search is performed.
168168

169-
<Function>
169+
<Function since="v0.0.5">
170170
<Parameters>
171171
<Parameter name="fileSystemPath" type="string"/>
172172
<Parameter name="flags" type="number" optional/>
@@ -180,7 +180,7 @@ Searches the internal file system table of the given ZIP archive for an entry th
180180

181181
Returns a list of attributes for the entry referenced by the given `fileTableIndex`, or `nil` and an error message if the index was invalid.
182182

183-
<Function>
183+
<Function since="v0.0.5">
184184
<Parameters>
185185
<Parameter name="self" type="ZipFileReader"/>
186186
<Parameter name="fileTableIndex" type="number"/>
@@ -215,7 +215,7 @@ Created by [new_writer](#new_writer). You can use this to add files to a ZIP arc
215215

216216
Adds (in-memory) a new file entry referenced by `fileSystemPath` with the given `fileContents` to the archive. The `flags` passed to `miniz` control the compression level and settings for this specific entry; it's a bitfield with the level being stored in the lowest byte.
217217

218-
<Function>
218+
<Function since="v0.0.5">
219219
<Parameters>
220220
<Parameter name="self" type="ZipFileWriter"/>
221221
<Parameter name="fileSystemPath" type="string"/>
@@ -227,7 +227,7 @@ Adds (in-memory) a new file entry referenced by `fileSystemPath` with the given
227227

228228
Adds (in-memory) the contents of the entry referenced by the given `fileTableIndex` from another ZIP archive to the archive.
229229

230-
<Function>
230+
<Function since="v0.0.5">
231231
<Parameters>
232232
<Parameter name="self" type="ZipFileWriter"/>
233233
<Parameter name="reader" type="ZipFileReader"/>
@@ -245,7 +245,7 @@ Once the archive has been finalized, you can no longer add new entries to it. Yo
245245

246246
:::
247247

248-
<Function>
248+
<Function since="v0.0.5">
249249
<Parameters>
250250
<Parameter name="self" type="ZipFileWriter"/>
251251
</Parameters>
@@ -260,7 +260,7 @@ Once the archive has been finalized, you can no longer add new entries to it. Yo
260260

261261
Returns the [Adler-32](https://en.wikipedia.org/wiki/Adler-32) checksum for the given `input`. Supplying an `initialValue` allows processing multiple chunks as they arrive.
262262

263-
<Function>
263+
<Function since="v0.0.5">
264264
<Parameters>
265265
<Parameter name="input" type="string"/>
266266
<Parameter name="initialValue" type="string" optional/>
@@ -274,7 +274,7 @@ Returns the [Adler-32](https://en.wikipedia.org/wiki/Adler-32) checksum for the
274274

275275
Returns the [CRC-32](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) checksum for the given `input`. Supplying an `initialValue` allows processing multiple chunks as they arrive.
276276

277-
<Function>
277+
<Function since="v0.0.5">
278278
<Parameters>
279279
<Parameter name="input" type="string"/>
280280
<Parameter name="initialValue" type="string" optional/>
@@ -300,7 +300,7 @@ While you don't need to worry about buffer allocation with either of these, the
300300

301301
:::
302302

303-
<Function>
303+
<Function since="v0.0.5">
304304
<Parameters>
305305
<Parameter name="input" type="string"/>
306306
<Parameter name="compressionLevel" type="number" optional/>
@@ -316,7 +316,7 @@ Applies [DEFLATE](https://en.wikipedia.org/wiki/Deflate) to the given `input` an
316316

317317
The `flags` passed to `miniz` control the behavior of the compressor.
318318

319-
<Function>
319+
<Function since="v0.0.5">
320320
<Parameters>
321321
<Parameter name="input" type="string"/>
322322
<Parameter name="flags" type="number" optional/>
@@ -332,7 +332,7 @@ Applies [INFLATE](https://en.wikipedia.org/wiki/Deflate#Decoder/decompressor) to
332332

333333
The `flags` passed to `miniz` control the behavior of the decompressor.
334334

335-
<Function>
335+
<Function since="v0.0.5">
336336
<Parameters>
337337
<Parameter name="input" type="string"/>
338338
<Parameter name="flags" type="number" optional/>
@@ -346,7 +346,7 @@ The `flags` passed to `miniz` control the behavior of the decompressor.
346346

347347
Returns the last compression or decompression error (as a human-readable string) if any was encountered, or `nil` otherwise.
348348

349-
<Function>
349+
<Function since="v0.0.5">
350350
<Returns>
351351
<Return name="errorString" type="string" optional/>
352352
</Returns>
@@ -356,7 +356,7 @@ Returns the last compression or decompression error (as a human-readable string)
356356

357357
Creates a new [Deflator](#deflator) object and returns a `userdata` reference to it. If you set `compressionLevel`, it must be a valid value (0 to 9).
358358

359-
<Function>
359+
<Function since="v0.0.5">
360360
<Parameters>
361361
<Parameter name="compressionLevel" type="number" optional/>
362362
</Parameters>
@@ -369,7 +369,7 @@ Creates a new [Deflator](#deflator) object and returns a `userdata` reference to
369369

370370
Creates a new [Inflator](#inflator) object and returns a `userdata` reference to it.
371371

372-
<Function>
372+
<Function since="v0.0.5">
373373
<Returns>
374374
<Return name="inflator" type="Inflator"/>
375375
</Returns>
@@ -385,7 +385,7 @@ This function is suitable if loading the entire file into memory is acceptable.
385385

386386
Returns `nil` and an error message in case of failure. Otherwise the ZIP [reader](#ZipFileReader) should be ready to use.
387387

388-
<Function>
388+
<Function since="v0.0.5">
389389
<Parameters>
390390
<Parameter name="fileSystemPath" type="string"/>
391391
<Parameter name="flags" type="number" optional/>
@@ -406,7 +406,7 @@ This function is suitable if loading the entire file into memory is acceptable.
406406

407407
Returns `nil` and an error message in case of failure. Otherwise the ZIP [reader](#ZipFileReader) should be ready to use.
408408

409-
<Function>
409+
<Function since="v0.0.20">
410410
<Parameters>
411411
<Parameter name="fileContents" type="string"/>
412412
<Parameter name="flags" type="number" optional/>
@@ -421,7 +421,7 @@ Returns `nil` and an error message in case of failure. Otherwise the ZIP [reader
421421

422422
Creates a new ZIP file writer for the given `fileSystemPath`. The `flags` passed to `miniz` can control the way that the archive is written.
423423

424-
<Function>
424+
<Function since="v0.0.5">
425425
<Parameters>
426426
<Parameter name="fileSystemPath" type="string"/>
427427
<Parameter name="flags" type="number" optional/>
@@ -449,7 +449,7 @@ While you don't need to worry about buffer allocation with either of these, the
449449

450450
:::
451451

452-
<Function>
452+
<Function since="v0.0.5">
453453
<Parameters>
454454
<Parameter name="input" type="string"/>
455455
<Parameter name="initialOutputBufferSize" type="number" optional/>
@@ -463,7 +463,7 @@ While you don't need to worry about buffer allocation with either of these, the
463463

464464
Returns the version number of the embedded `miniz` library as a Lua string.
465465

466-
<Function>
466+
<Function since="v0.0.5">
467467
<Returns>
468468
<Return name="version" type="string"/>
469469
</Returns>

docs/references/api/bindings/stbi.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Replaces all pixels using the RGBA values from `sourceColor` with those from `re
3838

3939
The pixel format used by the given `image` is expected to be in RGBA format; use [stbi_load_rgba](#stbi_load_rgba) to ensure this is always the case.
4040

41-
<Function>
41+
<Function since="v0.0.19">
4242
<Parameters>
4343
<Parameter name="image" type="stbi_image_t"/>
4444
<Parameter name="sourceColor" type="stbi_color_t"/>
@@ -76,6 +76,8 @@ Converts the pixel format of an `image` from ABGR to RGBA (and vice versa), by s
7676
void stbi_abgr_to_rgba(stbi_image_t* image)
7777
```
7878
79+
<Function since="v0.0.10"/>
80+
7981
### stbi_flip_vertically_on_write
8082
8183
Globally toggles the vertical direction that is used when encoding images. A non-zero flag means that the pixel data is inverted.
@@ -252,6 +254,7 @@ const char* stbi_version(void);
252254

253255
| Version | What happened? |
254256
| :-----: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
257+
| v0.0.19 | Added `replace_pixel_color_rgba` |
255258
| v0.0.10 | Added `stbi_abgr_to_rgba` |
256259
| v0.0.9 | Removed `stbi_max_bitmap_size` in favor of `stbi_get_required_bmp_size`, `stbi_get_required_png_size`, `stbi_get_required_jpg_size`, and `stbi_get_required_tga_size` |
257260
| v0.0.7 | Added `stbi_flip_vertically_on_write` |

docs/references/api/extensions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ debug.dump({ 1, 2, 3 })
2424

2525
Prints a human-readable string representation of the given object. Mostly useful for dumping tables, but unsuitable for serialization purposes. The output format cannot be considered stable. Currently uses [inspect](/docs/references/api/bindings/inspect) internally, though this may change in the future.
2626

27-
<Function>
27+
<Function since="v0.0.1">
2828
<Parameters>
2929
<Parameter name="object"/>
3030
</Parameters>
@@ -39,7 +39,7 @@ Prints a human-readable string representation of the given object. Mostly useful
3939

4040
Returns a string representing the difference between `firstValue` and `secondValue`. The exact format is subject to change.
4141

42-
<Function>
42+
<Function since="v0.0.1">
4343
<Parameters>
4444
<Parameter name="firstValue" type="string"/>
4545
<Parameter name="firstValue" type="string"/>
@@ -53,7 +53,7 @@ Returns a string representing the difference between `firstValue` and `secondVal
5353

5454
Tokenizes the given `inputString` based on a configurable `delimiter` character, which is stripped from the output.
5555

56-
<Function>
56+
<Function since="v0.0.1">
5757
<Parameters>
5858
<Parameter name="inputString" type="string"/>
5959
<Parameter name="delimiter" type="string" optional fallback="'%s' (whitespace)"/>
@@ -67,7 +67,7 @@ Tokenizes the given `inputString` based on a configurable `delimiter` character,
6767

6868
Returns a human-readable representation of the given `fileSizeInBytes` using standard units. The exact format is subject to change.
6969

70-
<Function>
70+
<Function since="v0.0.2">
7171
<Parameters>
7272
<Parameter name="fileSizeInBytes" type="number"/>
7373
</Parameters>
@@ -82,7 +82,7 @@ Returns a human-readable representation of the given `fileSizeInBytes` using sta
8282

8383
Returns `true` if the given `table` contains `value` in the array part of the table, and `false` otherwise. The dictionary part is ignored.
8484

85-
<Function>
85+
<Function since="v0.0.1">
8686
<Parameters>
8787
<Parameter name="table" type="table"/>
8888
<Parameter name="value"/>

docs/references/api/globals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Alias for [debug.dump(...)](/docs/references/api/extensions#debugdump).
6767

6868
Sets up the metatable of `child` so that it acts as an instance of `parent` (in terms of [object-oriented programming](https://en.wikipedia.org/wiki/Object-oriented_programming)).
6969

70-
<Function>
70+
<Function since="v0.0.1">
7171
<Parameters>
7272
<Parameter name="parent" type="table"/>
7373
<Parameter name="child" type="table"/>

0 commit comments

Comments
 (0)