-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
feat(theme-classic): standalone Admonition component #5848
Conversation
✔️ [V2] 🔨 Explore the source changes: fc79d30 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61bee0f69de26a0007ec62f1 😎 Browse the preview: https://deploy-preview-5848--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5848--docusaurus-2.netlify.app/ |
Size Change: 0 B Total Size: 652 kB ℹ️ View Unchanged
|
We can fork |
That's what I plan to do afterwards—fork
I was actually asked not a single time "how to use admonitions outside Markdown" and I also wondered about that from time to time. It's not a bad move IMO given my reasonings in the PR description about why the current state of |
We should probably migrate to https://github.com/remarkjs/remark-directive because it may be standardized in CommonMark someday (I'm not sure how this std process works but there are extensive discussions here: https://talk.commonmark.org/t/generic-directives-plugins-syntax/444) This directive plugin is supported Titus so I'd prefer to use it for admonitions (and likely other use-cases too) rather than migrating the existing admonitions to Remark 13. I'd also prefer to not introduce this extra theme component until we do this migration, because that migration + the better support for CommonMark is likely to help us define a better API surface for this component. So, overall I'm 👍 for having a |
I'm aware of that plugin and also the fact that it's MDX 2.0. To migrate to MDX v2 we need ESM hence #5816. However
I'm not aware of how CM helps us with internal implementations🌚 Suppose we have another tailwind theme. How would we go about reconciling them without introducing a theme comp? Also, I'm just wishing for an OOTB admonition comp that I can use for my React page. It's weird to use many documentation features in React but why not Edit. After re-reading your comment I think you mean we should have different props for the comp? |
I'm in favor of having this new I just want to delay introducing that comp for now, but rather do this later to ensure that the comp's API is compatible with our MDX 2 setup |
Ah, no problem. We have a lot of PRs depending on each other now :D Maybe we should make a roadmap or something to keep track of them. A simple milestone doesn't seem enough |
3f7c4b0
to
9e89183
Compare
So interestingly, as MDX v2 migration is postponed to v3, this PR can now be pushed forward because the API would at least be stable for v2 |
After further study I don't think adding this component now will be more challenging anyway so it seems safe enough to add now thanks |
Motivation
We should prepare to ditch
remark-admonitions
because:In addition, we should have a standalone admonition element for people to use outside of Markdown.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
https://deploy-preview-5848--docusaurus-2.netlify.app/docs/next/markdown-features/admonitions/#usage-in-jsx
Blocking issues
remark-directives
to ensure API compatibility