UNPKG

@mui/internal-docs-infra

Version:

MUI Infra - internal documentation creation tools.

15 lines 834 B
import type { Plugin } from 'unified'; /** * Remark plugin that strips page file extensions from URLs. * Removes /page.tsx, /page.jsx, /page.js, /page.mdx, /page.md from both absolute and relative URLs. * For relative URLs (both ./ and ../), converts them to absolute paths based on the current file's location. * Also removes Next.js route group segments (parenthesis) from URLs. * * Examples: * - /components/page.tsx -> /components * - ./code-highlighter/page.mdx -> /components/code-highlighter (when processed from /components/page.mdx) * - ../code-highlighter/page.tsx -> /code-highlighter (when processed from /components/button/page.mdx) * - /(public)/components/page.tsx -> /components * This allows URLs to resolve when reading in VSCode and Github */ export declare const transformMarkdownRelativePaths: Plugin;