Skip to content

Commit dc4fa36

Browse files
committed
update API docs
1 parent 2c0f044 commit dc4fa36

File tree

111 files changed

+7788
-7331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+7788
-7331
lines changed

docs/API/builtins/any.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# any
2-
A type for a dynamic argument, it can be anything at run-time.
2+
> A type for a dynamic argument, it can be anything at run-time.
3+
4+
<!-- toc -->
5+
36

docs/API/builtins/boolean.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# boolean
2-
A built-in type representing a boolean (true or false) value, [see details](https://www.lua.org/pil/2.2.html)
2+
> A built-in type representing a boolean (true or false) value, [see details](https://www.lua.org/pil/2.2.html)
3+
4+
<!-- toc -->
5+
36

docs/API/builtins/function.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# function
2-
A built-in type representing functions, [see details](https://www.lua.org/pil/2.6.html)
2+
> A built-in type representing functions, [see details](https://www.lua.org/pil/2.6.html)
3+
4+
<!-- toc -->
5+
36

docs/API/builtins/integer.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# integer
2-
A helper type that represents whole numbers, a subset of [number](number.md)
2+
> A helper type that represents whole numbers, a subset of [number](number.md)
3+
4+
<!-- toc -->
5+
36

docs/API/builtins/lightuserdata.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# lightuserdata
2-
A built-in type representing a pointer, [see details](https://www.lua.org/pil/28.5.html)
2+
> A built-in type representing a pointer, [see details](https://www.lua.org/pil/28.5.html)
3+
4+
<!-- toc -->
5+
36

docs/API/builtins/nil.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# nil
2-
A built-in type representing a non-existant value, [see details](https://www.lua.org/pil/2.1.html). When you see `?` at the end of types, it means they can be nil.
2+
> A built-in type representing a non-existant value, [see details](https://www.lua.org/pil/2.1.html). When you see `?` at the end of types, it means they can be nil.
3+
4+
<!-- toc -->
5+
36

docs/API/builtins/number.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# number
2-
A built-in type representing floating point numbers, [see details](https://www.lua.org/pil/2.3.html)
2+
> A built-in type representing floating point numbers, [see details](https://www.lua.org/pil/2.3.html)
3+
4+
<!-- toc -->
5+
36

docs/API/builtins/self.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# self
2-
A type that represents an instance that you call a function on. When you see a function signature starting with this type, you should use `:` to call the function on the instance, this way you can omit this first argument.
3-
```lua
4-
local song = renoise.song()
5-
local first_pattern = song:pattern(1)
6-
```
2+
> A type that represents an instance that you call a function on. When you see a function signature starting with this type, you should use `:` to call the function on the instance, this way you can omit this first argument.
3+
> ```lua
4+
> local song = renoise.song()
5+
> local first_pattern = song:pattern(1)
6+
> ```
7+
8+
<!-- toc -->
9+
710

docs/API/builtins/string.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# string
2-
A built-in type representing a string of characters, [see details](https://www.lua.org/pil/2.4.html)
2+
> A built-in type representing a string of characters, [see details](https://www.lua.org/pil/2.4.html)
3+
4+
<!-- toc -->
5+
36

docs/API/builtins/table.md

Lines changed: 60 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,79 @@
11
# table
2-
A built-in type representing associative arrays, [see details](https://www.lua.org/pil/2.5.html)
2+
> A built-in type representing associative arrays, [see details](https://www.lua.org/pil/2.5.html)
3+
4+
<!-- toc -->
5+
36

47
---
58
## Functions
6-
### `clear`(t : [`table`](../../API/builtins/table.md)) {#clear}
7-
Recursively clears and removes all table elements.
8-
### `copy`(t : [`table`](../../API/builtins/table.md)) {#copy}
9+
### clear(t : [`table`](../../API/builtins/table.md)) {#clear}
10+
> Recursively clears and removes all table elements.
11+
### copy(t : [`table`](../../API/builtins/table.md)) {#copy}
912
`->`[`table`](../../API/builtins/table.md)
1013

11-
Copy the metatable and all first level elements of the given table into a
12-
new table. Use table.rcopy to do a recursive copy of all elements
13-
### `count`(t : [`table`](../../API/builtins/table.md)) {#count}
14-
Count the number of items of a table, also works for non index
15-
based tables (using pairs).
16-
### examples:
17-
```lua
18-
t = {["a"]=1, ["b"]=1}; print(table.count(t)) --> 2
19-
```
20-
### `create`(t : [`table`](../../API/builtins/table.md)[`?`](../../API/builtins/nil.md)) {#create}
14+
> Copy the metatable and all first level elements of the given table into a
15+
> new table. Use table.rcopy to do a recursive copy of all elements
16+
### count(t : [`table`](../../API/builtins/table.md)) {#count}
17+
> Count the number of items of a table, also works for non index
18+
> based tables (using pairs).
19+
> #### examples:
20+
> ```lua
21+
> t = {["a"]=1, ["b"]=1}; print(table.count(t)) --> 2
22+
> ```
23+
### create(t : [`table`](../../API/builtins/table.md)[`?`](../../API/builtins/nil.md)) {#create}
2124
`->`[`table`](../../API/builtins/table.md) | tablelib
2225
23-
Create a new, or convert an exiting table to an object that uses the global
24-
'table.XXX' functions as methods, just like strings in Lua do.
25-
### examples:
26-
```lua
27-
t = table.create(); t:insert("a"); rprint(t) -> [1] = a;
28-
t = table.create{1,2,3}; print(t:concat("|")); -> "1|2|3";
29-
```
30-
### `find`(t : [`table`](../../API/builtins/table.md), value : [`any`](../../API/builtins/any.md), start_index : [`integer`](../../API/builtins/integer.md)[`?`](../../API/builtins/nil.md)) {#find}
26+
> Create a new, or convert an exiting table to an object that uses the global
27+
> 'table.XXX' functions as methods, just like strings in Lua do.
28+
> #### examples:
29+
> ```lua
30+
> t = table.create(); t:insert("a"); rprint(t) -> [1] = a;
31+
> t = table.create{1,2,3}; print(t:concat("|")); -> "1|2|3";
32+
> ```
33+
### find(t : [`table`](../../API/builtins/table.md), value : [`any`](../../API/builtins/any.md), start_index : [`integer`](../../API/builtins/integer.md)[`?`](../../API/builtins/nil.md)) {#find}
3134
`->`key_or_nil : [`string`](../../API/builtins/string.md) | [`number`](../../API/builtins/number.md)[`?`](../../API/builtins/nil.md)
3235
33-
Find first match of *value* in the given table, starting from element
34-
number *start_index*.<br>
35-
Returns the first *key* that matches the value or nil
36-
### examples:
37-
```lua
38-
t = {"a", "b"}; table.find(t, "a") --> 1
39-
t = {a=1, b=2}; table.find(t, 2) --> "b"
40-
t = {"a", "b", "a"}; table.find(t, "a", 2) --> "3"
41-
t = {"a", "b"}; table.find(t, "c") --> nil
42-
```
43-
### `is_empty`(t : [`table`](../../API/builtins/table.md)) {#is_empty}
36+
> Find first match of *value* in the given table, starting from element
37+
> number *start_index*.<br>
38+
> Returns the first *key* that matches the value or nil
39+
> #### examples:
40+
> ```lua
41+
> t = {"a", "b"}; table.find(t, "a") --> 1
42+
> t = {a=1, b=2}; table.find(t, 2) --> "b"
43+
> t = {"a", "b", "a"}; table.find(t, "a", 2) --> "3"
44+
> t = {"a", "b"}; table.find(t, "c") --> nil
45+
> ```
46+
### is_empty(t : [`table`](../../API/builtins/table.md)) {#is_empty}
4447
`->`[`boolean`](../../API/builtins/boolean.md)
4548
46-
Returns true when the table is empty, else false and will also work
47-
for non indexed tables
48-
### examples:
49-
```lua
50-
t = {}; print(table.is_empty(t)); -> true;
51-
t = {66}; print(table.is_empty(t)); -> false;
52-
t = {["a"] = 1}; print(table.is_empty(t)); -> false;
53-
### `keys`(t : [`table`](../../API/builtins/table.md)) {#keys}
49+
> Returns true when the table is empty, else false and will also work
50+
> for non indexed tables
51+
> #### examples:
52+
> ```lua
53+
> t = {}; print(table.is_empty(t)); -> true;
54+
> t = {66}; print(table.is_empty(t)); -> false;
55+
> t = {["a"] = 1}; print(table.is_empty(t)); -> false;
56+
### keys(t : [`table`](../../API/builtins/table.md)) {#keys}
5457
`->`[`table`](../../API/builtins/table.md)
5558
56-
Return an indexed table of all keys that are used in the table.
57-
### examples:
58-
```lua
59-
t = {a="aa", b="bb"}; rprint(table.keys(t)); --> "a", "b"
60-
t = {"a", "b"}; rprint(table.keys(t)); --> 1, 2
61-
```
62-
### `rcopy`(t : [`table`](../../API/builtins/table.md)) {#rcopy}
59+
> Return an indexed table of all keys that are used in the table.
60+
> #### examples:
61+
> ```lua
62+
> t = {a="aa", b="bb"}; rprint(table.keys(t)); --> "a", "b"
63+
> t = {"a", "b"}; rprint(table.keys(t)); --> 1, 2
64+
> ```
65+
### rcopy(t : [`table`](../../API/builtins/table.md)) {#rcopy}
6366
`->`[`table`](../../API/builtins/table.md)
6467
65-
Deeply copy the metatable and all elements of the given table recursively
66-
into a new table - create a clone with unique references.
67-
### `values`(t : [`table`](../../API/builtins/table.md)) {#values}
68+
> Deeply copy the metatable and all elements of the given table recursively
69+
> into a new table - create a clone with unique references.
70+
### values(t : [`table`](../../API/builtins/table.md)) {#values}
6871
`->`[`table`](../../API/builtins/table.md)
6972
70-
Return an indexed table of all values that are used in the table
71-
### examples:
72-
```lua
73-
t = {a="aa", b="bb"}; rprint(table.values(t)); --> "aa", "bb"
74-
t = {"a", "b"}; rprint(table.values(t)); --> "a", "b"
75-
```
73+
> Return an indexed table of all values that are used in the table
74+
> #### examples:
75+
> ```lua
76+
> t = {a="aa", b="bb"}; rprint(table.values(t)); --> "aa", "bb"
77+
> t = {"a", "b"}; rprint(table.values(t)); --> "a", "b"
78+
> ```
7679

0 commit comments

Comments
 (0)