Skip to content

Commit

Permalink
Generate documentation for Lune version 0.8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Jun 23, 2024
1 parent 4d82f81 commit b6207f0
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 32 deletions.
7 changes: 5 additions & 2 deletions pages/api-reference/luau.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ The options passed while loading a luau chunk from an arbitrary string, or bytec
This is a dictionary that may contain one or more of the following values:

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

---
126 changes: 96 additions & 30 deletions pages/api-reference/serde.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@ fs.writeFile("myFile.yaml", serde.encode("yaml", someYaml))

Encodes the given value using the given format.

Currently supported formats:

| Name | Learn More |
| :----- | :------------------- |
| `json` | https://www.json.org |
| `yaml` | https://yaml.org |
| `toml` | https://toml.io |
See [`EncodeDecodeFormat`] for a list of supported formats.

#### Parameters

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

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

Currently supported formats:

| Name | Learn More |
| :----- | :------------------- |
| `json` | https://www.json.org |
| `yaml` | https://yaml.org |
| `toml` | https://toml.io |
See [`EncodeDecodeFormat`] for a list of supported formats.

#### Parameters

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

Compresses the given string using the given format.

Currently supported formats:

| Name | Learn More |
| :------- | :-------------------------------- |
| `brotli` | https://github.com/google/brotli |
| `gzip` | https://www.gnu.org/software/gzip |
| `lz4` | https://github.com/lz4/lz4 |
| `zlib` | https://www.zlib.net |
See [`CompressDecompressFormat`] for a list of supported formats.

#### Parameters

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

Decompresses the given string using the given format.

Currently supported formats:

| Name | Learn More |
| :------- | :-------------------------------- |
| `brotli` | https://github.com/google/brotli |
| `gzip` | https://www.gnu.org/software/gzip |
| `lz4` | https://github.com/lz4/lz4 |
| `zlib` | https://www.zlib.net |
See [`CompressDecompressFormat`] for a list of supported formats.

#### Parameters

Expand All @@ -125,3 +99,95 @@ Currently supported formats:
- The decompressed string

---

### hash

Hashes the given message using the given algorithm and returns the hash as a hex string.

See [`HashAlgorithm`] for a list of supported algorithms.

#### Parameters

- `algorithm` The algorithm to use

- `message` The message to hash

#### Returns

- The hash as a hex string

---

### hmac

Hashes the given message using HMAC with the given secret and algorithm, returning the hash as a
base64 string.

See [`HashAlgorithm`] for a list of supported algorithms.

#### Parameters

- `algorithm` The algorithm to use

- `message` The message to hash

- `secret` string | buffer

#### Returns

- The hash as a base64 string

---

## Types

### EncodeDecodeFormat

A serialization/deserialization format supported by the Serde library.

Currently supported formats:

| Name | Learn More |
| :----- | :------------------- |
| `json` | https://www.json.org |
| `yaml` | https://yaml.org |
| `toml` | https://toml.io |

---

### CompressDecompressFormat

A compression/decompression format supported by the Serde library.

Currently supported formats:

| Name | Learn More |
| :------- | :-------------------------------- |
| `brotli` | https://github.com/google/brotli |
| `gzip` | https://www.gnu.org/software/gzip |
| `lz4` | https://github.com/lz4/lz4 |
| `zlib` | https://www.zlib.net |

---

### HashAlgorithm

A hash algorithm supported by the Serde library.

Currently supported algorithms:

| Name | Learn More |
| :--------- | :----------------------------------- |
| `md5` | https://en.wikipedia.org/wiki/MD5 |
| `sha1` | https://en.wikipedia.org/wiki/SHA-1 |
| `sha224` | https://en.wikipedia.org/wiki/SHA-2 |
| `sha256` | https://en.wikipedia.org/wiki/SHA-2 |
| `sha384` | https://en.wikipedia.org/wiki/SHA-2 |
| `sha512` | https://en.wikipedia.org/wiki/SHA-2 |
| `sha3-224` | https://en.wikipedia.org/wiki/SHA-3 |
| `sha3-256` | https://en.wikipedia.org/wiki/SHA-3 |
| `sha3-384` | https://en.wikipedia.org/wiki/SHA-3 |
| `sha3-512` | https://en.wikipedia.org/wiki/SHA-3 |
| `blake3` | https://en.wikipedia.org/wiki/BLAKE3 |

---

0 comments on commit b6207f0

Please sign in to comment.