SyntaxUI / syntaxui

Get free access to pre-built, Tailwind CSS-powered components, animations and effects - brought to life using Framer Motion. Just copy, paste and you're ready to go!
https://syntaxui.com
MIT License
810 stars 53 forks source link

[FEATURE]: use shiki syntax highlighter in ComponentPreview #101

Closed Ansub closed 5 months ago

Ansub commented 5 months ago

Feature Description 📝

remove react-syntax-highlighter and add shiki instead in src/components/ComponentPreview.tsx

krishpatel023 commented 5 months ago

I'll look into it

krishpatel023 commented 5 months ago

Hey @Ansub , I was able to fix the component using shiki but the mdx part of the code display broke as its running the older version (v 0.14.0) and the component requires the new version(v 1.3.0). You will need to migrate that to the latest version before I can add this.

https://shiki.style/guide/migrate

Ansub commented 5 months ago

I tried refactoring and it's breaking a lot of things

krishpatel023 commented 5 months ago

Same here, I also tried doing that but there is not enough documentation for the migration and usage.

Ansub commented 5 months ago

I will be deprecating Shiki. It has become a burden at this point

how can i get the same syntax highlighting like i have in shiki any idea?

krishpatel023 commented 5 months ago

Give me a day to look that up. I'll update you tomorrow.

krishpatel023 commented 5 months ago

Hey @Ansub , Code-Hike is the best way that we can do this. Lets keep shiki in the component code display and for mdx code block we use code-hike.

epoll31 commented 5 months ago

@Ansub I got shiki 1.3.0 working with CodeGroup, CodeGroupFromFile, ComponentPreview, and normal backticks (including inline). Do you still want to stop using shiki?

Ansub commented 5 months ago

@krishpatel023 you can check this implementation which @epoll31 , it was a great learning for me aswell.

krishpatel023 commented 5 months ago

Hey @Ansub, Yeah i saw the code and it was great to know the implementation. sorry I couldn't contribute and sorry for the late reply :)

Ansub commented 5 months ago

No worries, it's a learning experience for all of us in the end.

That's the best part about open-source