[WordPress] 外掛分享: WP Chili

首頁外掛目錄 › WP Chili
10+
安裝啟用
尚無評分
5746 天前
最後更新
問題解決
WordPress 2.1+ v1.2 上架:2008-03-11

內容簡介

這個 WordPress 外掛使用Chili(捆綁版本為 2.2)為您的網站提供簡單的代碼高亮功能:

切換到 code 標簽
在 <code class="lang"></code> 標簽中插入您的代碼片段
使用您要突出顯示的語言替換上述的 lang

範例

<code class="php">echo "&lt;script&gt;alert( 'Hello ' + $name );&lt;/script&gt;";</code>
<code class="javascript">alert( 'Hello ' + $name );</code>

提示

如果您要保留空格,請將代碼放置在 <pre><code class="lang"></code></pre> 標簽中
為 <pre> 元素添加“ln-”類,以添加行號
請查看 Chili 官網以獲取許多配置選項
在版本 1.2 中,chili/recipes.js 是您需要的配方所在的文件。因此,如果需要,可以在那里添加/刪除配方。默認情況下,它包含 html、css、javascript 和 php

外掛標籤

開發者團隊

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

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

原文外掛簡介

Easy code highlighting for WordPress with Chili (the bundled version is 2.2):

Switch to the code tab
Put your code snippet inside tags
Replace the above lang with the language to highlight

Examples

echo "<script>alert( 'Hello ' + $name );</script>";
alert( 'Hello ' + $name );

Tips

Put your code inside

tags if you want to preserve white space
Add an “ln-” class to the

 element to add line numbers
Read the Chili site for many config options
In version 1.2, the file chili/recipes.js is the one which contains the recipes you need. So, add/remove recipes there if you need to. By default it contains html, css, javascript, and php

延伸相關外掛

文章
Filter
Apply Filters
Mastodon