Kalan's Blog

Software Engineer / Taiwanese / Life in Fukuoka

Current Theme light

shiki is a package that provides syntax highlighting for code. It is relatively new and less well-known compared to other packages like highlightjs and prismjs. shiki uses TextMate grammar as its tokenizer definition, which makes it easy to extend with a unified standard without the need for custom language development.

Additionally, it has a wide range of supported languages and is easy to configure. It also offers many built-in themes, so I replaced prismjs with it. Install gatsby-remark-shiki and apply the settings, and you're good to go!

Encountered some minor issues:

  • React's highlight was originally used, but it needs to be changed to jsx or tsx.
  • If using c++, it needs to be changed to cpp.

Let's see the result:

const Component = () => <MyComponent />

Prev

tmux Shortcut Key Notes

Next

Several use cases of useMemo

If you found this article helpful, please consider buy me a drink ☕️ It'll make my ordinary day shine✨

Buy me a coffee

作者

Kalan 頭像照片,在淡水拍攝,淺藍背景

愷開 | Kalan

Hi, I'm Kai. I'm Taiwanese and moved to Japan in 2019 for work. Currently settled in Fukuoka. In addition to being familiar with frontend development, I also have experience in IoT, app development, backend, and electronics. Recently, I started playing electric guitar! Feel free to contact me via email for consultations or collaborations or music! I hope to connect with more people through this blog.