Skip to content

Conversation

dav-is
Copy link
Member

@dav-is dav-is commented Sep 18, 2025

For each page.mdx, we should generate a markdown alternate.

e.g. /app/components/checkbox/page.mdx will be availiable at /components/checkbox with a markdown alternate stored at /components/checkbox.md

To publish this markdown, each page should add this to the head:

<link rel="alternate" type="text/markdown" href="/components/checkbox.md" title="Markdown" />

and this to HTTP headers so the alternate can be discovered using a HEAD request:

Link: </components/checkbox.md>; rel="alternate"; type="text/markdown"; title="Markdown"

A link should also be added somewhere directly in the page.

If the server is capable, it should also support Accept: text/markdown and Accept: text/plain

To install, create app/[...markdownPath]/route.ts:

export * from '@mui/internal-docs-infra/markdownAlternatePage';

This route exports generateStaticParams with a list of all expected .md files.

Add to your build script in the docs package.json:

  "scripts": {
    "dev": "next dev --turbopack",
-   "build": "next build",
+   "build": "next build && docs-infra post-build",
    "start": "serve ./out"
  },

@dav-is dav-is added the scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). label Sep 18, 2025
@dav-is dav-is changed the base branch from master to davis/add-docs-infra-docs September 18, 2025 19:40
@mui-bot
Copy link

mui-bot commented Sep 18, 2025

Bundle size report

Bundle Parsed size Gzip size
@base-ui-components/react 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@oliviertassinari oliviertassinari temporarily deployed to davis/add-markdown-version - mui-tools-public PR #720 September 23, 2025 00:05 — with Render Destroyed
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 26, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 26, 2025
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: out-of-date The pull request has merge conflicts and can't be merged. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants