內容簡介
此外掛使用Sunburst主題,一個色彩繽紛且高對比度的暗色彩主題,使用Highlight.js來突顯您的程式碼語法。Highlight.js具有精確、快速、輕量和易於使用等特點。
使用方式
短碼方法:
在 WordPress 頁面或文章中,將[prettify] [/prettify]短碼包圍在您要突顯的程式碼片段周圍。
您可以通過在短碼內指定語言擴展名來指定一種語言。
範例:
[prettify class=”html”] [/prettify]
短碼可從視覺化編輯器或HTML編輯器中使用。
非短碼方法:
在
中包圍您的程式碼片段。
您可以通過在元素中指定class來指定語言。
範例:
<pre><code class="html">
僅Sunburst
此外掛僅包含Sunburst主題語法突出顯示格式的CSS檔,因為它是最佳的暗色語法主題。如果(出於某種原因)您希望使用其他主題突出顯示您的程式碼,Highlight.js主題庫中提供了其他語法突出顯示主題可供選擇。
支援的語言:
Bash
C#
C++
CSS
Diff
HTML, XML
Ini
Java
JavaScript
PHP
Perl
Python
Ruby
SQL
外掛標籤
開發者團隊
原文外掛簡介
This plugin uses the Sunburst theme, a colorful and high contrast dark theme to highlight your code syntax with Highlight.js. Highlight.js is accurate, fast, lightweight and easy to use.
Usage
Short-code method:
From within a WordPress page or post, wrap the [prettify][/prettify] shortcode around the code snippet you wish to highlight.
You can specify a language by specifying the language extension inside the shortcode.
Example:
[prettify class=”html”][/prettify]
The shortcode will work from within either the Visual or HTML editor.
Non-short-code method:
Wrap your code snippets in “
.
You can specify a language by specifying a class in the element.
Example:
Sunburst Only
This plugin only contains the CSS file for the Sunburst theme syntax highlighting formatting, because it is the best dark syntax theme. If (for some reason) you wanted to highlight your code using a different theme, there are other syntax highlighting themes available in the Highlight.js Theme Gallery
Languages Supported:
Bash
C#
C++
CSS
Diff
HTML, XML
Ini
Java
JavaScript
PHP
Perl
Python
Ruby
SQL
延伸相關外掛
