docsifyjs / docsifyjs/docsify

Shiki syntax highlight support

未关闭
#2,530 5 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
JavaScript
星标
31.5k
派生
5.8k
平均合并
9 天 8 小时
30 天内合并 PR
2

描述

## Feature request

#### Problem or desire

Prism syntax highlight is quite bad (highlight.js is bad too).

#### Proposal

Support [Shiki](http://shiki.style/).

[Shiki](https://github.com/shikijs/shiki) has better syntax highlight because it uses TextMate grammar instead of shady regexp. It uses the same engine as in VS Code.

#### Implementation

I guess the only thing to do on doscify side, is to add a config option that allows to generate a different highlighter class prefix. That way all JS syntax highlighter could nearly be supported.

- shiki: css class `shiki`
- prism: css class `language-` prefix
- highlightjs: css class `hljs`

https://shiki.style/guide/install#cdn-usage

贡献指南

打开贡献指南

调研方向

阅读 Shiki 的 CDN 使用指南,并检查 docsify 现有的 Prism 和 highlight.js 集成点。确定配置选项如何选择与 Shiki 兼容的类前缀,并定义每个高亮器的预期输出。当可以选择 Shiki 且不破坏现有的语法高亮选项时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
documentation
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
需要澄清
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。