-
Notifications
You must be signed in to change notification settings - Fork 36
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: embed other mdx/md files #22
Conversation
A few notes:
|
Don't merge yet. I need to test if I'm applying Remark plugins correctly to the imported file. |
Don't merge yet. Need to look into HMR support. |
OK, ready to merge :) |
By importing a .mdx or .md file without an import specifier, you can embed its contents within the importing .mdx file. import "../foo/bar.mdx"
..for an imported .mdx/.md file
..and cache any resolved imports.
Parsed and compiled MDX files will be reused between importers (and when an importer changes) if they have not changed.
f409bb6
to
be260e5
Compare
Importing an // Currenlty already works
import Child from './child.md'
<Child/>
# Markdown
This page is written in _Markdown_. // Equivalent to the above
// Only works after the PR is merged
import './child.md'
# Markdown
This page is written in _Markdown_. |
@brillout That is correct! |
That's neat but I'm a bit worried about the added complexity it adds to code. Thoughts? |
I'm not worried. Why are you? The added complexity is:
We could try to encapsulate it more, into its own |
I think encapsulating the functionality could help, but I agree with @brillout that the change seems to add complexity with any big benefits. Adding good comments for your fork of |
I do think it's cool to be able skip the import specifier and I do like to save keystrokes. And I would definitely be up for taking it in if it were a matter of only changing a couple of LOCs. But AFAICT the added convenience doesn't seem to justify the added complexity. For example, it would definitely decrease my motivation to maintain @aleclarson What do you think? Maybe there is a way to implement this upstream? More people would benefit from your work then :-). |
This makes the core plugin easier to grok.
I think the complexity is being overstated. I can maintain this feature, so there's no need for anyone else to stress themselves out over it.
I don't think slippery slope applies here. Shouldn't we want features that both..
..to be baked in to this plugin? We can evaluate if future proposals meet those criteria as we go. I don't think many more will.
With a feature as simple as this, I think it's best for |
@aleclarson How about you take over @ajstrand Would that be ok with you? |
I don't see the need to change ownership. This is probably the last of my contributions in the foreseeable future. I'd prefer to not be the only maintainer of the entire plugin, as I don't have any free time for maintaining the parts I don't use (eg: SSR or Vue support). |
Just re-read my comment and I realized that it may have come off as offensive but that wasn't my sentiment. I'm trying to find the best solution from a technical/community perspective, that's all. I just thought you'd be willing to take over ownership, since you seemed to be the one who cares most. |
I reviewed the others changes you made; LGTM.
That's makes it ok for me to merge. @ajstrand Ok for merging?
I can maintain that part. |
@brillout I'm fine with merging the work in. |
@brillout I've mentioned this feature in the readme. Lemme know what you think |
👌 |
By importing a .mdx or .md file without an import specifier, you can embed its contents within the importing .mdx file.