Skip to content

Commit b6207f0

Browse files
committed
Generate documentation for Lune version 0.8.6
1 parent 4d82f81 commit b6207f0

File tree

2 files changed

+101
-32
lines changed

2 files changed

+101
-32
lines changed

pages/api-reference/luau.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ The options passed while loading a luau chunk from an arbitrary string, or bytec
107107
This is a dictionary that may contain one or more of the following values:
108108

109109
- `debugName` - The debug name of the closure. Defaults to `luau.load(...)`.
110-
- `environment` - Environment values to set and/or override. Includes default globals unless
111-
overwritten.
110+
- `environment` - A custom environment to load the chunk in. Setting a custom environment will
111+
deoptimize the chunk and forcefully disable codegen. Defaults to the global environment.
112+
- `injectGlobals` - Whether or not to inject globals in the custom environment. Has no effect if
113+
no custom environment is provided. Defaults to `true`.
114+
- `codegenEnabled` - Whether or not to enable codegen. Defaults to `false`.
112115

113116
---

pages/api-reference/serde.md

Lines changed: 96 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@ fs.writeFile("myFile.yaml", serde.encode("yaml", someYaml))
2929

3030
Encodes the given value using the given format.
3131

32-
Currently supported formats:
33-
34-
| Name | Learn More |
35-
| :----- | :------------------- |
36-
| `json` | https://www.json.org |
37-
| `yaml` | https://yaml.org |
38-
| `toml` | https://toml.io |
32+
See [`EncodeDecodeFormat`] for a list of supported formats.
3933

4034
#### Parameters
4135

@@ -56,13 +50,7 @@ Currently supported formats:
5650

5751
Decodes the given string using the given format into a lua value.
5852

59-
Currently supported formats:
60-
61-
| Name | Learn More |
62-
| :----- | :------------------- |
63-
| `json` | https://www.json.org |
64-
| `yaml` | https://yaml.org |
65-
| `toml` | https://toml.io |
53+
See [`EncodeDecodeFormat`] for a list of supported formats.
6654

6755
#### Parameters
6856

@@ -80,14 +68,7 @@ Currently supported formats:
8068

8169
Compresses the given string using the given format.
8270

83-
Currently supported formats:
84-
85-
| Name | Learn More |
86-
| :------- | :-------------------------------- |
87-
| `brotli` | https://github.com/google/brotli |
88-
| `gzip` | https://www.gnu.org/software/gzip |
89-
| `lz4` | https://github.com/lz4/lz4 |
90-
| `zlib` | https://www.zlib.net |
71+
See [`CompressDecompressFormat`] for a list of supported formats.
9172

9273
#### Parameters
9374

@@ -105,14 +86,7 @@ Currently supported formats:
10586

10687
Decompresses the given string using the given format.
10788

108-
Currently supported formats:
109-
110-
| Name | Learn More |
111-
| :------- | :-------------------------------- |
112-
| `brotli` | https://github.com/google/brotli |
113-
| `gzip` | https://www.gnu.org/software/gzip |
114-
| `lz4` | https://github.com/lz4/lz4 |
115-
| `zlib` | https://www.zlib.net |
89+
See [`CompressDecompressFormat`] for a list of supported formats.
11690

11791
#### Parameters
11892

@@ -125,3 +99,95 @@ Currently supported formats:
12599
- The decompressed string
126100

127101
---
102+
103+
### hash
104+
105+
Hashes the given message using the given algorithm and returns the hash as a hex string.
106+
107+
See [`HashAlgorithm`] for a list of supported algorithms.
108+
109+
#### Parameters
110+
111+
- `algorithm` The algorithm to use
112+
113+
- `message` The message to hash
114+
115+
#### Returns
116+
117+
- The hash as a hex string
118+
119+
---
120+
121+
### hmac
122+
123+
Hashes the given message using HMAC with the given secret and algorithm, returning the hash as a
124+
base64 string.
125+
126+
See [`HashAlgorithm`] for a list of supported algorithms.
127+
128+
#### Parameters
129+
130+
- `algorithm` The algorithm to use
131+
132+
- `message` The message to hash
133+
134+
- `secret` string | buffer
135+
136+
#### Returns
137+
138+
- The hash as a base64 string
139+
140+
---
141+
142+
## Types
143+
144+
### EncodeDecodeFormat
145+
146+
A serialization/deserialization format supported by the Serde library.
147+
148+
Currently supported formats:
149+
150+
| Name | Learn More |
151+
| :----- | :------------------- |
152+
| `json` | https://www.json.org |
153+
| `yaml` | https://yaml.org |
154+
| `toml` | https://toml.io |
155+
156+
---
157+
158+
### CompressDecompressFormat
159+
160+
A compression/decompression format supported by the Serde library.
161+
162+
Currently supported formats:
163+
164+
| Name | Learn More |
165+
| :------- | :-------------------------------- |
166+
| `brotli` | https://github.com/google/brotli |
167+
| `gzip` | https://www.gnu.org/software/gzip |
168+
| `lz4` | https://github.com/lz4/lz4 |
169+
| `zlib` | https://www.zlib.net |
170+
171+
---
172+
173+
### HashAlgorithm
174+
175+
A hash algorithm supported by the Serde library.
176+
177+
Currently supported algorithms:
178+
179+
| Name | Learn More |
180+
| :--------- | :----------------------------------- |
181+
| `md5` | https://en.wikipedia.org/wiki/MD5 |
182+
| `sha1` | https://en.wikipedia.org/wiki/SHA-1 |
183+
| `sha224` | https://en.wikipedia.org/wiki/SHA-2 |
184+
| `sha256` | https://en.wikipedia.org/wiki/SHA-2 |
185+
| `sha384` | https://en.wikipedia.org/wiki/SHA-2 |
186+
| `sha512` | https://en.wikipedia.org/wiki/SHA-2 |
187+
| `sha3-224` | https://en.wikipedia.org/wiki/SHA-3 |
188+
| `sha3-256` | https://en.wikipedia.org/wiki/SHA-3 |
189+
| `sha3-384` | https://en.wikipedia.org/wiki/SHA-3 |
190+
| `sha3-512` | https://en.wikipedia.org/wiki/SHA-3 |
191+
| `blake3` | https://en.wikipedia.org/wiki/BLAKE3 |
192+
193+
---

0 commit comments

Comments
 (0)