mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(website): render syntax and mdx on the server (#9086)
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
**Node.js 16.9.0 or newer is required.**
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install @discordjs/brokers
|
||||
yarn add @discordjs/brokers
|
||||
pnpm add @discordjs/brokers
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
**Node.js 16.9.0 or newer is required.**
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install @discordjs/builders
|
||||
yarn add @discordjs/builders
|
||||
pnpm add @discordjs/builders
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
**Node.js 16.9.0 or newer is required.**
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install @discordjs/collection
|
||||
yarn add @discordjs/collection
|
||||
pnpm add @discordjs/collection
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
**Node.js 16.9.0 or newer is required.**
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install @discordjs/core
|
||||
yarn add @discordjs/core
|
||||
pnpm add @discordjs/core
|
||||
|
||||
@@ -30,7 +30,7 @@ discord.js is a powerful [Node.js](https://nodejs.org) module that allows you to
|
||||
|
||||
**Node.js 16.9.0 or newer is required.**
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install discord.js
|
||||
yarn add discord.js
|
||||
pnpm add discord.js
|
||||
@@ -48,7 +48,7 @@ pnpm add discord.js
|
||||
|
||||
Install discord.js:
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install discord.js
|
||||
yarn add discord.js
|
||||
pnpm add discord.js
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
**Node.js 16.9.0 or newer is required.**
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install @discordjs/formatters
|
||||
yarn add @discordjs/formatters
|
||||
pnpm add @discordjs/formatters
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
**Node.js 18.13.0 or newer is required.**
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install @discordjs/next
|
||||
yarn add @discordjs/next
|
||||
pnpm add @discordjs/next
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
**Node.js 16.9.0 or newer is required.**
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install @discordjs/proxy
|
||||
yarn add @discordjs/proxy
|
||||
pnpm add @discordjs/proxy
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
**Node.js 16.9.0 or newer is required.**
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install @discordjs/rest
|
||||
yarn add @discordjs/rest
|
||||
pnpm add @discordjs/rest
|
||||
@@ -30,7 +30,7 @@ pnpm add @discordjs/rest
|
||||
|
||||
Install all required dependencies:
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install @discordjs/rest discord-api-types
|
||||
yarn add @discordjs/rest discord-api-types
|
||||
pnpm add @discordjs/rest discord-api-types
|
||||
|
||||
@@ -3,10 +3,10 @@ import { join } from 'node:path';
|
||||
import { cwd } from 'node:process';
|
||||
import { generatePath } from '@discordjs/api-extractor-utils';
|
||||
import {
|
||||
ApiModel,
|
||||
ApiDeclaredItem,
|
||||
ApiItemContainerMixin,
|
||||
ApiItem,
|
||||
ApiModel,
|
||||
type ApiPackage,
|
||||
ApiItemKind,
|
||||
} from '@microsoft/api-extractor-model';
|
||||
@@ -42,8 +42,7 @@ export const PACKAGES = [
|
||||
];
|
||||
let idx = 0;
|
||||
|
||||
export function createApiModel(data: any) {
|
||||
const model = new ApiModel();
|
||||
export function addPackageToModel(model: ApiModel, data: any) {
|
||||
const tsdocConfiguration = new TSDocConfiguration();
|
||||
const tsdocConfigFile = TSDocConfigFile.loadFromObject(data.metadata.tsdocConfig);
|
||||
tsdocConfigFile.configureParser(tsdocConfiguration);
|
||||
@@ -163,7 +162,7 @@ export async function generateAllIndices() {
|
||||
const versionRes = await request(`https://docs.discordjs.dev/docs/${pkg}/${version}.api.json`);
|
||||
const data = await versionRes.body.json();
|
||||
|
||||
const model = createApiModel(data);
|
||||
const model = addPackageToModel(new ApiModel(), data);
|
||||
await generateIndex(model, pkg, version);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GlobalProvider } from '@ladle/react';
|
||||
import '@unocss/reset/tailwind.css';
|
||||
import '@unocss/reset/tailwind-compat.css';
|
||||
import 'uno.css';
|
||||
|
||||
export const Provider: GlobalProvider = ({ children }) => <>{children}</>;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
**Node.js 16.9.0 or newer is required.**
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install @discordjs/util
|
||||
yarn add @discordjs/util
|
||||
pnpm add @discordjs/util
|
||||
|
||||
@@ -33,7 +33,7 @@ An implementation of the Discord Voice API for Node.js, written in TypeScript.
|
||||
|
||||
**Node.js 16.9.0 or newer is required.**
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install @discordjs/voice
|
||||
yarn add @discordjs/voice
|
||||
pnpm add @discordjs/voice
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
**Node.js 16.9.0 or newer is required.**
|
||||
|
||||
```sh-session
|
||||
```sh
|
||||
npm install @discordjs/ws
|
||||
yarn add @discordjs/ws
|
||||
pnpm add @discordjs/ws
|
||||
|
||||
Reference in New Issue
Block a user