-
Notifications
You must be signed in to change notification settings - Fork 224
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
MDX v2 support #514
MDX v2 support #514
Conversation
🎉 Thanks for opening this pull request! We really appreciate contributors like you! 🙌 |
Visit the preview URL for this PR (updated for commit 29b1322): https://docusaurus-openapi-36b86--pr514-a1qsov89.web.app (expires Thu, 20 Apr 2023 14:23:24 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Thanks for the PR @jgarrow! I was wondering if you might have a reproduction of the original issue available to clone somewhere? As I understand things, the root issue might result from interpolated HTML/MDX causing some broken tags but I am not familiar with MDX v2.0 or Code Hike. Also, I noticed this in the deploy preview (not sure if it works in dev?): |
I am not sure if this is related. docusarus doesn't support MDX v2. facebook/docusaurus#8288 |
Ok, I think I was able to reproduce some or all of what you encountered @jgarrow, by followed the docs here: https://codehike.org/docs/installation/docusaurus Still debugging the errors but I'll use your changes in this PR as a guide. |
@sserrata Here is the link to the project I'm currently working on. I spun up another one this morning that uses the install template from the I'm aware that Docusaurus doesn't currently support MDX v2, but you need to upgrade to it in order to use Code Hike.
|
@jgarrow I think we're on the same page now although I reproduced on v2.3.1 and might be seeing something slightly different. Here's what I am seeing:
I think we could work toward escaping the comparison operators but replacing |
Yup, confirmed that this allows the markdown URL to render:
|
@sserrata I do know with MDX v2, any inline content inside of a JSX tag that would be turned into an inline HTML element will still be interpreted as markdown (see this section on their docs) |
…et markdown syntax
@sserrata Putting the
|
Yeah, MDX v1 will need it in order to render. MDX v2 knows how to handle it inline. |
Thanks @jgarrow - in your opinion, do you see a way for both MDXv1 and v2 to be supported with a common MDX output/format from this plugin? |
@sserrata as much as I hate having a <span>
URL: [https://github.com/Redocly/redoc](https://github.com/Redocly/redoc)
</span> |
Just wanted to mention that afaik it is planned to support MDX 2 with Docusaurus 3.0, which should be the next release |
Description
a
tag in thecreateContactInfo
markdown function to follow the markdown link syntax of[text](url)
.mdx-code-block
code blocks in the markdown templates for thegenerateApiDocs
function.create
markdown util function.Motivation and Context
I am upgrading my Docusaurus site to use MDX v2 and Code Hike and ran into several errors associated with the changes that this PR makes.
create
function, I get an error like this when spinning up the development server:create
markdown util to add a new line in between the tags, I ran into this error:Since the blocks flagged with
mdx-code-block
are just importing other components and using the JSX in the generated MDX files, I removed the code block syntax entirely and the components rendered as expected.a
tag in the contact info:Changing that
a
tag to use markdown link syntax resolved the error.How Has This Been Tested?
Screenshots (if appropriate)
Types of changes
Checklist