mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.89k stars 32.26k forks source link

[docs-infra] Allow {{"component": “}} to import from same markdown folder #41127

Open oliviertassinari opened 8 months ago

oliviertassinari commented 8 months ago

Summary

Having to the component source outside of the markdown folder like in https://github.com/mui/material-ui/blob/master/docs/data/material/all-components/all-components.md is not great. You want to be able to delete a page of the docs and all its related content all at once (closer folders).

Examples

No response

Motivation

No response

Search keywords: -

flaviendelangle commented 8 months ago

Follow up on #34243

oliviertassinari commented 8 months ago

To provide more details on the problem, the goal is to have the .js file and the markdown in the same folder but:

  1. The use of {{"demo": resets the theme to use the default of Material UI, which isn't the theme of the docs. So ❌
  2. The use of bg:"inline" doesn't include a padding on mobile, this needs to be added back ⚠️
  3. The use of {{"component": doesn't allow to import the components from the same folder as `{{"demo": would So ❌

We could solve this in different ways: