mystmd icon indicating copy to clipboard operation
mystmd copied to clipboard

Investigate the use of shiki as the library for syntax highlighting

Open Nova38 opened this issue 11 months ago • 13 comments
trafficstars

Proposal

Use shiki, https://shiki.style/, as the syntax highlighting library for mystmd. It uses the same syntax highlighting engine as vscode and has very good tooling.

  • It uses TextMate grammars for its language definitions. Which is the same definitions that are used by vscode and GitHub's linquist among others.
    • The output it produces is very good.
    • there is a large number of high-quality language definitions already defined.
    • It also allows reusing vscode color themes.
  • It is supports being run in a compilation step for static generation and at runtime in the end users browser.
  • It has a extensive API for defining transformations and decorations

Additional notes

It is used in a lot of open source projects

  • Astro
  • Nuxt
  • vitepress

Nova38 avatar Nov 27 '24 16:11 Nova38