gitlocalize / feedback

:mega: We love feedback :sparkles:
20 stars 8 forks source link

MDX support #112

Open Madoshakalaka opened 2 years ago

Madoshakalaka commented 2 years ago

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 🌹

svasilenkov commented 2 years ago

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

ilyaspiridonov commented 2 years ago

@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... :)

svasilenkov commented 2 years ago

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

ilyaspiridonov commented 2 years ago

@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.

siku2 commented 2 years ago

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.

svasilenkov commented 2 years ago

@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.

0sophy1 commented 1 year ago

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

ilyaspiridonov commented 1 year ago

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