Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[code-infra] Move ComponentLinkHeader to @mui/docs #42061

Merged
merged 6 commits into from
May 2, 2024

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Apr 29, 2024

  • Teach @mui/internal-markdown to import components from @mui/docs/...
  • Move ComponentLinkHeader to @mui/docs
  • @michaldudak consequence of this is that I had to default export ComponentLinkHeader. We could think about supporting named exports with something like:
    {{ "component": "@mui/docs/MyModule#NamedExport" }}
    
    but I feel like it would add unnecessary complexity in the markdown loader.

@Janpot Janpot added the scope: code-infra Specific to the core-infra product label Apr 29, 2024
@Janpot Janpot changed the title Move ComponentLinkHeader to @mui/docs [code-infra] Move ComponentLinkHeader to @mui/docs Apr 29, 2024
@Janpot Janpot marked this pull request as ready for review April 30, 2024 13:11
@Janpot Janpot requested a review from michaldudak April 30, 2024 13:11
Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, Base UI seems to work with this: mui/base-ui#378.
The only remaining component we need to have locally is ComponentPageTabs.

@@ -12,7 +12,15 @@ export function createRender(context: {
ignoreLanguagePages: (path: string) => boolean;
}): (markdown: string) => string;

export function getHeaders(markdown: string): Record<string, string | string[]>;
export interface MarkdownHeaders {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These headers also include components and hooks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added those and removed some of the typescript casts

@Janpot Janpot merged commit ec60564 into mui:next May 2, 2024
22 checks passed
@Janpot Janpot deleted the ComponentLinkHeader branch May 2, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the core-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants