
內容簡介
Enlighter 是一款免費且易於使用的 WordPress 語法高亮工具。其語法高亮效果是由 EnlighterJS javascript 函式庫所提供,能呈現出漂亮的程式碼外觀。
您可以透過新增 Enlighter Sourcecode 區塊 (Gutenberg) 並插入欲高亮的程式碼,簡單易行,剩下的部分就交給 Enlighter 處理吧!
此外,Enlighter 還包含了易於使用的 Theme Customizer,讓您可以修改內建主題,而不需要任何 CSS 知識。
此外,它還支援自動建立選項標籤來一起顯示程式碼群組(尤其是有多國語言示例的情況,例如:html+css+js等)。
其他功能還包括:
完整支援 Gutenberg 編輯器
完整支援經典編輯器 (TinyMCE)
支援常用的所有語言
強大的通用語法高亮引擎,可支援未知/不支援的語言
主題自訂器
行內語法高亮
進階設定選項可於選項網頁上輕鬆設定。
支援程式碼群組 (在選項標籤中顯示多個程式碼區塊)
可加入自己所創建的語言和主題引擎
簡單基於 CSS 的主題風格
整合的 CSS 檔案快取 (適用於高流量網站)
完全遵循 GDPR 標準 - 不需要外部資源,也不會收集任何資料
此外,Gutenberg 編輯器的整合還包括:
完整的編輯器整合 - 透過“ Enlighter Sourcecode”區塊
行內語法高亮
自動轉換為經典編輯器文章 (代碼區塊轉換為 Enlighter Sourcecode 區塊)
轉換過往的代碼區塊為 Enlighter Gutenberg Blocks (手動轉換)
此外,經典編輯器 (TinyMCE) 的整合也包含以下功能:
完整的編輯器整合 - 透過工具欄中的 Enlighter 按鈕
行內語法高亮
使用 Tab 鍵進行縮排對齊(單行和塊選擇)
編輯器格式以精確突顯現有代碼
另外,Markdown 也支援下列功能:
Markdown fenced 代碼區塊
透過反引號代碼進行行內語法高亮 (包括特定語言的增強功能)
最後,Enlighter 也能與 Crayon 和 CodeColorer 套件相容。
外掛標籤
開發者團隊
② 後台搜尋「Enlighter – Customizable Syntax Highlighter」→ 直接安裝(推薦)
原文外掛簡介
Enlighter is a free, easy-to-use, syntax highlighting tool for WordPress. Highlighting is powered by the EnlighterJS javascript library to provide a beautiful code-appearance.
Using it can be as simple as adding a new Enlighter Sourcecode block (Gutenberg) and insert the code which you want to highlight: Enlighter takes care of the rest!
An easy to use Theme-Customizer is included to modify the build-in themes without any css knowlegde!
It also supports the automatic creation of tab-panes to display code-groups together (useful for multi-language examples – e.g. html+css+js)
Upgrade Guide for Enlighter v4
Theme Compatibility
Enlighter WordPress Plugin Docs
Plugin Features
Full Gutenberg Editor Integration
Full Classic Editor Integration (TinyMCE)
Support for all common used languages
Powerful generic highlighting engine for unknown/unsupported languages
Theme Customizer
Inline Syntax Highlighting
Advanced configuration options are available within the options page.
Supports code-groups (displays multiple code-blocks within a tab-pane)
Extensible language and theme engines – add your own one.
Simple CSS based themes
Integrated CSS file caching (suitable for high traffic sites)
Full GDPR compliant – no external resources are required, no data will be aggregated
Gutenberg Editor Integration
Full Editor Integration via “Enlighter Sourcecode” block
Inline Syntax Highlighting
Automatic transformations for classic editor posts (codeblocks converted to Enlighter Sourcecode block)
Transform legacy codeblocks to Enlighter Gutenberg Blocks (manual transformation)
Docs and Usage
Editor plugin repository
Classic Editor (TinyMCE) Integration
Full Editor Integration via Enlighter buttons in the toolbar
Inline Syntax Highlighting
Tab-Indentation mode to align code with the tab key (single line and block selection)
Editor formats to highlight existing code
Docs and Usage
Editor plugin repository
Classic Editor Live-Demo
Markdown
Markdown fenced code blocks
Inline Syntax Highlighting via backtick code (including language specific addon)
Docs and Usage
Compatibility/Migration
Crayon compatibility mode (use EnlighterJS highlighting for legacy Crayon pre codeblocks)
CodeColorer compatibility mode (use EnlighterJS highlighting for legacy CodeColorer shortcodes)
Jetpack markdown compatibility mode (generic or raw highlighting)
Gutenberg standard codeblock compatibility mode (no language attributes)
Extensions
bbPress shortcode + markdown code blocks support
Dynamic Content via jQuery Ajax.load
Dynamic Content via Jetpack.InfiniteScroll
Texteditor/Shortcodes (Legacy)
Shortcodes are deprecated and should be used in text editor mode only – never use them within Gutenberg Editor or Classic Editor!
Easy to use Text-Editor mode through the use of Shortcodes and QuickTags
Shortcodes within content, comments and widgets
Standalone Shortcode-Processor to avoid wpautop filter issues in Text-Editor Mode
Supported Languages (build-in)
In case your language is not available try the Generic Mode which covers a lot of programming languages – or request a new language on GitHub
Related Links
Enlighter Plugin Docs + Tutorials
Enlighter Plugin on GitHub
EnlighterJS Documentation
Compatibility
All modern webbrowsers with enabled Javascript and HTML5 capabilities for “data-” attributes are compatible with Enlighter. It’s possible that it may work with earlier/other browsers.
Chrome 60+
Firefox 60+
Safari 11+
Edge Browser 10+
