mostly completed docs
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m38s

This commit is contained in:
Lee 2024-04-21 05:47:52 +01:00
parent 3b1872a9dc
commit e6a28ed268
18 changed files with 733 additions and 183 deletions

3
.eslintrc.json Normal file

@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}

@ -5,7 +5,22 @@ summary: Welcome to the Minecraft Utilities documentation! Here you can find inf
# Getting Started
This is still a work in progress, so please be patient as we continue to add more documentation.
Welcome to the Minecraft Utilities documentation! Here you can find information on how to use the various features of the API.
## Features
See below for a list of features that are currently available in the API.
| Feature | Description |
|----------------------------------------------------------|----------------------------------------|
| [Player Lookup](/docs/player/player-lookup) | Get a player's information |
| [Player Username To Uuid](/docs/player/username-to-uuid) | Get a player's skin parts |
| [Player Skin Parts](/docs/player/skin-parts) | Get a player's skin parts |
| [Server Lookup](/docs/server/server-lookup) | Get a server's information |
| [Server Icon](/docs/server/favicon) | Get a server's icon |
| [Server Preview](/docs/server/preview) | View the server as if you were in-game |
| [Mojang Status](/docs/mojang/endpoint-status) | Get the status of Mojang's services |
## Libraries

@ -0,0 +1,63 @@
---
title: Mojang - Endpoint Status
summary: Get the status of the Mojang APIs.
---
# Mojang - Endpoint Status
The Mojang endpoint status endpoint allows you to get the status of the Mojang APIs.
## Endpoint
```
GET /mojang/status
```
## Example
```bash
curl -X GET "https://api.mcutils.xyz/mojang/status" -H "accept: application/json"
```
## Response
```json
{
"cache": {
"cached": false,
"cachedTime": -1
},
"endpoints": [
{
"name": "Minecraft Textures",
"hostname": "textures.minecraft.net",
"status": "ONLINE"
},
{
"name": "Minecraft Libraries",
"hostname": "libraries.minecraft.net",
"status": "ONLINE"
},
{
"name": "Minecraft Services",
"hostname": "api.minecraftservices.com",
"status": "ONLINE"
},
{
"name": "Mojang Assets",
"hostname": "assets.mojang.com",
"status": "ONLINE"
},
{
"name": "Mojang API",
"hostname": "api.mojang.com",
"status": "ONLINE"
},
{
"name": "Mojang Session Server",
"hostname": "sessionserver.mojang.com",
"status": "ONLINE"
}
]
}
```

@ -0,0 +1,68 @@
---
title: Player Lookup
summary: Get information about a player.
---
# Player Lookup
The player lookup endpoint allows you to get information about a player. This includes their UUID, username, and any other information that is available.
## Endpoint
```
GET /player/:query
```
## Parameters
| Parameter | Description | Required |
|-----------|---------------------------------------------------------|----------|
| query | The username or uuid of the player you want to look up. | Yes |
## Example
```bash
curl -X GET "https://api.mcutils.xyz/player/imfascinated" -H "accept: application/json"
```
## Response
```json
{
"cache": {
"cached": false,
"cachedTime": -1
},
"uniqueId": "eeab5f8a-18dd-4d58-af78-2b3c4543da48",
"trimmedUniqueId": "eeab5f8a18dd4d58af782b3c4543da48",
"username": "ImFascinated",
"skin": {
"url": "http://textures.minecraft.net/texture/ba1e0c9e21983c06e45614642316cd7029a297bc246bc6d236a41388c3ff9a09",
"model": "SLIM",
"legacy": false,
"parts": {
"head": "https://api.mcutils.xyz/player/head/eeab5f8a-18dd-4d58-af78-2b3c4543da48",
"face": "https://api.mcutils.xyz/player/face/eeab5f8a-18dd-4d58-af78-2b3c4543da48",
"body": "https://api.mcutils.xyz/player/body/eeab5f8a-18dd-4d58-af78-2b3c4543da48"
}
},
"cape": {
"url": "http://textures.minecraft.net/texture/2340c0e03dd24a11b15a8b33c2a7e9e32abb2051b2481d0ba7defd635ca7a933"
},
"rawProperties": [
{
"name": "textures",
"value": "ewogICJ0aW1lc3RhbXAiIDogMTcxMzY3MDc4MTM0NSwKICAicHJvZmlsZUlkIiA6ICJlZWFiNWY4YTE4ZGQ0ZDU4YWY3ODJiM2M0NTQzZGE0OCIsCiAgInByb2ZpbGVOYW1lIiA6ICJJbUZhc2NpbmF0ZWQiLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmExZTBjOWUyMTk4M2MwNmU0NTYxNDY0MjMxNmNkNzAyOWEyOTdiYzI0NmJjNmQyMzZhNDEzODhjM2ZmOWEwOSIsCiAgICAgICJtZXRhZGF0YSIgOiB7CiAgICAgICAgIm1vZGVsIiA6ICJzbGltIgogICAgICB9CiAgICB9LAogICAgIkNBUEUiIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzIzNDBjMGUwM2RkMjRhMTFiMTVhOGIzM2MyYTdlOWUzMmFiYjIwNTFiMjQ4MWQwYmE3ZGVmZDYzNWNhN2E5MzMiCiAgICB9CiAgfQp9",
"signed": false
}
]
}
```
## Errors
| Status Code | Description |
|-------------|-----------------------------------------------|
| 400 | The username is invalid. |
| 404 | The player was not found. |
| 429 | The Mojang API rate limit has been exhausted. |

@ -0,0 +1,47 @@
---
title: Player - Skin Parts
summary: Get a specific part of a player's skin.
---
# Player - Skin Parts
The player skin parts endpoint allows you to get a specific part of a player's skin.
## Endpoint
```
GET /player/:part/:query
```
## Parts
| Part | Description |
|------|-----------------------|
| head | Get the player's head |
| face | Get the player's face |
| body | Get the player's body |
## Parameters
| Parameter | Description | Required |
|-----------|---------------------------------------------------------|----------|
| part | The part of the skin you want to get. | Yes |
| query | The username or uuid of the player you want to look up. | Yes |
## Example
```bash
curl -X GET "https://api.mcutils.xyz/player/head/imfascinated" -H "accept: image/png"
```
## Response
![Skin Part](https://api.mcutils.xyz/player/head/eeab5f8a-18dd-4d58-af78-2b3c4543da48 "Player's Head")
## Errors
| Status Code | Description |
|-------------|-----------------------------------------------|
| 400 | The username is invalid. |
| 404 | The player was not found. |
| 429 | The Mojang API rate limit has been exhausted. |

@ -0,0 +1,46 @@
---
title: Player - Username to UUID
summary: Get a player's UUID from their username.
---
# Player - Username to UUID
The player username to UUID endpoint allows you to get a player's UUID from their username.
## Endpoint
```
GET /player/uuid/:query
```
## Parameters
| Parameter | Description | Required |
|-----------|---------------------------------------------------------|----------|
| query | The username of the player you want to look up. | Yes |
## Example
```bash
curl -X GET "https://api.mcutils.xyz/player/uuid/imfascinated" -H "accept: application/json"
```
## Response
```json
{
"cache": {
"cached": false,
"cachedTime": -1
},
"uniqueId": "eeab5f8a-18dd-4d58-af78-2b3c4543da48",
"username": "ImFascinated"
}
```
## Errors
| Status Code | Description |
|-------------|-----------------------------------------------|
| 400 | The username is invalid. |
| 429 | The Mojang API rate limit has been exhausted. |

@ -0,0 +1,45 @@
---
title: Server - Blocked Status
summary: Get the Mojang blocked status of a Minecraft server.
---
# Server - Blocked Status
The server blocked status endpoint allows you to get the Mojang blocked status of a Minecraft server.
## Endpoint
```
GET /server/blocked/:query
```
## Platforms
This endpoint is only available for Java servers.
## Parameters
| Parameter | Description | Required |
|-----------|---------------------------------------------------------------|----------|
| query | The IP address or hostname of the server you want to look up. | Yes |
## Example
```bash
curl -X GET "https://api.mcutils.xyz/server/blocked/play.hypixel.net"
```
## Response
```json
{
"blocked": false
}
```
## Errors
| Status Code | Description |
|-------------|-----------------------------------------------|
| 400 | The server was not found. |
| 429 | The Mojang API rate limit has been exhausted. |

@ -0,0 +1,41 @@
---
title: Server - Favicon
summary: Get the favicon of a Minecraft server.
---
# Server - Favicon
The server favicon endpoint allows you to get the favicon of a Minecraft server.
## Endpoint
```
GET /server/:query
```
## Platforms
This endpoint is only available for Java servers.
## Parameters
| Parameter | Description | Required |
|-----------|---------------------------------------------------------------------------|----------|
| query | The IP address or hostname of the server you want to get the favicon for. | Yes |
## Example
```bash
curl -X GET "https://api.mcutils.xyz/server/icon/hypixel.net" -H "accept: image/png"
```
## Response
![Server Icon](https://api.mcutils.xyz/server/icon/play.hypixel.net)
## Errors
| Status Code | Description |
|-------------|-----------------------------------------------|
| 400 | The server was not found. |
| 429 | The Mojang API rate limit has been exhausted. |

@ -0,0 +1,45 @@
---
title: Server - Preview
summary: Get the server list preview of a Minecraft server.
---
# Server - Preview
The server preview endpoint allows you to get the server list preview of a Minecraft server.
## Endpoint
```
GET /server/:platform/preview/:query
```
## Platforms
| Platform | Description |
|----------|-----------------|
| bedrock | Bedrock Edition |
| java | Java Edition |
## Parameters
| Parameter | Description | Required |
|-----------|---------------------------------------------------------------------------|----------|
| platform | The platform of the server you want to get the preview for. | Yes |
| query | The IP address or hostname of the server you want to get the preview for. | Yes |
## Example
```bash
curl -X GET "https://api.mcutils.xyz/server/java/preview/hypixel.net" -H "accept: image/png"
```
## Response
![Server Icon](https://api.mcutils.xyz/server/java/preview/play.hypixel.net)
## Errors
| Status Code | Description |
|-------------|-----------------------------------------------|
| 400 | The server was not found. |
| 429 | The Mojang API rate limit has been exhausted. |

File diff suppressed because one or more lines are too long

@ -1,5 +1,3 @@
import createMDX from "@next/mdx";
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
@ -17,6 +15,9 @@ const nextConfig = {
},
],
},
experimental: {
mdxRs: true,
},
};
export default createMDX()(nextConfig)
export default nextConfig;

@ -41,10 +41,19 @@
"react-syntax-highlighter": "^15.5.0",
"react-use-websocket": "4.8.1",
"read-file": "^0.2.0",
"remark-gfm": "^4.0.0",
"remote-mdx": "^0.0.4",
"tailwind-merge": "^2.2.2",
"tailwindcss-animate": "^1.0.7"
},
"pnpm": {
"overrides": {
"remark-mdx": "3.0.0",
"unified": "11.0.4",
"remark-parse": "11.0.0",
"mdast-util-frontmatter": "2.0.1"
}
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",

354
pnpm-lock.yaml generated

@ -4,6 +4,12 @@ settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
overrides:
remark-mdx: 3.0.0
unified: 11.0.4
remark-parse: 11.0.0
mdast-util-frontmatter: 2.0.1
dependencies:
'@eslint/eslintrc':
specifier: ^3.0.2
@ -101,6 +107,9 @@ dependencies:
read-file:
specifier: ^0.2.0
version: 0.2.0
remark-gfm:
specifier: ^4.0.0
version: 4.0.0
remote-mdx:
specifier: ^0.0.4
version: 0.0.4(react@18.2.0)
@ -921,10 +930,10 @@ packages:
hast-util-to-estree: 2.3.3
markdown-extensions: 1.1.1
periscopic: 3.1.0
remark-mdx: 2.3.0
remark-parse: 10.0.2
remark-mdx: 3.0.0
remark-parse: 11.0.0
remark-rehype: 10.1.0
unified: 10.1.2
unified: 11.0.4
unist-util-position-from-estree: 1.1.2
unist-util-stringify-position: 3.0.3
unist-util-visit: 4.1.2
@ -950,7 +959,7 @@ packages:
hast-util-to-jsx-runtime: 2.3.0
markdown-extensions: 2.0.0
periscopic: 3.1.0
remark-mdx: 3.0.1
remark-mdx: 3.0.0
remark-parse: 11.0.0
remark-rehype: 11.1.0
source-map: 0.7.4
@ -1965,7 +1974,7 @@ packages:
/@types/hast@3.0.4:
resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==}
dependencies:
'@types/unist': 2.0.10
'@types/unist': 3.0.2
dev: false
/@types/istanbul-lib-coverage@2.0.6:
@ -2005,7 +2014,7 @@ packages:
/@types/mdast@4.0.3:
resolution: {integrity: sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==}
dependencies:
'@types/unist': 2.0.10
'@types/unist': 3.0.2
dev: false
/@types/mdx@2.0.13:
@ -3200,6 +3209,11 @@ packages:
engines: {node: '>=10'}
dev: true
/escape-string-regexp@5.0.0:
resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==}
engines: {node: '>=12'}
dev: false
/eslint-config-next@14.2.2(eslint@8.57.0)(typescript@5.4.5):
resolution: {integrity: sha512-12/uFc0KX+wUs7EDpOUGKMXBXZJiBVGdK5/m/QgXOCg2mQ0bQWoKSWNrCeOg7Vum6Kw1d1TW453W6xh+GbHquw==}
peerDependencies:
@ -3556,13 +3570,6 @@ packages:
source-map: 0.7.4
dev: false
/estree-util-visit@1.2.1:
resolution: {integrity: sha512-xbgqcrkIVbIG+lI/gzbvd9SGTJL4zqJKBFttUl5pP27KhAjtMKbX/mQXJ7qgyXpMgVy/zvpm0xoQQaGL8OloOw==}
dependencies:
'@types/estree-jsx': 1.0.5
'@types/unist': 2.0.10
dev: false
/estree-util-visit@2.0.0:
resolution: {integrity: sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==}
dependencies:
@ -5056,6 +5063,10 @@ packages:
engines: {node: '>=16'}
dev: false
/markdown-table@3.0.3:
resolution: {integrity: sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==}
dev: false
/mcutils-library@1.3.0(@babel/core@7.24.4)(@types/node@20.12.7):
resolution: {integrity: sha512-OvLe6IctWpWV+fdXQ/4svqCA5I6KCE6Ft0AnkQMhX6EKqDs5tOH/3o/XewJk3OW5+aR7hjP3LWgSl23iRaCPSw==}
dependencies:
@ -5084,6 +5095,15 @@ packages:
unist-util-visit: 4.1.2
dev: false
/mdast-util-find-and-replace@3.0.1:
resolution: {integrity: sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==}
dependencies:
'@types/mdast': 4.0.3
escape-string-regexp: 5.0.0
unist-util-is: 6.0.0
unist-util-visit-parents: 6.0.1
dev: false
/mdast-util-from-markdown@1.3.1:
resolution: {integrity: sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==}
dependencies:
@ -5122,6 +5142,75 @@ packages:
- supports-color
dev: false
/mdast-util-gfm-autolink-literal@2.0.0:
resolution: {integrity: sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg==}
dependencies:
'@types/mdast': 4.0.3
ccount: 2.0.1
devlop: 1.1.0
mdast-util-find-and-replace: 3.0.1
micromark-util-character: 2.1.0
dev: false
/mdast-util-gfm-footnote@2.0.0:
resolution: {integrity: sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==}
dependencies:
'@types/mdast': 4.0.3
devlop: 1.1.0
mdast-util-from-markdown: 2.0.0
mdast-util-to-markdown: 2.1.0
micromark-util-normalize-identifier: 2.0.0
transitivePeerDependencies:
- supports-color
dev: false
/mdast-util-gfm-strikethrough@2.0.0:
resolution: {integrity: sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==}
dependencies:
'@types/mdast': 4.0.3
mdast-util-from-markdown: 2.0.0
mdast-util-to-markdown: 2.1.0
transitivePeerDependencies:
- supports-color
dev: false
/mdast-util-gfm-table@2.0.0:
resolution: {integrity: sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==}
dependencies:
'@types/mdast': 4.0.3
devlop: 1.1.0
markdown-table: 3.0.3
mdast-util-from-markdown: 2.0.0
mdast-util-to-markdown: 2.1.0
transitivePeerDependencies:
- supports-color
dev: false
/mdast-util-gfm-task-list-item@2.0.0:
resolution: {integrity: sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==}
dependencies:
'@types/mdast': 4.0.3
devlop: 1.1.0
mdast-util-from-markdown: 2.0.0
mdast-util-to-markdown: 2.1.0
transitivePeerDependencies:
- supports-color
dev: false
/mdast-util-gfm@3.0.0:
resolution: {integrity: sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==}
dependencies:
mdast-util-from-markdown: 2.0.0
mdast-util-gfm-autolink-literal: 2.0.0
mdast-util-gfm-footnote: 2.0.0
mdast-util-gfm-strikethrough: 2.0.0
mdast-util-gfm-table: 2.0.0
mdast-util-gfm-task-list-item: 2.0.0
mdast-util-to-markdown: 2.1.0
transitivePeerDependencies:
- supports-color
dev: false
/mdast-util-mdx-expression@1.3.2:
resolution: {integrity: sha512-xIPmR5ReJDu/DHH1OoIT1HkuybIfRGYRywC+gJtI7qHjCJp/M9jrmBEJW22O8lskDWm562BX2W8TiAwRTb0rKA==}
dependencies:
@ -5147,25 +5236,6 @@ packages:
- supports-color
dev: false
/mdast-util-mdx-jsx@2.1.4:
resolution: {integrity: sha512-DtMn9CmVhVzZx3f+optVDF8yFgQVt7FghCRNdlIaS3X5Bnym3hZwPbg/XW86vdpKjlc1PVj26SpnLGeJBXD3JA==}
dependencies:
'@types/estree-jsx': 1.0.5
'@types/hast': 2.3.10
'@types/mdast': 3.0.15
'@types/unist': 2.0.10
ccount: 2.0.1
mdast-util-from-markdown: 1.3.1
mdast-util-to-markdown: 1.5.0
parse-entities: 4.0.1
stringify-entities: 4.0.4
unist-util-remove-position: 4.0.2
unist-util-stringify-position: 3.0.3
vfile-message: 3.1.4
transitivePeerDependencies:
- supports-color
dev: false
/mdast-util-mdx-jsx@3.1.2:
resolution: {integrity: sha512-eKMQDeywY2wlHc97k5eD8VC+9ASMjN8ItEZQNGwJ6E0XWKiW/Z0V5/H8pvoXUf+y+Mj0VIgeRRbujBmFn4FTyA==}
dependencies:
@ -5186,18 +5256,6 @@ packages:
- supports-color
dev: false
/mdast-util-mdx@2.0.1:
resolution: {integrity: sha512-38w5y+r8nyKlGvNjSEqWrhG0w5PmnRA+wnBvm+ulYCct7nsGYhFVb0lljS9bQav4psDAS1eGkP2LMVcZBi/aqw==}
dependencies:
mdast-util-from-markdown: 1.3.1
mdast-util-mdx-expression: 1.3.2
mdast-util-mdx-jsx: 2.1.4
mdast-util-mdxjs-esm: 1.3.1
mdast-util-to-markdown: 1.5.0
transitivePeerDependencies:
- supports-color
dev: false
/mdast-util-mdx@3.0.0:
resolution: {integrity: sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==}
dependencies:
@ -5364,17 +5422,76 @@ packages:
micromark-util-types: 2.0.0
dev: false
/micromark-extension-mdx-expression@1.0.8:
resolution: {integrity: sha512-zZpeQtc5wfWKdzDsHRBY003H2Smg+PUi2REhqgIhdzAa5xonhP03FcXxqFSerFiNUr5AWmHpaNPQTBVOS4lrXw==}
/micromark-extension-gfm-autolink-literal@2.0.0:
resolution: {integrity: sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg==}
dependencies:
'@types/estree': 1.0.5
micromark-factory-mdx-expression: 1.0.9
micromark-factory-space: 1.1.0
micromark-util-character: 1.2.0
micromark-util-events-to-acorn: 1.2.3
micromark-util-symbol: 1.1.0
micromark-util-types: 1.1.0
uvu: 0.5.6
micromark-util-character: 2.1.0
micromark-util-sanitize-uri: 2.0.0
micromark-util-symbol: 2.0.0
micromark-util-types: 2.0.0
dev: false
/micromark-extension-gfm-footnote@2.0.0:
resolution: {integrity: sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg==}
dependencies:
devlop: 1.1.0
micromark-core-commonmark: 2.0.0
micromark-factory-space: 2.0.0
micromark-util-character: 2.1.0
micromark-util-normalize-identifier: 2.0.0
micromark-util-sanitize-uri: 2.0.0
micromark-util-symbol: 2.0.0
micromark-util-types: 2.0.0
dev: false
/micromark-extension-gfm-strikethrough@2.0.0:
resolution: {integrity: sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw==}
dependencies:
devlop: 1.1.0
micromark-util-chunked: 2.0.0
micromark-util-classify-character: 2.0.0
micromark-util-resolve-all: 2.0.0
micromark-util-symbol: 2.0.0
micromark-util-types: 2.0.0
dev: false
/micromark-extension-gfm-table@2.0.0:
resolution: {integrity: sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw==}
dependencies:
devlop: 1.1.0
micromark-factory-space: 2.0.0
micromark-util-character: 2.1.0
micromark-util-symbol: 2.0.0
micromark-util-types: 2.0.0
dev: false
/micromark-extension-gfm-tagfilter@2.0.0:
resolution: {integrity: sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==}
dependencies:
micromark-util-types: 2.0.0
dev: false
/micromark-extension-gfm-task-list-item@2.0.1:
resolution: {integrity: sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw==}
dependencies:
devlop: 1.1.0
micromark-factory-space: 2.0.0
micromark-util-character: 2.1.0
micromark-util-symbol: 2.0.0
micromark-util-types: 2.0.0
dev: false
/micromark-extension-gfm@3.0.0:
resolution: {integrity: sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==}
dependencies:
micromark-extension-gfm-autolink-literal: 2.0.0
micromark-extension-gfm-footnote: 2.0.0
micromark-extension-gfm-strikethrough: 2.0.0
micromark-extension-gfm-table: 2.0.0
micromark-extension-gfm-tagfilter: 2.0.0
micromark-extension-gfm-task-list-item: 2.0.1
micromark-util-combine-extensions: 2.0.0
micromark-util-types: 2.0.0
dev: false
/micromark-extension-mdx-expression@3.0.0:
@ -5390,21 +5507,6 @@ packages:
micromark-util-types: 2.0.0
dev: false
/micromark-extension-mdx-jsx@1.0.5:
resolution: {integrity: sha512-gPH+9ZdmDflbu19Xkb8+gheqEDqkSpdCEubQyxuz/Hn8DOXiXvrXeikOoBA71+e8Pfi0/UYmU3wW3H58kr7akA==}
dependencies:
'@types/acorn': 4.0.6
'@types/estree': 1.0.5
estree-util-is-identifier-name: 2.1.0
micromark-factory-mdx-expression: 1.0.9
micromark-factory-space: 1.1.0
micromark-util-character: 1.2.0
micromark-util-symbol: 1.1.0
micromark-util-types: 1.1.0
uvu: 0.5.6
vfile-message: 3.1.4
dev: false
/micromark-extension-mdx-jsx@3.0.0:
resolution: {integrity: sha512-uvhhss8OGuzR4/N17L1JwvmJIpPhAd8oByMawEKx6NVdBCbesjH4t+vjEp3ZXft9DwvlKSD07fCeI44/N0Vf2w==}
dependencies:
@ -5420,32 +5522,12 @@ packages:
vfile-message: 4.0.2
dev: false
/micromark-extension-mdx-md@1.0.1:
resolution: {integrity: sha512-7MSuj2S7xjOQXAjjkbjBsHkMtb+mDGVW6uI2dBL9snOBCbZmoNgDAeZ0nSn9j3T42UE/g2xVNMn18PJxZvkBEA==}
dependencies:
micromark-util-types: 1.1.0
dev: false
/micromark-extension-mdx-md@2.0.0:
resolution: {integrity: sha512-EpAiszsB3blw4Rpba7xTOUptcFeBFi+6PY8VnJ2hhimH+vCQDirWgsMpz7w1XcZE7LVrSAUGb9VJpG9ghlYvYQ==}
dependencies:
micromark-util-types: 2.0.0
dev: false
/micromark-extension-mdxjs-esm@1.0.5:
resolution: {integrity: sha512-xNRBw4aoURcyz/S69B19WnZAkWJMxHMT5hE36GtDAyhoyn/8TuAeqjFJQlwk+MKQsUD7b3l7kFX+vlfVWgcX1w==}
dependencies:
'@types/estree': 1.0.5
micromark-core-commonmark: 1.1.0
micromark-util-character: 1.2.0
micromark-util-events-to-acorn: 1.2.3
micromark-util-symbol: 1.1.0
micromark-util-types: 1.1.0
unist-util-position-from-estree: 1.1.2
uvu: 0.5.6
vfile-message: 3.1.4
dev: false
/micromark-extension-mdxjs-esm@3.0.0:
resolution: {integrity: sha512-DJFl4ZqkErRpq/dAPyeWp15tGrcrrJho1hKK5uBS70BCtfrIFg81sqcTVu3Ta+KD1Tk5vAtBNElWxtAa+m8K9A==}
dependencies:
@ -5460,19 +5542,6 @@ packages:
vfile-message: 4.0.2
dev: false
/micromark-extension-mdxjs@1.0.1:
resolution: {integrity: sha512-7YA7hF6i5eKOfFUzZ+0z6avRG52GpWR8DL+kN47y3f2KhxbBZMhmxe7auOeaTBrW2DenbbZTf1ea9tA2hDpC2Q==}
dependencies:
acorn: 8.11.3
acorn-jsx: 5.3.2(acorn@8.11.3)
micromark-extension-mdx-expression: 1.0.8
micromark-extension-mdx-jsx: 1.0.5
micromark-extension-mdx-md: 1.0.1
micromark-extension-mdxjs-esm: 1.0.5
micromark-util-combine-extensions: 1.1.0
micromark-util-types: 1.1.0
dev: false
/micromark-extension-mdxjs@3.0.0:
resolution: {integrity: sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ==}
dependencies:
@ -5520,19 +5589,6 @@ packages:
micromark-util-types: 2.0.0
dev: false
/micromark-factory-mdx-expression@1.0.9:
resolution: {integrity: sha512-jGIWzSmNfdnkJq05c7b0+Wv0Kfz3NJ3N4cBjnbO4zjXIlxJr+f8lk+5ZmwFvqdAbUy2q6B5rCY//g0QAAaXDWA==}
dependencies:
'@types/estree': 1.0.5
micromark-util-character: 1.2.0
micromark-util-events-to-acorn: 1.2.3
micromark-util-symbol: 1.1.0
micromark-util-types: 1.1.0
unist-util-position-from-estree: 1.1.2
uvu: 0.5.6
vfile-message: 3.1.4
dev: false
/micromark-factory-mdx-expression@2.0.1:
resolution: {integrity: sha512-F0ccWIUHRLRrYp5TC9ZYXmZo+p2AM13ggbsW4T0b5CRKP8KHVRB8t4pwtBgTxtjRmwrK0Irwm7vs2JOZabHZfg==}
dependencies:
@ -5690,19 +5746,6 @@ packages:
resolution: {integrity: sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==}
dev: false
/micromark-util-events-to-acorn@1.2.3:
resolution: {integrity: sha512-ij4X7Wuc4fED6UoLWkmo0xJQhsktfNh1J0m8g4PbIMPlx+ek/4YdW5mvbye8z/aZvAPUoxgXHrwVlXAPKMRp1w==}
dependencies:
'@types/acorn': 4.0.6
'@types/estree': 1.0.5
'@types/unist': 2.0.10
estree-util-visit: 1.2.1
micromark-util-symbol: 1.1.0
micromark-util-types: 1.1.0
uvu: 0.5.6
vfile-message: 3.1.4
dev: false
/micromark-util-events-to-acorn@2.0.2:
resolution: {integrity: sha512-Fk+xmBrOv9QZnEDguL9OI9/NQQp6Hz4FuQ4YmCb/5V7+9eAh1s6AYSvL20kHkD67YIg7EpE54TiSlcsf3vyZgA==}
dependencies:
@ -6550,17 +6593,21 @@ packages:
set-function-name: 2.0.2
dev: true
/remark-mdx@2.3.0:
resolution: {integrity: sha512-g53hMkpM0I98MU266IzDFMrTD980gNF3BJnkyFcmN+dD873mQeD5rdMO3Y2X+x8umQfbSE0PcoEDl7ledSA+2g==}
/remark-gfm@4.0.0:
resolution: {integrity: sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==}
dependencies:
mdast-util-mdx: 2.0.1
micromark-extension-mdxjs: 1.0.1
'@types/mdast': 4.0.3
mdast-util-gfm: 3.0.0
micromark-extension-gfm: 3.0.0
remark-parse: 11.0.0
remark-stringify: 11.0.0
unified: 11.0.4
transitivePeerDependencies:
- supports-color
dev: false
/remark-mdx@3.0.1:
resolution: {integrity: sha512-3Pz3yPQ5Rht2pM5R+0J2MrGoBSrzf+tJG94N+t/ilfdh8YLyyKYtidAYwTveB20BoHAcwIopOUqhcmh2F7hGYA==}
/remark-mdx@3.0.0:
resolution: {integrity: sha512-O7yfjuC6ra3NHPbRVxfflafAj3LTwx3b73aBvkEFU5z4PsD6FD4vrqJAkE5iNGLz71GdjXfgRqm3SQ0h0VuE7g==}
dependencies:
mdast-util-mdx: 3.0.0
micromark-extension-mdxjs: 3.0.0
@ -6568,16 +6615,6 @@ packages:
- supports-color
dev: false
/remark-parse@10.0.2:
resolution: {integrity: sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==}
dependencies:
'@types/mdast': 3.0.15
mdast-util-from-markdown: 1.3.1
unified: 10.1.2
transitivePeerDependencies:
- supports-color
dev: false
/remark-parse@11.0.0:
resolution: {integrity: sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==}
dependencies:
@ -6595,7 +6632,7 @@ packages:
'@types/hast': 2.3.10
'@types/mdast': 3.0.15
mdast-util-to-hast: 12.3.0
unified: 10.1.2
unified: 11.0.4
dev: false
/remark-rehype@11.1.0:
@ -6608,6 +6645,14 @@ packages:
vfile: 6.0.1
dev: false
/remark-stringify@11.0.0:
resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==}
dependencies:
'@types/mdast': 4.0.3
mdast-util-to-markdown: 2.1.0
unified: 11.0.4
dev: false
/remote-mdx@0.0.4(react@18.2.0):
resolution: {integrity: sha512-1SG0LCrfgB/ydP9YbSxEmvpjlz2fYAswR9dhW2yRtXul/iPhcX9B2BPHt+opg3ajtSBwPANNDSBFZzfqP9NO3w==}
dependencies:
@ -7332,18 +7377,6 @@ packages:
/undici-types@5.26.5:
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
/unified@10.1.2:
resolution: {integrity: sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==}
dependencies:
'@types/unist': 2.0.10
bail: 2.0.2
extend: 3.0.2
is-buffer: 2.0.5
is-plain-obj: 4.1.0
trough: 2.2.0
vfile: 5.3.7
dev: false
/unified@11.0.4:
resolution: {integrity: sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==}
dependencies:
@ -7396,13 +7429,6 @@ packages:
'@types/unist': 3.0.2
dev: false
/unist-util-remove-position@4.0.2:
resolution: {integrity: sha512-TkBb0HABNmxzAcfLf4qsIbFbaPDvMO6wa3b3j4VcEzFVaw1LBKwnW4/sRJ/atSLSzoIg41JWEdnE7N6DIhGDGQ==}
dependencies:
'@types/unist': 2.0.10
unist-util-visit: 4.1.2
dev: false
/unist-util-remove-position@5.0.0:
resolution: {integrity: sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==}
dependencies:

@ -66,13 +66,16 @@ export default function Page({ params: { slug } }: DocumentationPageParams) {
<BreadcrumbLink href="/docs">Home</BreadcrumbLink>
</BreadcrumbItem>
{slugParts.map((slug, index, array) => {
const path = array.slice(0, index + 1).join("/");
const path: string = array.slice(0, index + 1).join("/");
const name: string = slug.includes("-")
? slug.split("-").map(capitalizeFirstLetter).join(" ")
: capitalizeFirstLetter(slug);
return (
<div key={slug} className="flex items-center ">
<BreadcrumbSeparator className="pr-1.5" />
<BreadcrumbItem>
<BreadcrumbLink href={`/docs/${path}`}>{capitalizeFirstLetter(slug)}</BreadcrumbLink>
<BreadcrumbLink href={`/docs/${path}`}>{capitalizeFirstLetter(name)}</BreadcrumbLink>
</BreadcrumbItem>
</div>
);

@ -11,11 +11,6 @@ export type DocsContentMetadata = MDXMetadata & {
*/
title: string;
/**
* The date this content was published.
*/
published: string;
/**
* The summary of this content.
*/
@ -111,7 +106,9 @@ export function getDocsContent(): DocsContentMetadata[] {
export function getDocContent(path?: string[]): DocsContentMetadata | undefined {
const slug: string = path ? path.join("/") : "home";
return cachedDocs.find(doc => doc.slug === slug);
return process.env.NODE_ENV === "development"
? getDocsContent().find((doc: DocsContentMetadata) => doc.slug === slug)
: cachedDocs.find((doc: DocsContentMetadata) => doc.slug === slug);
}
/**

@ -10,7 +10,7 @@ type ContainerProps = {
export default function Container({ children }: ContainerProps): ReactElement {
return (
<div className="z-[9999] m-auto flex h-screen min-h-full flex-col items-center opacity-90 w-full xs:max-w-[1200px]">
<div className="z-[9999] m-auto flex h-screen flex-col items-center opacity-90 w-full xs:max-w-[1200px]">
<NavBar />
<div className="w-full flex mt-4 justify-center h-full">{children}</div>
</div>

@ -1,6 +1,15 @@
import { MDXRemote } from "remote-mdx/rsc";
import { ReactElement } from "react";
import { formatCode, formatHeading, formatLink, formatList } from "@/app/components/mdx-renderer";
import {
formatCode,
formatHeading,
formatLink,
formatList,
formatTable,
formatTableData,
formatTableHeader,
} from "@/app/components/mdx-renderer";
import remarkGfm from "remark-gfm";
/**
* The components to use in the MDX renderer.
@ -15,8 +24,21 @@ const components = {
code: (props: any) => formatCode(props),
ul: (props: any) => formatList(props),
a: (props: any) => formatLink(props),
table: (props: any) => formatTable(props),
th: (props: any) => formatTableHeader(props),
td: (props: any) => formatTableData(props),
};
export function CustomMDX(props: any): ReactElement {
return <MDXRemote {...props} components={{ ...components, ...(props.components || {}) }} />;
return (
<MDXRemote
{...props}
components={{ ...components, ...(props.components || {}) }}
options={{
mdxOptions: {
remarkPlugins: [remarkGfm],
},
}}
/>
);
}

@ -32,12 +32,10 @@ export function formatCode(props: any): ReactElement {
return <code className="text-xs bg-secondary p-1 rounded-md leading-none" {...props} />;
}
const language = props.className.replace("language-", "");
return (
<div className="pt-4">
<CodeHighlighter
language={props.className ? props.className.replace("language-") : undefined}
code={props.children}
/>
<CodeHighlighter language={props.className ? language : undefined} code={props.children} />
</div>
);
}
@ -63,3 +61,30 @@ export function formatLink(props: any): ReactElement {
</Link>
);
}
/**
* Format a table.
*
* @param props The props to pass to the table.
*/
export function formatTable(props: any): ReactElement {
return <table className="table-auto divide-y divide-gray-200 mt-4">{props.children}</table>;
}
/**
* Format table header.
*
* @param props The props to pass to the table header.
*/
export function formatTableHeader(props: any): ReactElement {
return <th className="border-border border p-1.5">{props.children}</th>;
}
/**
* Format table data.
*
* @param props The props to pass to the table data.
*/
export function formatTableData(props: any): ReactElement {
return <td className="border-border border p-1.5">{props.children}</td>;
}