內容簡介
這個 WordPress 外掛使用Chili(捆綁版本為 2.2)為您的網站提供簡單的代碼高亮功能:
切換到 code 標簽
在 <code class="lang"></code> 標簽中插入您的代碼片段
使用您要突出顯示的語言替換上述的 lang
範例
<code class="php">echo "<script>alert( 'Hello ' + $name );</script>";</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
外掛標籤
開發者團隊
原文外掛簡介
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延伸相關外掛
