-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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: mdx loader fallback, allow importing mdx docs from anywhere #5299
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✔️ [V2] 🔨 Explore the source changes: d38980e 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/610cf92464b4e60008c97573 😎 Browse the preview: https://deploy-preview-5299--docusaurus-2.netlify.app |
5 tasks
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5299--docusaurus-2.netlify.app/ |
Size Change: +875 B (0%) Total Size: 787 kB
ℹ️ View Unchanged
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
We should allow importing MDX files that are outside the content plugin folders.
This is particularly helpful if some user wants to display the
repo/README.md
in his site: he can just import the file from an existing doc as a partial.Of course we still have the annoying TOC headings issue so this use-case is not 100% solved (#3915)
This still solves a few issues users already reported, such as this one where the user tries to import an MDX file from
src/components/_markdownPartial.mdx
, for which no mdx-loader was configured (#5286)Users expect to be able to import an MDX file, no matter where it's located.
There are shortcomings to the current system though, as the remark/rehype plugins and the additional linkify logic of the issues won't be applied to this out-of-content-plugin mdx file. For this to work we probably need better markdown infrastructure. The current solution is a good enough one, but may not work in all use-cases. Let's wait for someone to complain and see if it's worth improving it.
Also move some dogfooding stuff to the _dogfooding folder
Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
Dogfooding in the test instances
Also displaying the changelog on our own website: https://deploy-preview-5299--docusaurus-2.netlify.app/community/changelog/