feedback icon indicating copy to clipboard operation
feedback copied to clipboard

MDX support

Open Madoshakalaka opened this issue 3 years ago • 8 comments

Summary

.mdx is a superset of .md, markdown empowered with jsx, used by popular ssg framework docusaurus. Sadly GitLocalize doesn't support it right now.

Repository URL

I am a contributor of Yew, a rising web-frontend framework in Rust. Its website is built with docusaurus, mdx, and GitLocalize, (yew.rs). Currently, we have to change the mdx suffix to md in the project and ask developers to use the ugly hack of overriding markdown file type association in order to stay with GitLocalize.

Possible fixes

Since new formats are constantly emerging, can't GitLocalize fall back to plaintext when it doesn't recognize the file types?

Thanks for your time 🌹

Madoshakalaka avatar Jan 10 '22 05:01 Madoshakalaka

@Madoshakalaka Thank you for the suggestion. MDX support is in our to-do list and will be implemented in the future.

svasilenkov avatar Jan 10 '22 13:01 svasilenkov

@Madoshakalaka We've discussed this internally and we'll add mdx support in a way that .mdx files will be parsed by our current markdown parser - this should work in general, and looks like a relatively quick fix in theory. Will keep you posted. P.S. Yeah, saw that a lot of crazy things are happening in your GitLocalize project because of renaming... :)

ilyaspiridonov avatar Jan 10 '22 15:01 ilyaspiridonov

@Madoshakalaka MDX support have been implemented. Please try it out.

svasilenkov avatar Jan 20 '22 10:01 svasilenkov

@Madoshakalaka To add to Sergey's update, any feedback and comments are appreciated. Please also note whether translations are synced back into your project from GitHub once the PR is merged. With the .md->.mdx renaming that was going on in your repo GitLocalize could not correctly pick up the translations. It should be better now, but let us know if some things look odd.

ilyaspiridonov avatar Jan 20 '22 10:01 ilyaspiridonov

I'm happy to report that we're seeing MDX files from newly added paths. Unfortunately, there's still some weirdness going on with existing project paths. For instance, I would like to remove the source website/versioned_docs/version-0.18.0 because there's a newer one with just website/versioned_docs, but the update is rejected. The path simply shows up again after submitting the changes. The folder also no longer appears in the file explorer. Additionally, there are still a lot of cases where the website/docs path only shows .md files and no .mdx files at all.

I don't mind re-creating the project if that's what it takes, but I figured you might want to take a look at this first.

siku2 avatar Jan 23 '22 20:01 siku2

@siku2 Yes, It would be much better if you could recreate the project, it should help to solve the problems you are facing at the moment.

svasilenkov avatar Jan 24 '22 14:01 svasilenkov

@ilyaspiridonov Hope you are well :) we are also looking for a translation for .mdx now. can you share your latest status on this issue?

0sophy1 avatar Sep 22 '23 00:09 0sophy1

@0sophy1 do you already have sample mdx files in your current project, and the main question - are they going to have formulas? ;)

ilyaspiridonov avatar Sep 22 '23 15:09 ilyaspiridonov