diff --git a/playground/js/src/bar.ts b/playground/js/src/bar.ts index c164c43..80a0c9d 100644 --- a/playground/js/src/bar.ts +++ b/playground/js/src/bar.ts @@ -1,8 +1,12 @@ +/** + * @since Added in 1.2.0 + */ export interface BarOptions { /** * The name of the `Bar` instance. * * @default 'Karl' + * @since Added in 1.0.0 */ name: NameType; /** @@ -27,6 +31,8 @@ export interface BarOptions { /** * This is a simple class called `Bar` + * + * @since Added in 1.1.0-beta.23 */ export class Bar { private constructor() { @@ -38,6 +44,7 @@ export class Bar { * * @param {BarOptions} options * @returns {Bar} + * @since Added in 1.0.0, 1.1.0-beta.23 */ static create(options: BarOptions = {} as BarOptions): Bar { return new Bar(); diff --git a/playground/js/tsconfig.json b/playground/js/tsconfig.json new file mode 100644 index 0000000..5c42242 --- /dev/null +++ b/playground/js/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@docusaurus/tsconfig", + "include": [ + "src/**/*" + ], + "compilerOptions": { + "lib": [ + "es2021" + ], + "target": "ES2015", + "esModuleInterop": true + } +} diff --git a/playground/website/docusaurus.config.ts b/playground/website/docusaurus.config.ts index d422a3f..201a77f 100644 --- a/playground/website/docusaurus.config.ts +++ b/playground/website/docusaurus.config.ts @@ -48,12 +48,8 @@ const config: Config = { (context, options) => typedocApiPlugin(context, { ...(options as any), - projectRoot: '.', + projectRoot: '../js', packages: [{ path: '.' }], - pythonOptions: { - moduleShortcutsPath: __dirname + '/../python/module_shortcuts.json', - pythonModulePath: __dirname + '/../python/src', - }, reexports: [ { url: 'https://crawlee.dev/python/api/class/Dataset', diff --git a/src/components/Comment.tsx b/src/components/Comment.tsx index 10736bd..46293fa 100644 --- a/src/components/Comment.tsx +++ b/src/components/Comment.tsx @@ -32,18 +32,6 @@ export function displayPartsToMarkdown(parts: JSONOutput.CommentDisplayPart[]): .join(''); } -const ADDED_IN_TAG = '@added_in'; - -function getAddedInVersion(comment: JSONOutput.Comment): string | null { - const tag = comment.blockTags?.find((blockTag) => blockTag.tag === ADDED_IN_TAG); - - if (!tag) { - return null; - } - - return displayPartsToMarkdown(tag.content).trim() || null; -} - export function Comment({ comment, root, hideTags = [] }: CommentProps) { if (!comment || !hasComment(comment)) { return null; @@ -51,8 +39,7 @@ export function Comment({ comment, root, hideTags = [] }: CommentProps) { // Hide custom tags. hideTags.push('@reference'); - - const addedIn = getAddedInVersion(comment); + hideTags.push('@since'); const blockTags = comment.blockTags?.filter((tag) => { @@ -60,15 +47,11 @@ export function Comment({ comment, root, hideTags = [] }: CommentProps) { return false; } - return tag.tag !== '@default' && tag.tag !== ADDED_IN_TAG; + return tag.tag !== '@default'; }) ?? []; return (
- {addedIn && ( - Added in: {addedIn} - )} - {!!comment.summary && (
@@ -89,6 +72,14 @@ export function Comment({ comment, root, hideTags = [] }: CommentProps) { ))} )} + + { + comment.blockTags.some((tag) => tag.tag === '@since') && ( +
+ tag.tag === '@since')?.content)} /> +
+ ) + }
); } diff --git a/src/components/styles.css b/src/components/styles.css index 9c6ac63..cc939a6 100644 --- a/src/components/styles.css +++ b/src/components/styles.css @@ -191,16 +191,17 @@ html[data-theme='light'] .tsd-panel-content { margin-bottom: 0; } +.tsd-comment-since { + font-style: italic; + font-size: 90%; + margin-top: 1em; +} + .tsd-comment-root { margin-top: 0; margin-bottom: var(--tsd-spacing-vertical-full); } -.tsd-added-in { - display: inline-block; - margin-bottom: var(--tsd-spacing-vertical); -} - /* SOURCES */ .tsd-sources, diff --git a/src/plugin/data.ts b/src/plugin/data.ts index 17d8659..1b0e182 100644 --- a/src/plugin/data.ts +++ b/src/plugin/data.ts @@ -120,8 +120,6 @@ export async function generateJson( '@apilink', '@doclink', ] as `@${string}`[], - // Recognize the @added_in tag (rendered as a pill) on top of the defaults. - blockTags: [...TypeDoc.OptionDefaults.blockTags, '@added_in'] as `@${string}`[], ...options.typedocOptions, // Control how config and packages are detected tsconfig, diff --git a/yarn.lock b/yarn.lock index 7c0ed12..9a66f45 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9773,9 +9773,9 @@ __metadata: linkType: hard "lodash@npm:^4.17.20, lodash@npm:^4.17.21": - version: 4.18.0 - resolution: "lodash@npm:4.18.0" - checksum: 10/8f7f3c2013026623feb0950c2a3310427a7f3a978daedac5b9b2fb52044bb2fe38cb31e08484017f20c2297199a1ddce5c7accf8ebd108956876ce9162dedfff + version: 4.18.1 + resolution: "lodash@npm:4.18.1" + checksum: 10/306fea53dfd39dad1f03d45ba654a2405aebd35797b673077f401edb7df2543623dc44b9effbb98f69b32152295fff725a4cec99c684098947430600c6af0c3f languageName: node linkType: hard