Skip to content

Commit d8c5dc2

Browse files
committed
scope to classes and interfaces
1 parent c4b7cf0 commit d8c5dc2

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

.typedoc/custom-plugin.mjs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,6 @@ function getRelativeLinkReplacements() {
8383

8484
function getCatchAllReplacements() {
8585
return [
86-
// Robustly remove the full Experimental section (including optional Example/code block)
87-
// from the first "**`Experimental`**" until the next heading (## ...) or end of file.
88-
// This covers variations in wording/whitespace and ensures the block is stripped.
89-
{
90-
pattern: /(?:^|\r?\n)\*\*`Experimental`\*\*[\s\S]*?(?=(?:\r?\n##\s)|$)/g,
91-
replace: '',
92-
},
93-
// As a safeguard, remove any leftover Example section that specifically shows ClerkProvider clerkJsVersion snippet
94-
{
95-
pattern:
96-
/(?:^|\r?\n)## Example\r?\n(?:\r?\n)?```tsx[\s\S]*?ClerkProvider\s+clerkJsVersion="[^"]*"[\s\S]*?```(?:\r?\n)?/g,
97-
replace: '',
98-
},
9986
{
10087
pattern: /\(setActiveParams\)/g,
10188
replace: '([setActiveParams](/docs/references/javascript/types/set-active-params))',

.typedoc/custom-theme.mjs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,18 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext {
5252
* @param {{ headingLevel?: number; showSummary?: boolean; showTags?: boolean; showReturns?: boolean; isTableColumn?: boolean }} [options]
5353
*/
5454
comment: (model, options) => {
55-
if (model?.modifierTags.has('@experimental')) {
56-
const originalBlockTags = model.blockTags;
57-
model.blockTags = model.blockTags.filter(tag => tag.name !== '@example');
55+
if (
56+
model.hasModifier('@experimental') &&
57+
[ReflectionKind.Class, ReflectionKind.Interface].includes(this.page?.model?.kind)
58+
) {
59+
model.removeModifier('@experimental');
60+
model.removeTags('@example');
61+
model.removeTags('@see');
62+
5863
const res = superPartials.comment(model, options);
59-
model.blockTags = originalBlockTags;
60-
return res;
64+
65+
const [line, ...linesToInclude] = res.replace(/^\n\n/, '').split('\n');
66+
return linesToInclude.join('\n');
6167
}
6268
return superPartials.comment(model, options);
6369
},

0 commit comments

Comments
 (0)