From a8a09c25a1571f78309b7513648e193570a9bbf1 Mon Sep 17 00:00:00 2001 From: ShashiSubramanya <76986173+ShashiSubramanya@users.noreply.github.com> Date: Mon, 12 Jan 2026 06:28:46 +0530 Subject: [PATCH 1/5] Update index.ts --- scripts/Converter/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Converter/index.ts b/scripts/Converter/index.ts index 955ad1be6..d1d28b2d4 100644 --- a/scripts/Converter/index.ts +++ b/scripts/Converter/index.ts @@ -195,7 +195,7 @@ class TypeDocInternalParser { if (tag.tag === 'example') return `${tag.text}\n`; if (tag.tag === 'param') { - return `\nParameter::\n${tag.text}\n`; + return `\nParameter::\n${this.covertTypeDocText(tag.text)}\n`; } if (tag.tag === 'deprecated') { return `[deprecated]#Deprecated : ${tag.text.replace( From e8c65e5e772429032ea7af9895b4aa0dcd68ada8 Mon Sep 17 00:00:00 2001 From: ShashiSubramanya <76986173+ShashiSubramanya@users.noreply.github.com> Date: Mon, 12 Jan 2026 07:37:47 +0530 Subject: [PATCH 2/5] typedoc link converter --- scripts/Converter/index.ts | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/scripts/Converter/index.ts b/scripts/Converter/index.ts index d1d28b2d4..6691b95eb 100644 --- a/scripts/Converter/index.ts +++ b/scripts/Converter/index.ts @@ -167,21 +167,26 @@ class TypeDocInternalParser { 'https://github.com/thoughtspot/visual-embed-sdk/blob/main/src'; static covertTypeDocText = (text: string) => { - // convert all {@link Name.hash} - // to xref:Name.adoc#hash[Name] - const matches = text.match(/{@link\s[^{]+}/g); - if (!matches) return text; - const updatedText = matches?.reduce((prevUpdatedText, curLinkText) => { - const linkTo = curLinkText.split(/\s/)[1].replace('}', ''); - const newLinkText = this.convertNameToLink(linkTo, true); + // 1) Convert Markdown links -> AsciiDoc links + let updated = text.replace( + /\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g, + 'link:$2[$1]', + ); - if (!newLinkText) return prevUpdatedText; + // 2) Existing logic: convert {@link Name.hash} -> xref:... + const matches = updated.match(/{@link\s[^{]+}/g); + if (!matches) return updated; - return prevUpdatedText.replace(curLinkText, newLinkText); - }, text); + const updatedText = matches.reduce((prevUpdatedText, curLinkText) => { + const linkTo = curLinkText.split(/\s/)[1].replace('}', ''); + const newLinkText = this.convertNameToLink(linkTo, true); + if (!newLinkText) return prevUpdatedText; + return prevUpdatedText.replace(curLinkText, newLinkText); + }, updated); - return updatedText; - }; + return updatedText; + }; +}; // function to parse a tag static parseTag(tag: TypeDocCommentTag): string { From 0e7537c5290fb8e64def02170621b4cea1d43c34 Mon Sep 17 00:00:00 2001 From: ShashiSubramanya <76986173+ShashiSubramanya@users.noreply.github.com> Date: Mon, 12 Jan 2026 07:48:37 +0530 Subject: [PATCH 3/5] Fix formatting issues in covertTypeDocText method --- scripts/Converter/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/Converter/index.ts b/scripts/Converter/index.ts index 6691b95eb..34034ca70 100644 --- a/scripts/Converter/index.ts +++ b/scripts/Converter/index.ts @@ -168,16 +168,16 @@ class TypeDocInternalParser { static covertTypeDocText = (text: string) => { // 1) Convert Markdown links -> AsciiDoc links - let updated = text.replace( - /\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g, - 'link:$2[$1]', + let updated = text.replace( + /\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g, + 'link:$2[$1]', ); // 2) Existing logic: convert {@link Name.hash} -> xref:... - const matches = updated.match(/{@link\s[^{]+}/g); + const matches = updated.match(/{@link\s[^{]+}/g); if (!matches) return updated; - const updatedText = matches.reduce((prevUpdatedText, curLinkText) => { + const updatedText = matches.reduce((prevUpdatedText, curLinkText) => { const linkTo = curLinkText.split(/\s/)[1].replace('}', ''); const newLinkText = this.convertNameToLink(linkTo, true); if (!newLinkText) return prevUpdatedText; @@ -185,7 +185,7 @@ class TypeDocInternalParser { }, updated); return updatedText; - }; + }; }; // function to parse a tag From 793c3c2a133f9be3f124be84d81b4262c663e994 Mon Sep 17 00:00:00 2001 From: ShashiSubramanya <76986173+ShashiSubramanya@users.noreply.github.com> Date: Mon, 12 Jan 2026 07:57:54 +0530 Subject: [PATCH 4/5] Refactor TypeDocInternalParser methods for consistency --- scripts/Converter/index.ts | 40 +++++++++++++++----------------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/scripts/Converter/index.ts b/scripts/Converter/index.ts index 34034ca70..cd213d1e0 100644 --- a/scripts/Converter/index.ts +++ b/scripts/Converter/index.ts @@ -155,38 +155,30 @@ const _indent = ( // All the parse functions are to be used internally (its used to get sub content) class TypeDocInternalParser { - static convertToItalic = (name: string | undefined) => - name ? `_${name}_` : ''; + static convertToItalic = (name: string | undefined) => (name ? `_${name}_` : ''); - static convertNameToLink: ( - node: string | undefined, - includeParent?: boolean, - ) => string; + static convertNameToLink: (node: string | undefined, includeParent?: boolean) => string; - static GITHUB_LINK = - 'https://github.com/thoughtspot/visual-embed-sdk/blob/main/src'; + static GITHUB_LINK = 'https://github.com/thoughtspot/visual-embed-sdk/blob/main/src'; - static covertTypeDocText = (text: string) => { + static covertTypeDocText = (text: string) => { // 1) Convert Markdown links -> AsciiDoc links - let updated = text.replace( - /\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g, - 'link:$2[$1]', + const updated = text.replace( + /\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g, + 'link:$2[$1]', ); // 2) Existing logic: convert {@link Name.hash} -> xref:... - const matches = updated.match(/{@link\s[^{]+}/g); - if (!matches) return updated; - - const updatedText = matches.reduce((prevUpdatedText, curLinkText) => { - const linkTo = curLinkText.split(/\s/)[1].replace('}', ''); - const newLinkText = this.convertNameToLink(linkTo, true); - if (!newLinkText) return prevUpdatedText; - return prevUpdatedText.replace(curLinkText, newLinkText); + const matches = updated.match(/{@link\s[^{]+}/g); + if (!matches) return updated; + + return matches.reduce((prevUpdatedText, curLinkText) => { + const linkTo = curLinkText.split(/\s/)[1].replace('}', ''); + const newLinkText = this.convertNameToLink(linkTo, true); + if (!newLinkText) return prevUpdatedText; + return prevUpdatedText.replace(curLinkText, newLinkText); }, updated); - - return updatedText; - }; -}; + }; // function to parse a tag static parseTag(tag: TypeDocCommentTag): string { From 707f31801fe455f286fa113403b2c236eea377d1 Mon Sep 17 00:00:00 2001 From: ShashiSubramanya <76986173+ShashiSubramanya@users.noreply.github.com> Date: Mon, 12 Jan 2026 11:30:49 +0530 Subject: [PATCH 5/5] Fix regex replacement for closing braces in links --- scripts/Converter/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Converter/index.ts b/scripts/Converter/index.ts index cd213d1e0..8dd6b87ab 100644 --- a/scripts/Converter/index.ts +++ b/scripts/Converter/index.ts @@ -173,7 +173,7 @@ class TypeDocInternalParser { if (!matches) return updated; return matches.reduce((prevUpdatedText, curLinkText) => { - const linkTo = curLinkText.split(/\s/)[1].replace('}', ''); + const linkTo = curLinkText.split(/\s/)[1].replace(/}/g, ''); const newLinkText = this.convertNameToLink(linkTo, true); if (!newLinkText) return prevUpdatedText; return prevUpdatedText.replace(curLinkText, newLinkText);