facebook / facebook/docusaurus
Make most features work in CommonMark mode: head, live code blocks, tabs...
- 主要语言
- TypeScript
- 星标
- 66.2k
- 派生
- 10k
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 52
描述
### Motivation
Related to the CommonMark support issue: https://github.com/facebook/docusaurus/issues/3018
Some custom elements we created do not work when using the CommonMark parser mode, that you can turn on using:
- `frontMatter.mdx.format: 'md'`
- `config.markdown.format: 'detect'` + using the `.md` extension
---
I think it would be convenient for users to have features working fine in both modes in a consistent way. I believe it is possible, but may require some adaptations.
Here are some components that do not currently work:
---
## SEO
This should work in CommonMark too, but currently does not:
```md
HEAD Markdown Page tests title
```
## Summary/details
Renders as:

Instead of:

---
## Live code editor
Renders as:

Instead of:

---
## Tabs
Renders as: N/A because we don't have any syntax that does not require using MDX/ESM imports.
Instead of:

Possible solution? IMHO this syntax should be allowed without imports:
```md
This is an apple 🍎
This is an orange 🍊
This is a banana 🍌
```
### Structured data
As part of https://github.com/facebook/docusaurus/pull/9669 we are adding a `@theme/StructuredData` helper component:
```mdx
import StructuredData from "@theme/StructuredData";
# Title
```
We should figure out how to define structured data in CommonMark mode
### Self-service
- [X] I'd be willing to do some initial work on this proposal myself.
贡献指南
评估
这个 Issue 还没有评估数据。