registerRouteSegments
For every documented type assign BOTH: - a lowercased, numerically-disambiguated FILE segment (so TypeAsserter vs typeAsserter, which both lowercase to typeasserter, become typeasserter / typeasserter-2 on disk and never collide on Windows’ case-insensitive filesystem), and - a case-PRESERVED ROUTE segment (TypeAsserter / typeAsserter) used for the explicit slug: frontmatter and every internal link, so the URLs stay pretty and naturally distinct. The route decouples from the file path via the slug: frontmatter, so no -2 suffix leaks into URLs. Also warns about member-slug collisions within a type. Must run once before any page/link.
Import:
import { registerRouteSegments } from '@mnaoumov/typescript-dev-toolkit/docs-site/api-doc-link-rendering';Signature:
function registerRouteSegments(types: Map<string, TypeInfo>): voidParameters:
| Parameter | Type | Description |
|---|---|---|
types |
Map<string, TypeInfo> | The documented types, keyed by qualified id. |
Returns: void