[WordPress] 外掛分享: CC-Syntax-Highlight

首頁外掛目錄 › CC-Syntax-Highlight
WordPress 外掛 CC-Syntax-Highlight 的封面圖片
80+
安裝啟用
★★★★★
5/5 分(1 則評價)
1463 天前
最後更新
問題解決
WordPress 4.6.1+ PHP 7.0+ v1.2.3 上架:2016-09-28

內容簡介

CC-Syntax-Highlight 外掛支援文章、頁面和任何公開自訂文章類型的語法高亮顯示。
它使用 highlight.js 或 google-code-prettify 函式庫。
此外,它還可以使用 clipboard.js 函式庫,添加一個按鈕將文本複製到剪貼板,以及 highlightjs-line-numbers.js 外掛以添加行號。
它支援單行程式碼(預設為 [code] – 您可以在設定頁面上更改),會自動將所有特殊字符轉換為 HTML 實體。
此外,此外掛與多站點 WordPress 安裝相容。

它如何運作?

前往「設定 > 語法醒目顯示」頁面,選擇您喜歡的選項,並儲存它們。
只需將原始碼添加到您的文章(或其他選定的公開自訂文章類型)中,使用以下格式:
<pre><code>Your source code</code></pre>
或者,如果您想自動將所有特殊字符轉換為 HTML 實體,請改用短碼封裝方式(預設為 [code] – 您可以在設定頁面上更改):
<pre>[code]Your source code[/code]</pre>

外掛的 JS 腳本和 CSS 樣式檔僅在顯示頁面上出現原始碼時載入。

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「CC-Syntax-Highlight」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

The CC-Syntax-Highlight plugin supports syntax highlighting of Posts, Pages, and any public Custom Post Types.
It uses highlight.js or google-code-prettify libraries.
Additionally it can use the clipboard.js library to add a button that copies text to the clipboard and highlightjs-line-numbers.js plugin to add line numbers.
It is delivered with support for shortcode (default [code] – you can change it on the settings page) which automatically converts all special characters to HTML entities.
This plugin is compatible with Multisite WordPress installations.
How does it work?

Go to the ‘Settings > Syntax Highlight’ page, select your preferred options and save them.
Simply add the source code to your post (or other selected public Custom Post Type) wrapped with:

Your source code

or if you would like to automatically convert all special characters to HTML entities, use shortcode wrapper instead (default [code] – you can change it on the settings page):

[code]Your source code[/code]

Plugin’s js scripts and css styles files only load if the source code occurs on displaying page.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon