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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user