From f956982f965e5ae5a19b5229509e1bde589e796d Mon Sep 17 00:00:00 2001 From: Viktor Kombov Date: Thu, 18 Jun 2026 16:35:13 +0300 Subject: [PATCH 01/15] feat(llms): convert ApiLink components to markdown links in generated .md files --- docs/angular/astro.config.ts | 2 ++ docs/xplat/astro.config.ts | 2 ++ src/integration.ts | 68 ++++++++++++++++++++++++++++++++---- src/lib/platform-context.ts | 56 ++++++++++++++++++----------- 4 files changed, 100 insertions(+), 28 deletions(-) diff --git a/docs/angular/astro.config.ts b/docs/angular/astro.config.ts index f97a661c80..b02e253fef 100644 --- a/docs/angular/astro.config.ts +++ b/docs/angular/astro.config.ts @@ -3,6 +3,7 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { createDocsSite, type DocsMode } from 'docs-template/integration'; import { IGDOCS_PLATFORMS, type NavLang } from 'docs-template/platform'; +import { getPlatformContext } from 'docs-template/lib/platform-context'; import { generateGridTopics } from './src/scripts/generate-grids.mjs'; import mdx from '@astrojs/mdx'; @@ -77,6 +78,7 @@ export default createDocsSite({ href: mode === 'production' ? `${PROD_HOST}${b}/` : `${STAGING_HOST}${b}/`, })), selectedPackage: 'angular', + platformContext: getPlatformContext('Angular'), source: { tocPath: `${componentsDocsDir}/toc.json`, docsDir: componentsDocsDir, diff --git a/docs/xplat/astro.config.ts b/docs/xplat/astro.config.ts index 0f2866b008..d5946a770b 100644 --- a/docs/xplat/astro.config.ts +++ b/docs/xplat/astro.config.ts @@ -3,6 +3,7 @@ import { readFileSync, existsSync, mkdirSync, writeFileSync } from 'node:fs'; import { fileURLToPath } from 'node:url'; import { createDocsSite, type DocsMode } from 'docs-template/integration'; import { IGDOCS_PLATFORMS, type NavLang } from 'docs-template/platform'; +import { getPlatformContext } from 'docs-template/lib/platform-context'; import mdx from '@astrojs/mdx'; // --------------------------------------------------------------------------- @@ -339,6 +340,7 @@ export default createDocsSite({ platform: p.key, navLang: lang, mode, + platformContext: getPlatformContext(), build: { format: 'file' }, diff --git a/src/integration.ts b/src/integration.ts index 9df2e34b26..5a24ee6ee3 100644 --- a/src/integration.ts +++ b/src/integration.ts @@ -67,6 +67,8 @@ import { rehypeHeadingAnchors } from 'igniteui-astro-components/plugins/rehype-h import { rehypePagefindIgnore } from 'igniteui-astro-components/plugins/rehype-pagefind-ignore'; import { rehypeStripEmptyParagraphs } from './plugins/rehype-strip-empty-paragraphs'; import { rehypeApiReferencesGrid } from './plugins/rehype-api-references-grid'; +import type { PlatformContext } from 'igniteui-astro-components/lib/types'; +import { resolveApiLink, type ApiLinkProps } from 'igniteui-astro-components/components/mdx/ApiLink/api-link-index'; /** Build / deployment mode. Drives env-var `DOCS_BUILD_MODE`. */ export type DocsMode = 'development' | 'staging' | 'production'; @@ -117,6 +119,42 @@ export interface SiteMetaOptions { * ignored when no package options are available. */ selectedPackage?: string; + /** + * Platform context used to resolve `` components in generated `.md` files. + * When provided, ApiLinks are rendered as markdown links pointing to the correct API docs URL. + * When omitted, ApiLinks fall back to inline code (`` `TypeName.member` ``). + */ + platformContext?: PlatformContext | null; +} + +/** Parse a JSX/MDX attribute string into a plain key→value map. */ +function parseApiLinkAttrs(attrs: string): Record { + const props: Record = {}; + for (const m of attrs.matchAll(/(\w+)="([^"]*)"/g)) props[m[1]] = m[2]; + for (const m of attrs.matchAll(/(\w+)=\{(true|false)\}/g)) props[m[1]] = m[2] === 'true'; + return props; +} + +/** + * Convert an `` JSX element to Markdown. + * Delegates all resolution + label logic to `resolveApiLink` in igniteui-astro-components + * so both the Astro component and this markdown generator stay in sync automatically. + */ +function apiLinkToMd(attrs: string, ctx: PlatformContext | null | undefined): string { + const props = parseApiLinkAttrs(attrs); + + if (!ctx) { + // No platform context — best-effort label from raw props, no URL. + const type = String(props.type ?? ''); + const member = props.member ? String(props.member) : undefined; + const lbl = String(props.label ?? props.module ?? (member ? `${type}.${member}` : type)); + return lbl ? `\`${lbl}\`` : ''; + } + + const result = resolveApiLink(props as ApiLinkProps, ctx); + return result.renderLink + ? `[\`${result.label}\`](${result.url})` + : `\`${result.label}\``; } /** @@ -125,19 +163,26 @@ export interface SiteMetaOptions { * * Removes: * - `import … from '…'` lines at the top of the file - * - Self-closing JSX components: , + * - Self-closing JSX components: , , * - Inline blocks + * + * Converts: + * - `` → markdown link (when ctx resolves the symbol) or inline code */ -function stripMdxForLlms(raw: string): string { +function stripMdxForLlms(raw: string, ctx?: PlatformContext | null): string { return raw // Remove all import lines .replace(/^import\s+.+from\s+['"][^'"]+['"];?\r?\n/gm, '') // Remove blocks (multiline) .replace(/ blocks - * - * Converts: - * - `` → markdown link (when ctx resolves the symbol) or inline code - * - Root-relative links `[label](/path)` → absolute URLs using siteUrl - */ -function stripMdxForLlms(raw: string, ctx?: PlatformContext | null, siteUrl?: string): string { - const site = siteUrl?.replace(/\/$/, '') ?? ''; - return raw - // Remove all import lines - .replace(/^import\s+.+from\s+['"][^'"]+['"];?\r?\n/gm, '') - // Remove blocks (multiline) - .replace(/ -# {Platform} Grid Overview and Configuration +# {Platform} Data Grid Documentation
-

The {Platform} Data Grid component is used for displaying large volumes of data. Modern and more complex grids ensure smooth UX and bring an array of features for manipulating tabular data. There is an intuitive API, theming, branding, filtering, sorting, data selection, Excel-style filtering, and many more.

+

The [{Platform} Data Grid](https://www.infragistics.com/products/react-data-grid){Platform} Data Grid component is used for displaying large volumes of data. Modern and more complex grids ensure smooth UX and bring an array of features for manipulating tabular data. There is an intuitive API, theming, branding, filtering, sorting, data selection, Excel-style filtering, and many more.

The {ProductName} Data Table / Data Grid is a tabular {Platform} grid component that allows you to quickly bind and display your data with little coding or configuration. Features of the {Platform} data grid in our toolbox include filtering, sorting, templates, row selection, row grouping, row pinning, movable columns, virtualization, Master-Detail, and much more.

-

The {Platform} tables are optimized for speed and performance, with the ability to handle millions of rows and columns, and real-time updates in an instant, making {ProductName} Data Grid the best {Platform} Data Grid on the market.

+

The {Platform} tables are optimized for speed and performance, with the ability to handle millions of rows and columns, and real-time updates in an instant.

diff --git a/docs/xplat/src/content/en/toc.json b/docs/xplat/src/content/en/toc.json index 774fb63803..a611cb6db3 100644 --- a/docs/xplat/src/content/en/toc.json +++ b/docs/xplat/src/content/en/toc.json @@ -128,8 +128,7 @@ }, { "exclude": [ - "Angular", - "Blazor" + "Angular" ], "name": "Ignite UI CLI", "href": "general-cli-overview.md", @@ -137,8 +136,7 @@ "items": [ { "exclude": [ - "Angular", - "Blazor" + "Angular" ], "name": "Step-by-Step Guide Using Ignite UI CLI", "href": "general-step-by-step-guide-using-cli.md", diff --git a/docs/xplat/src/content/jp/components/layouts/splitter.mdx b/docs/xplat/src/content/jp/components/layouts/splitter.mdx index fa710d1b38..e20052a39e 100644 --- a/docs/xplat/src/content/jp/components/layouts/splitter.mdx +++ b/docs/xplat/src/content/jp/components/layouts/splitter.mdx @@ -3,7 +3,7 @@ title: "{Platform} スプリッター コンポーネント | レイアウト description: "{ProductName} スプリッター コンポーネントを使用して、水平または垂直レイアウトでサイズ変更可能な 2 つのペインを作成し、折りたたみ/展開の動作、キーボード サポート、およびネストされた分割ビューを実現します。" keywords: "スプリッター, 分割ペイン, サイズ変更可能なペイン, Web Components スプリッター, {Platform} スプリッター, {ProductName}" license: MIT -mentionedTypes: ["Splitter"] +mentionedTypes: ["Splitter", "SplitterResizeEventArgs"] _language: ja llms: description: "{ProductName} スプリッターは、コンテンツを start と end の 2 つの領域に分割する、サイズ変更可能な分割ペイン レイアウトを提供します。" From c69d27e6f16c5f4625ec76f569336f0cd0497974 Mon Sep 17 00:00:00 2001 From: Viktor Kombov Date: Fri, 26 Jun 2026 10:53:46 +0300 Subject: [PATCH 15/15] Update package-lock --- package-lock.json | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3567ad753d..4894988408 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1113,9 +1113,9 @@ } }, "node_modules/@csstools/color-helpers": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-6.0.2.tgz", - "integrity": "sha512-LMGQLS9EuADloEFkcTBR3BwV/CGHV7zyDxVRtVDTwdI2Ca4it0CCVTT9wCkxSgokjE5Ho41hEPgb8OEUwoXr6Q==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-6.1.0.tgz", + "integrity": "sha512-064IFJdjTfUqnjpCVpMOdbr8FLQBhinbZj6yRv2An2E41O/pLEXqfFRWqGq/SxlE5PEUYTlvWsG2r8MswAVvkg==", "funding": [ { "type": "github", @@ -1155,9 +1155,9 @@ } }, "node_modules/@csstools/css-color-parser": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-4.1.8.tgz", - "integrity": "sha512-3chWb7PRLijpJpPIKkDxdu6IBeO5MrFACND57On0j8OPpc0wZibcGc3xAHrSEbOx/KDRyMHoIxGn0w1PhXMYHw==", + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-4.1.9.tgz", + "integrity": "sha512-paQcIaOO53Rk5+YrBaBjm/SgrV4INImjo2BT1DtQRYr+XeTRbeAYlS+jxXp9drqvKmtFnWRJKIalDLhZZDu42A==", "funding": [ { "type": "github", @@ -1170,7 +1170,7 @@ ], "license": "MIT", "dependencies": { - "@csstools/color-helpers": "^6.0.2", + "@csstools/color-helpers": "^6.1.0", "@csstools/css-calc": "^3.2.1" }, "engines": { @@ -6422,9 +6422,9 @@ } }, "node_modules/immutable": { - "version": "5.1.7", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.7.tgz", - "integrity": "sha512-47Xb+LFbZ/ZIjQMj6Q5J3IfK7PJFuqRdFOC9FpGgRTK6U2dAEVmkR9hp58qU4FpYux5YXpneDwkj2EP6lppzFA==", + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.8.tgz", + "integrity": "sha512-TM5YqrGeTsVIPPpILzeqZ8D2Zc2TvNgSDi88zPF2a4cyqQdWV/wVWBDRDbNzzrLeRWScrFcOX9lW2iX6GOtUDw==", "devOptional": true, "license": "MIT" }, @@ -8740,13 +8740,17 @@ "license": "MIT" }, "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz", + "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/raw-body": {