saucelabs / docusaurus-theme-github-codeblock

A Docusaurus v2 plugin that supports referencing code examples from public GitHub repositories.
http://opensource.saucelabs.com/docusaurus-theme-github-codeblock/
MIT License
96 stars 22 forks source link

Support for Docusaurus 3.0 #88

Open mariuszkrzaczkowski opened 9 months ago

mariuszkrzaczkowski commented 9 months ago

Docusaurus yesterday released 3.0 which includes support for react 18. I tried to update but the plugin doesn't work

Do you plan to release an update which will support docusuarus 3?

image

image

diemol commented 9 months ago

Absolutely. We would need help, though. Do you know what is required to upgrade this plugin? Do you know if upgraded plugins are backwards compatible with Docusaurus v2?

mariuszkrzaczkowski commented 9 months ago

Do you know what is required to upgrade this plugin?

no, I just saw the documentation of what the problems might be https://docusaurus.io/docs/migration/v3 https://docusaurus.io/blog/preparing-your-site-for-docusaurus-v3

Do you know if upgraded plugins are backwards compatible with Docusaurus v2?

yes, example: https://github.com/easyops-cn/docusaurus-search-local https://github.com/rohit-gohri/redocusaurus

diemol commented 9 months ago

Would you be willing to help us migrate it to v3?

mariuszkrzaczkowski commented 9 months ago

I don't know TypeScript, but I can try it in my free time, there is probably a problem with updating MDX v3.0+ or TypeScript v5.0+

gtnardy commented 9 months ago

up 🙏

diemol commented 9 months ago

Thanks @mariuszkrzaczkowski!

@gtnardy would you be up to help us a bit with this?

christian-bromann commented 9 months ago

@diemol I have just published support for v3 in my fork of this package: https://github.com/christian-bromann/docusaurus-theme-github-codeblock. I hope this helps migrating this.

diemol commented 9 months ago

Thanks @christian-bromann!!

@mariuszkrzaczkowski maybe you can check the fork and give us a hand?

monica-m-ps commented 8 months ago

Hello. I am also facing the same issue. I recently upgraded to v3. I have a lot of GitHub code to display. This seems to be a blocker 😢

mariuszkrzaczkowski commented 7 months ago

Thanks @christian-bromann!!

@mariuszkrzaczkowski maybe you can check the fork and give us a hand?

doesn't work for https://github.com/christian-bromann/docusaurus-theme-github-codeblock/issues/136 there is some other problem

monica-m-ps commented 7 months ago

@mariuszkrzaczkowski Were you able to troubleshoot? I can try digging into your branch if you're still blocked. I had faced loads of bugs when upgrading to 3.x.x. Let me know. 👍🏻

mariuszkrzaczkowski commented 7 months ago

unfortunately it still doesn't work https://github.com/YetiForceCompany/YetiForceDoc

monica-m-ps commented 7 months ago

Ok I'll see what's wrong. Give me this weekend. Will get back to you.

Dr-Electron commented 5 months ago

Any updates on this?

monica-m-ps commented 5 months ago

Hello. Sorry to intervene but since I commented on this thread and got notified, @mariuszkrzaczkowski: I emailed you sometime back (on the email ID listed on your GitHub profile) to identify the issue, instead of spamming here. Please let me know if you received it.

Also, for others running into this issue, if it helps, I faced the same issue and was unable to render my GitHub code from another repo to my documentation repo that's running on Docusaurus 3.x.x. I first ensured Docusaurus 3.x.x was correctly installed and all breaking changes are addressed. Also, I migrated my .md files to .mdx as mentioned here https://docusaurus.io/blog/preparing-your-site-for-docusaurus-v3#preparing-content-for-mdx-v3.

With this plugin, I was getting errors related to CommonJS and ES Modules and they are well explained in the Docusaurus post https://docusaurus.io/blog/preparing-your-site-for-docusaurus-v3#mdx-plugins.

After running into errors, I fixed the CommonJS ones and this plugin works just fine for me.

mariuszkrzaczkowski commented 4 months ago

Unfortunately, after several attempts, the launch fails and I was unable to start it. Migration to version 3.2.1 went without problems, but the extension does not work

image

image

sciotta commented 2 months ago

Any updates on this?

diemol commented 2 months ago

@sciotta would you like to help us fix this? There is a fork where it got fixed. Maybe you can contribute? Check the comments above. Thanks!