How to show source code highlight with WordPress
To highlight the WordPress source code is Yappari plug.
If WordPress is adding a feature is not available from only one of the themes or plug-in, plug Yappari.
In this respect, Joomla! The minute there is a plug-in modules and habitat isolation, after we become easier to manage.
(At first, you need to understand the habitat isolation it.)
Time, is pleased to introduce, WP-Syntax is a plug-in.
This plug-in, GeSHi plug-in with a very is good.(GeSHi is, php is using Kodohairaitaraiburari.)
The beta version so far is that the author is particularly問題Rashii could not be confirmed.
Contact download, Http://Wordpress.org/Extend/Plugins/Wp-Syntax/ is.
Immediately, try using.
Install the plug-in as normal Plugins- Add New- [Upload]From where to download from where you downloaded the ZIP file and install it.
After installation, enable the plug-in.
Then uses an embedded code in the article.
The following is an example of use.例 1: PHP, 行番号なし
<pre lang="php">
<div id="foo">
<?php
function foo() {
echo "Hello World!\n";
}
?>
</div>
</pre>
見え方
|
例 2: Java, 行番号あり
<pre lang="java" line="1">
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
</pre>
見え方
|
|
例 3: Ruby, 行番号あり(開始行番号18行目を指定)
<pre lang="ruby" line="18">
class Example
def example(arg1)
return "Hello: " + arg1.to_s
end
end
</pre>
見え方
|
|
例 4: html エスケープコードを使う場合、オプションにescaped="true"
指定すると正しく表示できます。
<pre lang="xml" escaped="true">
<xml>Hello</xml>
</pre>
Appearance
|
You might also like:
Comments
Leave a Reply