From 3e0599c51d0309ac78d872aa241a6794bf60ee7e Mon Sep 17 00:00:00 2001 From: jaiswalabhishek377 Date: Fri, 13 Mar 2026 00:54:23 +0530 Subject: [PATCH 1/2] feat: append @example tags to member bodies --- plugins/theme/partials/index.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/theme/partials/index.mjs b/plugins/theme/partials/index.mjs index 4aac1b8..4a9c8db 100644 --- a/plugins/theme/partials/index.mjs +++ b/plugins/theme/partials/index.mjs @@ -36,6 +36,14 @@ export default (ctx) => ({ ? model.comment : model.comment || model.parent?.comment; + const exampleTags = comment?.getTags('@example') ?? []; + const exampleSections = exampleTags.flatMap((tag, index) => { + const title = `${'#'.repeat(options.headingLevel + 1)} Example${exampleTags.length > 1 ? ` ${index + 1}` : ''}`; + const body = ctx.helpers.getCommentParts(tag.content); + + return body ? ['', title, '', body] : []; + }); + return [ model.typeParameters?.length && ctx.partials.typeParametersList(model.typeParameters, { @@ -55,6 +63,7 @@ export default (ctx) => ({ ctx.partials.comment(comment, { headingLevel: options.headingLevel, }), + ...exampleSections, ] .filter((x) => (typeof x === 'string' ? x : Boolean(x))) .join('\n'); From 8a5ff801444e3d8f64d41453ac7b83b032fcb522 Mon Sep 17 00:00:00 2001 From: jaiswalabhishek377 Date: Fri, 13 Mar 2026 01:46:37 +0530 Subject: [PATCH 2/2] fix: remove empty strings from exampleSections (filtered out by existing filter) --- plugins/theme/partials/index.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/theme/partials/index.mjs b/plugins/theme/partials/index.mjs index 4a9c8db..45f6047 100644 --- a/plugins/theme/partials/index.mjs +++ b/plugins/theme/partials/index.mjs @@ -41,7 +41,7 @@ export default (ctx) => ({ const title = `${'#'.repeat(options.headingLevel + 1)} Example${exampleTags.length > 1 ? ` ${index + 1}` : ''}`; const body = ctx.helpers.getCommentParts(tag.content); - return body ? ['', title, '', body] : []; + return body ? [title, body] : []; }); return [