hexo-theme-fluid
hexo-theme-fluid copied to clipboard
feat: 语法高亮支持 shiki
如是功能需求,请确定符合以下情况
- [ ] 难以通过自定义实现
- [x] 难以通过第三方插件实现
支持使用 shiki 做语法高亮,相比于 highlightjs/prismjs,shiki 基于 vscode 的语法高亮天然就是非常强大的,因为它的实现仅取决于 vscode 对各种语言的高亮支持,而众所周知,vscode 的语言支持很多,前面两者都不支持一些较新的语言或前端 DSL(例如 astro),甚至某些非常流行的亦然,例如 vue。
请描述该需求尝试解决的问题
直接支持 shiki 可以解决某些语言不支持的麻烦
请描述您认为可行的解决方案
之前考虑过使用插件 hexo-shiki-twoslash 或者自定义 markdown 渲染器将 vue code 的 language 转换为 html(虽然不完全等价)
考虑过的替代方案
Hello!Recently, I've written a code highlight plugin based on shiki-hexo-shiki-plugin.After you disable the native code highlighter and import the font awesome icon,I think this plugin should meet your demand.Hope it helps.😊