From 242fda15ad6eb4d9927f2f2418ccd01218491eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jind=C5=99ich=20B=C3=A4r?= Date: Fri, 5 Jun 2026 10:39:19 +0200 Subject: [PATCH 1/2] Revert "feat: render an "Added in" pill for the @added_in tag (#77)" This reverts commit dd376cd171da76f90fa1d2d0fdc5448534536ac9. --- src/components/Comment.tsx | 20 +------------------- src/components/styles.css | 5 ----- src/plugin/data.ts | 2 -- 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/src/components/Comment.tsx b/src/components/Comment.tsx index 10736bd9..8c817f43 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; @@ -52,23 +40,17 @@ export function Comment({ comment, root, hideTags = [] }: CommentProps) { // Hide custom tags. hideTags.push('@reference'); - const addedIn = getAddedInVersion(comment); - const blockTags = comment.blockTags?.filter((tag) => { if (hideTags.includes(tag.tag)) { return false; } - return tag.tag !== '@default' && tag.tag !== ADDED_IN_TAG; + return tag.tag !== '@default'; }) ?? []; return (
- {addedIn && ( - Added in: {addedIn} - )} - {!!comment.summary && (
diff --git a/src/components/styles.css b/src/components/styles.css index 9c6ac63f..d9847832 100644 --- a/src/components/styles.css +++ b/src/components/styles.css @@ -196,11 +196,6 @@ html[data-theme='light'] .tsd-panel-content { 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 17d86597..1b0e182a 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, From c3ea964245c38766bf1ec889fe5ad0c2b80d9f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jind=C5=99ich=20B=C3=A4r?= Date: Fri, 5 Jun 2026 10:57:59 +0200 Subject: [PATCH 2/2] feat: add rendering styles for the `@since` TypeDoc tag --- playground/js/src/bar.ts | 7 +++++++ playground/js/tsconfig.json | 13 +++++++++++++ playground/website/docusaurus.config.ts | 6 +----- src/components/Comment.tsx | 9 +++++++++ src/components/styles.css | 6 ++++++ yarn.lock | 6 +++--- 6 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 playground/js/tsconfig.json diff --git a/playground/js/src/bar.ts b/playground/js/src/bar.ts index c164c43d..80a0c9d5 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 00000000..5c422427 --- /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 d422a3f3..201a77fe 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 8c817f43..46293fac 100644 --- a/src/components/Comment.tsx +++ b/src/components/Comment.tsx @@ -39,6 +39,7 @@ export function Comment({ comment, root, hideTags = [] }: CommentProps) { // Hide custom tags. hideTags.push('@reference'); + hideTags.push('@since'); const blockTags = comment.blockTags?.filter((tag) => { @@ -71,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 d9847832..cc939a68 100644 --- a/src/components/styles.css +++ b/src/components/styles.css @@ -191,6 +191,12 @@ 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); diff --git a/yarn.lock b/yarn.lock index 7c0ed126..9a66f45c 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