Shiki syntax highlight support

未關閉
#2,530 5 則留言 4 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 3 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
42/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
冷清
技術堆疊
javascript
領域
documentation

研究方向

閱讀 Shiki 的 CDN 使用指南,並檢查 docsify 現有的 Prism 和 highlight.js 整合點。確定設定選項如何選取與 Shiki 相容的類別前綴,並定義每個高亮器的預期輸出。當可以選取 Shiki 且不破壞現有的語法高亮選項時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

enhancement

Feature request

Problem or desire

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

Proposal

Support Shiki.

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

主要語言
JavaScript
星號
31.6k
分支
5.8k
平均合併
6 天 14 小時
30 天內合併 PR
13

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

docsifyjs/docsify 的其他 Issue

查看 docsifyjs/docsify 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。