|
8 | 8 | ### 7. [Sample / Code View Configuration](#code-view-configuration) |
9 | 9 | ### 8. [PlatformBlock usage](#platform-block) |
10 | 10 | ### 9. [ApiLink usage](#api-link) |
11 | | - ### 10. [Creating shared help topics](#creating-shared-help-topics) |
12 | | - ### 11. [Updating of Data Visualization related topics](#updating-of-data-visualization-related-topics) |
13 | | - ### 12. [Adding of images](#adding-of-images-in-the-topic) |
| 11 | + ### 10. [Checking MDX API Links](#checking-api-links) |
| 12 | + ### 11. [ApiLink registry workflow](#api-link-registry-workflow) |
| 13 | + ### 12. [Creating shared help topics](#creating-shared-help-topics) |
| 14 | + ### 13. [Updating of Data Visualization related topics](#updating-of-data-visualization-related-topics) |
| 15 | + ### 14. [Adding of images](#adding-of-images-in-the-topic) |
14 | 16 |
|
15 | 17 | # <a name='#repository-overview'>Repository overview</a> |
16 | 18 |
|
@@ -251,7 +253,7 @@ Usage: |
251 | 253 | | `height` | no | `400` | Height of the sample widget in pixels (numeric JSX expression, e.g. `{600}`). | |
252 | 254 | | `alt` | no | `""` | Accessible label for the iframe. Use the `{Platform}` token so it resolves per-platform. | |
253 | 255 | | `lob` | no | `false` | Use `lobDemosBaseUrl` as the base URL (for LOB / grid-dynamic demos). | |
254 | | -| `dv` | no | `false` | Force `dvDemosBaseUrl` for samples whose path does not start with a recognised DV prefix. | |
| 256 | +| `dv` | no | `false` | Force `dvDemosBaseUrl` for samples whose path does not start with a recognized DV prefix. | |
255 | 257 | | `crm` | no | `false` | Use `crmDemoBaseUrl` (for CRM demo samples). | |
256 | 258 | | `iframeOnly` | no | `false` | Render only the iframe — hides the navbar, code tabs, and live-edit footer. | |
257 | 259 | | `fullscreenBtn` | no | `false` | When used together with `iframeOnly={true}`, adds an "Open in full screen" button below the iframe. | |
@@ -312,30 +314,131 @@ import ApiLink from 'igniteui-astro-components/components/mdx/ApiLink.astro'; |
312 | 314 | Basic syntax: |
313 | 315 |
|
314 | 316 | ```mdx |
315 | | -<ApiLink pkg="grids" type="Grid" /> |
316 | | -<ApiLink pkg="grids" type="Column" member="sortable" /> |
| 317 | +<ApiLink type="Grid" /> |
| 318 | +<ApiLink type="Column" member="sortable" /> |
317 | 319 | <ApiLink pkg="gauges" type="BulletGraph" label="Bullet Graph" /> |
318 | 320 | ``` |
319 | 321 |
|
320 | 322 | Key attributes: |
321 | 323 |
|
322 | 324 | | Attribute | Required | Notes | |
323 | 325 | |---|---|---| |
324 | | -| `pkg` | yes | Package key: `"grids"`, `"core"`, `"charts"`, `"gauges"`, `"excel"`, etc. | |
| 326 | +| `pkg` | no | Package key such as `"core"`, `"grids"`, `"charts"`, `"inputs"`, `"excel"`, or `"geo-core"`. Add it only when the registry has multiple valid matches and the package must be explicit. | |
325 | 327 | | `type` | yes | Short type name **without** platform prefix — e.g. `"Grid"`, not `"IgrGrid"`. | |
326 | | -| `kind` | for non-classes | TypeDoc kind: omit for classes. Use `"enum"`, `"interface"`, or `"typeAlias"` otherwise. | |
| 328 | +| `kind` | for non-classes | API kind. Omit for classes. Use `"enum"`, `"interface"`, `"type"`, `"function"`, or `"variable"` when the registry symbol is not a class. | |
327 | 329 | | `member` | no | Property or method name for anchor links. | |
328 | 330 | | `prefixed` | no | Default `true` (adds `Igr`/`Igx`/`Igc`/`Igb`). Set `{false}` for excel types and when `type` already contains `{ComponentName}`. | |
329 | | -| `exclude` | no | Comma-separated platforms to show as inline code instead of a link (e.g. `exclude="Blazor"`). Use when the type does not exist on those platforms. | |
| 331 | +| `suffix` | no | Default `true` for component-style symbols. Set `{false}` for utility classes, strategy classes, and excel types that do not have an Angular `Component` suffix. | |
330 | 332 | | `label` | no | Override the display text. | |
331 | 333 |
|
| 334 | +`ApiLink` resolves through the generated API symbol registry. Keep links minimal when the registry can resolve a single target: |
| 335 | + |
| 336 | +```mdx |
| 337 | +<ApiLink type="Calendar" /> |
| 338 | +<ApiLink type="Grid" member="filter" /> |
| 339 | +``` |
| 340 | + |
| 341 | +Add `pkg` only when the same symbol exists in more than one package: |
| 342 | + |
| 343 | +```mdx |
| 344 | +<ApiLink pkg="core" type="Calendar" /> |
| 345 | +<ApiLink pkg="inputs" type="CheckboxChangeEventArgs" /> |
| 346 | +<ApiLink pkg="geo-core" type="NumberFormatSpecifier" /> |
| 347 | +``` |
| 348 | + |
| 349 | +Add `kind` only when the intended symbol is not a class, or when the same name exists as multiple API kinds: |
| 350 | + |
| 351 | +```mdx |
| 352 | +<ApiLink kind="enum" type="TransactionType" /> |
| 353 | +``` |
| 354 | + |
| 355 | +If one `ApiLink` cannot be correct for all platforms, split the content with `PlatformBlock` instead of forcing one set of props to mean different targets. |
| 356 | + |
| 357 | +Member lookup is case-insensitive, but after a member is found the registry is the source of truth for the rendered member name and anchor. |
| 358 | + |
332 | 359 | Also declare the types in the frontmatter so the auto-generated API reference grid works: |
333 | 360 |
|
334 | 361 | ```yaml |
335 | 362 | mentionedTypes: ["Grid", "Column"] |
336 | 363 | ``` |
337 | 364 |
|
338 | | -For a complete reference see [AI-AGENT-API-LINKS.md](../docs/xplat/AI-AGENT-API-LINKS.md). |
| 365 | +For a complete editing reference see [AI-AGENT-API-LINKS.md](../docs/xplat/AI-AGENT-API-LINKS.md). For the registry and checker flow, see [API-LINK-WORKFLOW.md](../API-LINK-WORKFLOW.md). |
| 366 | +
|
| 367 | +# <a name='#checking-api-links'>Checking MDX API Links</a> |
| 368 | +
|
| 369 | +Use the root `check-mdx-links` scripts to validate `ApiLink` references: |
| 370 | + |
| 371 | +| Scope | Command | |
| 372 | +|---|---| |
| 373 | +| All MDX sources | `npm run check-mdx-links` | |
| 374 | +| Angular docs | `npm run check-mdx-links:angular` | |
| 375 | +| React xplat docs | `npm run check-mdx-links:react` | |
| 376 | +| Web Components xplat docs | `npm run check-mdx-links:wc` | |
| 377 | +| Blazor xplat docs | `npm run check-mdx-links:blazor` | |
| 378 | +| Markdown reports | `npm run check-mdx-links:report:<platform>` | |
| 379 | +| Resolve-only broken-link reports | `npm run check-mdx-links:broken:<platform>` | |
| 380 | + |
| 381 | +These scripts also check for ambiguous `ApiLink` references. If a symbol exists in more than one registry package and the link does not specify enough information to choose safely, the script prints an **Ambiguous ApiLinks** section, writes a `reports/api-link-ambiguity-report*.md` file, and exits with a failure. |
| 382 | + |
| 383 | +Fix ambiguous links by adding a specific `pkg` or `kind` prop. If the correct target differs by platform, wrap platform-specific links in `PlatformBlock`. |
| 384 | + |
| 385 | +Angular checks run the same generated-content sync used by Angular builds before scanning `docs/angular/src/content`. React, Web Components, and Blazor checks generate the selected platform output first, then scan raw xplat MDX files filtered through each language `toc.json` platform exclusions. This keeps report paths pointed at raw xplat source files while avoiding topics excluded from that platform. |
| 386 | + |
| 387 | +Reports are written under `reports/`: |
| 388 | + |
| 389 | +| Report | Meaning | |
| 390 | +|---|---| |
| 391 | +| `api-link-ambiguity-report*.md` | Registry duplicate keys and currently referenced ambiguous `ApiLink`s. | |
| 392 | +| `mdx-broken-links*.md` | Resolve-only broken or unresolved `ApiLink`s. | |
| 393 | +| `mdx-link-report*.md` | Full URL check output when the non-broken report scripts are used. | |
| 394 | + |
| 395 | +Referenced ambiguities should be fixed before merging. Registry duplicate keys can remain in the report when no current MDX link references them. |
| 396 | + |
| 397 | +# <a name='#api-link-registry-workflow'>ApiLink registry workflow</a> |
| 398 | + |
| 399 | +The API registry flow is: |
| 400 | + |
| 401 | +```mermaid |
| 402 | +flowchart TD |
| 403 | + A[api-docs] --> B[Generate API docs] |
| 404 | + B --> C[Generate API registry JSON] |
| 405 | + C --> D[Sync into igniteui-documentation] |
| 406 | + D --> E[ApiLink resolves type/member from registry] |
| 407 | + E --> F{Resolved?} |
| 408 | +
|
| 409 | + F -->|Yes| G[Render API link] |
| 410 | + G --> H[Link checker crawls URL] |
| 411 | + H --> I[Reported if unreachable / soft 404] |
| 412 | +
|
| 413 | + F -->|No| J[Render highlighted text only] |
| 414 | + J --> K[Reported as unresolved] |
| 415 | +``` |
| 416 | + |
| 417 | +The checker also detects duplicate registry matches: |
| 418 | + |
| 419 | +```mermaid |
| 420 | +flowchart TD |
| 421 | + A[MDX ApiLink] --> B[Resolve candidate names] |
| 422 | + B --> C[Apply platform prefix/suffix rules] |
| 423 | + C --> D[Apply pkg and kind filters] |
| 424 | + D --> E[Match type in registry] |
| 425 | + E --> F[Match member case-insensitively] |
| 426 | + F --> G{How many registry symbols match?} |
| 427 | +
|
| 428 | + G -->|0| H[Unresolved ApiLink] |
| 429 | + G -->|1| I[Resolved ApiLink] |
| 430 | + G -->|2 or more| J[Ambiguous ApiLink] |
| 431 | +
|
| 432 | + H --> K[Write broken report] |
| 433 | + I --> L[Use canonical registry symbol and member] |
| 434 | + J --> M[Write ambiguity report and fail when enabled] |
| 435 | +``` |
| 436 | + |
| 437 | +Registry snapshots live under `src/data/api-link-index/<platform>/staging-latest.json`. The runtime `ApiLink` component and the checker both use these registries to choose the final URL. |
| 438 | + |
| 439 | +Only referenced ambiguities are blocking. Duplicate registry keys listed in the report are informational until an MDX file references them without enough props to choose the intended symbol. |
| 440 | + |
| 441 | +For the full workflow, package mappings, generated-content behavior, and practical fix loop, see [API-LINK-WORKFLOW.md](../API-LINK-WORKFLOW.md). |
339 | 442 |
|
340 | 443 | # <a name='#creating-shared-help-topics'>Creating shared help topics</a> |
341 | 444 |
|
@@ -369,4 +472,4 @@ Usage: |
369 | 472 | - Use the `@xplat-images` alias which resolves to `docs/xplat/public/images/`. |
370 | 473 | - Always provide a meaningful `alt` attribute. |
371 | 474 | - Use `{Platform}` in the `alt` text when the image is platform-generic (e.g. `alt="{Platform} Grid Overview"`). |
372 | | -- Responsive sizing and lazy loading are handled automatically by Astro — no extra classes or `data-srcset` attributes are needed. |
| 475 | +- Responsive sizing and lazy loading are handled automatically by Astro — no extra classes or `data-srcset` attributes are needed. |
0 commit comments