內容簡介
儘管 WordPress 上已經有兩款外掛可用,但我決定從頭自己寫一個。結果是一個極簡但功能強大的外掛,只有大約 250 行 PHP 代碼。
支援 Prism 的所有可能配置。
為 bash、css、js、markup、php、scss 添加 TinyMCE 下拉列表輕松嵌入 <code class="language-xxx"> 和 <pre class="language-xxx">。(如果您想添加更多,我可以製作一個過濾器。)
只在需要時加載 Prism,而不是每個頁面都加載。
支援自動檢測 Prism 的 HTML。
支援使用 [prism] 簡碼顯示自訂字段中的代碼。
開發人員可以使用 prism 句柄來排隊預先註冊的腳本和樣式。
具有管理員編輯器按鈕,可快速添加簡碼模板片段。
出於設計考慮,沒有選項頁面。
閱讀更多 -> Prism Syntax Highlighter for WordPress
打包的 Prism 版本(2016-09-17)
連結:http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript+bash+less+php&plugins=line-highlight+line-numbers+wpd+show-language
皮膚:Okaida
語言
Markup
CSS
C-like
JavaScript
Bash
PHP
Sass(Scss)
外掛
行高亮
行號
WebPlatform Docs
顯示語言
外掛標籤
開發者團隊
② 後台搜尋「Prism Syntax Highlighter for WordPress」→ 直接安裝(推薦)
原文外掛簡介
Despite two plugins already on wordpress.org I decided to write my own from scratch. The result is a minimalistic but powerful plugin with only ~250 lines of PHP.
Supports every possible Prism configuration.
Adds TinyMCE dropdown lost for and
for bash, css, js, markup, php, scss. (I can make a filter if you want to add more.)
Does not load prism on every page, only when needed.
Supports automatic detection of prism HTML.
Supports displaying code from custom fields with [prism] shortcode.
Developers may use the prism handle to enqueue the pre-registered script and style.
Has admin editor button for quick shortcode template snippet.
Has no options page by design.
Read more -> Prism Syntax Highlighter for WordPressBundled Prism Version (2016-09-17)
Link: http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript+bash+less+php&plugins=line-highlight+line-numbers+wpd+show-language
Skin: Okaida
LanguagesMarkup
CSS
C-like
JavaScript
Bash
PHP
Sass (Scss)Plugins
Line Highlight
Line Numbers
WebPlatform Docs
Show Language延伸相關外掛
