Skip to content
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

Add .mdx extension support #3438

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Conversation

davidknezic
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
Breaking changes? no
Deprecations? no
New tests added? not needed
Fixed tickets Fixes #2109
License MIT

Description

Make it possible to open .mdx files which are Markdown files with the possibility of adding JavaScript (JSX) code. MDX is already very widespread and is still gaining a lot of popularity.

The main effect this change has is that it displays files with the .mdx ending in the sidebar and allows them to be opened.

image

As the files are basically Markdown files, they are already displayed correctly. Any JSX inside of the files also already looks good and doesn't need any special treatment:

image

Saving works perfectly fine.

This PR conflicts with and closes #3424 that was opened recently. It adds the MDX extension to a couple more places in the source code / docs.

@pythonicode
Copy link

Would be nice to get a reviewer here. This is pretty important for developers using React and MDX

@Jocs Jocs merged commit 453cf9d into marktext:develop Aug 3, 2023
@AdrianoCahete
Copy link

@Jocs the latest build has this feature?

@Jocs
Copy link
Member

Jocs commented Nov 1, 2023

@AdrianoCahete I have not release the new version with this feature yet.

@kemo-1
Copy link

kemo-1 commented Jan 1, 2024

I am currently using https://markdoc.dev/ its trying to achive the same effect as mdx but with much better performance and flexability

basic example:

This is shown no matter what.

{% if $myFunVar %}
Only appear if $myFunVar!
{% /if %}

also you can do what mdx dose but with better experince for authors and devolopers by seperating your code from your content while also providing small components that the authors can use

@fazi-gondal
Copy link

Please make support for mdx file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support or at least let open .mdx?
6 participants