diff --git a/documentation/landing.md b/documentation/landing.md
index 5f8a39c..34b1be0 100644
--- a/documentation/landing.md
+++ b/documentation/landing.md
@@ -1,11 +1,15 @@
---
-title:
+title: Minecraft Utilities Documentation
+description: Welcome to the Minecraft Utilities documentation! Here you can find information on how to use the various features of the plugin.
---
-# Minecraft Utilities Documentation
+# Getting Started
-Welcome to the Minecraft Utilities documentation! Here you can find information on how to use the various features of the plugin.
+This is still a work in progress, so please be patient as we continue to add more documentation.
-## Getting Started
+## Libraries
-This is still a work in progress, so please be patient as we continue to add more documentation.
\ No newline at end of file
+We offer a few different libraries for different languages to help you get started with the Minecraft Utilities plugin.
+
+- [Java](/documentation/libraries/java)
+- [JavaScript](/documentation/libraries/javascript)
\ No newline at end of file
diff --git a/documentation/libraries/java.md b/documentation/libraries/java.md
new file mode 100644
index 0000000..a7943d2
--- /dev/null
+++ b/documentation/libraries/java.md
@@ -0,0 +1,42 @@
+---
+title: Java Library
+description: The Java library for Minecraft Utilities is a simple way to interact with the plugin from using Java!
+---
+
+# Java Library
+
+This is the Java library for Minecraft Utilities.
+
+## Installation
+
+To use the Java library, you can add the following to your `pom.xml` file:
+
+```xml
+
+
+ fascinated-repo-public
+ Fascinated's Repository
+ https://repo.fascinated.cc/public
+
+
+
+
+
+ xyz.mcutils
+ mcutils-java-library
+ 1.1.1
+
+
+```
+
+## Usage
+
+This is a simple example of how to use the Java library to get a player's information.
+
+```java
+public class Main {
+ public static void main(String[] args) {
+ System.out.println(McUtilsAPI.getPlayer("Notch"));
+ }
+}
+```
\ No newline at end of file
diff --git a/documentation/libraries/javascript.md b/documentation/libraries/javascript.md
new file mode 100644
index 0000000..0243ab3
--- /dev/null
+++ b/documentation/libraries/javascript.md
@@ -0,0 +1,28 @@
+---
+title: Javascript Library
+description: The Javascript library for Minecraft Utilities is a simple way to interact with the plugin from using Javascript!
+---
+
+# Javascript Library
+
+This is the Javascript library for Minecraft Utilities.
+
+## Installation
+
+To use the Javascript library, you can run the following command:
+
+```bash
+npm install mcutils-library
+```
+
+## Usage
+
+This is a simple example of how to use the Javascript library to get a player's information.
+
+```javascript
+import { getPlayer, CachedPlayer } from "mcutils-library";
+
+const cachedPlayer = await getPlayer(playerId);
+
+console.log(player);
+```
\ No newline at end of file
diff --git a/package.json b/package.json
index d6d3254..ba41ff1 100644
--- a/package.json
+++ b/package.json
@@ -39,6 +39,7 @@
"react-spinners": "^0.13.8",
"react-syntax-highlighter": "^15.5.0",
"react-use-websocket": "4.8.1",
+ "read-file": "^0.2.0",
"remote-mdx": "^0.0.4",
"tailwind-merge": "^2.2.2",
"tailwindcss-animate": "^1.0.7"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 9eb43a8..0294f7c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -95,6 +95,9 @@ dependencies:
react-use-websocket:
specifier: 4.8.1
version: 4.8.1(react-dom@18.2.0)(react@18.2.0)
+ read-file:
+ specifier: ^0.2.0
+ version: 0.2.0
remote-mdx:
specifier: ^0.0.4
version: 0.0.4(react@18.2.0)
@@ -6494,6 +6497,11 @@ packages:
dependencies:
pify: 2.3.0
+ /read-file@0.2.0:
+ resolution: {integrity: sha512-na/zgd5KplGlR+io+ygXQMIoDfX/Y0bNS5+P2TOXOTk5plquOVd0snudCd30hZJAsnVK2rxuxUP2z0CN+Aw1lQ==}
+ engines: {node: '>=0.8'}
+ dev: false
+
/readdirp@3.6.0:
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
engines: {node: '>=8.10.0'}
diff --git a/src/app/(pages)/documentation/[[...slug]]/page.tsx b/src/app/(pages)/documentation/[[...slug]]/page.tsx
index 98bc37b..c633a22 100644
--- a/src/app/(pages)/documentation/[[...slug]]/page.tsx
+++ b/src/app/(pages)/documentation/[[...slug]]/page.tsx
@@ -5,7 +5,7 @@ import { generateEmbed } from "@/common/embed";
type DocumentationPageParams = {
params: {
- slug?: string;
+ slug?: string[];
};
};
@@ -18,9 +18,16 @@ export async function generateStaticParams() {
}
export async function generateMetadata({ params: { slug } }: DocumentationPageParams): Promise {
+ const pageSlug = slug?.join("/");
const documentationPages = getDocumentation();
- let page = documentationPages.find(page => page.slug === slug);
+ let page = documentationPages.find(page => page.slug === pageSlug);
+ // Use the landing page on "/documentation"
+ if (!page && !slug) {
+ page = documentationPages.find(page => page.slug === "landing");
+ }
+
+ // Fallback to page not found
if (!page) {
return generateEmbed({
title: "Page not found",
@@ -30,34 +37,37 @@ export async function generateMetadata({ params: { slug } }: DocumentationPagePa
return generateEmbed({
title: page.metadata.title,
- description: "Click to view this page",
+ description: `${page.metadata.description}\n\nClick to view this page`,
});
}
export default function Page({ params: { slug } }: DocumentationPageParams) {
+ const pageSlug = slug?.join("/");
const documentationPages = getDocumentation();
- let page = documentationPages.find(page => page.slug === slug);
+ let page = documentationPages.find(page => page.slug === pageSlug);
- // Fallback to the landing page
- if (!page) {
+ // Use the landing page on "/documentation"
+ if (!page && !slug) {
page = documentationPages.find(page => page.slug === "landing");
}
- // Fallback to a 404 page if we still can't find the page
+ // Page was not found, show an error page
if (!page) {
- page = {
- metadata: {
- title: "404 - Not Found",
- },
- content: "If you are seeing this, it means that the documentation page you are looking for does not exist.",
- slug: "empty",
- };
+ return (
+
+
Not Found
+
The page you are looking for was not found.
+
+ );
}
return (
- {/* The documentation page title */}
- {page.metadata.title &&
{page.metadata.title}
}
+ {/* The documentation page title and description */}
+
+ {page.metadata.title &&
{page.metadata.title}
}
+ {page.metadata.description &&
{page.metadata.description}
}
+
{/* The content of the documentation page */}
diff --git a/src/app/components/code-highlighter.tsx b/src/app/components/code-highlighter.tsx
index e687d5f..b4f5c83 100644
--- a/src/app/components/code-highlighter.tsx
+++ b/src/app/components/code-highlighter.tsx
@@ -9,6 +9,11 @@ type CodeHighlighterProps = {
*/
code: string;
+ /**
+ * The language of the code.
+ */
+ language?: string;
+
/**
* Should the element be rounded?
*/
@@ -62,11 +67,11 @@ function rowRenderer({
});
}
-export function CodeHighlighter({ code, rounded = true }: CodeHighlighterProps): ReactElement {
+export function CodeHighlighter({ code, language = "json", rounded = true }: CodeHighlighterProps): ReactElement {
return (