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

WordPress 外掛 Codeblocks Extended with PrismJS 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Codeblocks Extended with PrismJS」是 2016-10-22 上架。 目前已經下架不再更新,不建議安裝使用。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2019-06-05,距離現在已有 2160 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.0.1 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

duplaja |

外掛標籤

pre | code | prismjs | clipboardjs | code highlighting |

內容簡介

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

功能:

整合了最常用的語言的最新 PrismJS 版本。
整合了 PrismJS 行號插件,以自動為程式碼行號編號。
整合了 PrismJS 行高亮插件,允許您高亮特定程式碼行。
整合了 ClipboardJS + 自定義 jQuery,以在每個程式碼塊上添加「複製到剪貼板」按鈕。
自定義文字編輯器按鈕可使用最常見的

 類包裝所選文本,並用其 HTML 安全等價物替換特殊字符。
自定義可視化編輯器 / TinyMCE 下拉按鈕,具有用於包裝所選文本的最常見語言。
由於透過包裝具有類別的
 標記,因此您可以使用 PrismJS 提供的所有自定義類設置。
不需要短代碼,因此您不必擔心在編輯器模式之間失去空格。
不需要設定頁面:啟用即可使用!

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

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

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

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

原文外掛簡介

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.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Codeblocks Extended with PrismJS」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


最新版本

延伸相關外掛(你可能也想知道)

暫無相關外掛推薦。

文章
Filter
Apply Filters
Mastodon