mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
feat(website): render tsdoc examples (#8494)
This commit is contained in:
20
packages/website/src/DocModel/comment/RootComment.ts
Normal file
20
packages/website/src/DocModel/comment/RootComment.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { ApiItem, ApiModel } from '@microsoft/api-extractor-model';
|
||||
import type { DocComment } from '@microsoft/tsdoc';
|
||||
import { createCommentNode } from '.';
|
||||
import { block, DocBlockJSON } from './CommentBlock';
|
||||
import { DocNodeJSON, node } from './CommentNode';
|
||||
|
||||
export interface DocCommentJSON extends DocNodeJSON {
|
||||
summary: DocNodeJSON[];
|
||||
remarks: DocNodeJSON[];
|
||||
customBlocks: DocBlockJSON[];
|
||||
}
|
||||
|
||||
export function comment(comment: DocComment, model: ApiModel, parentItem?: ApiItem): DocCommentJSON {
|
||||
return {
|
||||
...node(comment),
|
||||
summary: comment.summarySection.nodes.map((node) => createCommentNode(node, model, parentItem)),
|
||||
remarks: comment.remarksBlock?.content.nodes.map((node) => createCommentNode(node, model, parentItem)) ?? [],
|
||||
customBlocks: comment.customBlocks.map((_block) => block(_block, model, parentItem)),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user