docs-site/api-doc-route-segments
The slug rules for a type’s page: the lowercased segment its file is written under, and the case-preserved one its URL uses. Every site is generated with these rules, so a link into another package’s site is built with them too.
Functions
Section titled “Functions”| Function | Description |
|---|---|
| toRouteSegment | Lowercase a path segment for use in an ON-DISK file/dir name. The routes themselves are case-preserved via an explicit slug: frontmatter (see toRouteSegmentPreserveCase), but the files stay lowercase (and numerically disambiguated) so two type names differing only by case cannot collide on Windows’ case-insensitive filesystem. |
| toRouteSegmentPreserveCase | Slugify a path segment (type name) for a URL/route while PRESERVING case: collapse runs of non-alphanumeric characters to - and trim. Used for the case-preserved slug: frontmatter and the internal links that point at it, so URLs read as pretty PascalCase (e.g. /api/.../TypeName/). |