[WordPress] 外掛分享: Codeblocks Extended with PrismJS

首頁外掛目錄 › Codeblocks Extended with PrismJS
WordPress 外掛 Codeblocks Extended with PrismJS 的封面圖片
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
10+
安裝啟用
尚無評分
2479 天前
最後更新
問題解決
WordPress 3.0.1+ v1.1 上架:2016-10-22

內容簡介

Codeblocks Extended with PrismJS 是為了個人需求而誕生的輕量化程式碼高亮外掛,具有特殊的功能。
許多其他基於 PrismJS 的外掛在存儲庫中既過時,又缺乏我所需求的功能。

功能:

整合了最常用的語言的最新 PrismJS 版本。
整合了 PrismJS 行號插件,以自動為程式碼行號編號。
整合了 PrismJS 行高亮插件,允許您高亮特定程式碼行。
整合了 ClipboardJS + 自定義 jQuery,以在每個程式碼塊上添加「複製到剪貼板」按鈕。
自定義文字編輯器按鈕可使用最常見的 <pre> 和 <code> 類包裝所選文本,並用其 HTML 安全等價物替換特殊字符。
自定義可視化編輯器 / TinyMCE 下拉按鈕,具有用於包裝所選文本的最常見語言。
由於透過包裝具有類別的 <pre> 和 <code> 標記,因此您可以使用 PrismJS 提供的所有自定義類設置。
不需要短代碼,因此您不必擔心在編輯器模式之間失去空格。
不需要設定頁面:啟用即可使用!

有關支援的完整語言列表和更多有關此外掛使用的信息,請查看 FAQ。

注意:此外掛不會自動檢測語言。大多數可以自動檢測語言的外掛都使用暴力攻擊方式或需要文件擴展名,因此外掛會變得更加臃腫。為保持外掛輕量級,做出了不檢測語言的決策。

注意二:此外掛設計用於經典編輯器。它目前不支援古騰堡區塊。

感謝 Mike @ WP Bullet 提供的橫幅和圖示。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Codeblocks Extended with PrismJS」→ 直接安裝(推薦)

原文外掛簡介

Codeblocks Extended with PrismJS was born of a personal need for a lightweight code highlighter, with special functionality.
Many of the other PrismJS based plugins in the repository were either outdated, or were lacking features that I was looking for.
Features:

Integrates the latest PrismJS build, with the most common langauges used.
Integrates the PrismJS line-numbers plugin, to automatically number lines of code.
Integrates the PrismJS line-highlight plugin to allow you to highlight specific lines of code.
Integrates ClipboardJS + custom jQuery to add a “Copy to Clipboard” button to each code block.
Custom Text Editor button to wrap selected text with the most commmon

 and  classes, and replacing special characters with their HTML safe equivalents.
Custom Visual Editor / TinyMCE dropdown button, with the most common languages to wrap selected text.
Since this works via wrapping

 and  tags with classes, you can use all custom class settings that PrismJS offers.
No shortcodes to mess with, so you don’t have to worry about losing whitespace between editor modes.
No settings page needed: Just activate it and go!

For a full list of languages supported and more information on this plugin’s use, please check out the FAQ.
Note: This does NOT auto-detect the language. Most plugins that do so brute force the languages or require file extensions, resulting in a much heavier plugin. The decision was made to keep this as light-weight as possible.
Note 2: This is designed to work with the Classic Editor. It does not currently work in Gutenberg blocks.
Thanks to Mike @ WP Bullet for the banner and icon.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon