Joomla!, Wordpress tips for building your site

How to show source code highlight with WordPress

Published on| November 18th, 2009 | No Comment.

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>

見え方

<div id="foo">
<?php
  function foo() {
    echo "Hello World!\n";
  }
?></div>

例 2: Java, 行番号あり

<pre lang="java" line="1">
public class Hello {
  public static void main(String[] args) {
    System.out.println("Hello World!");
  }
}
</pre>

見え方

1
2
3
4
5
public class Hello {
  public static void main(String[] args) {
    System.out.println("Hello World!");
  }
}

例 3: Ruby, 行番号あり(開始行番号18行目を指定)

<pre lang="ruby" line="18">
class Example
  def example(arg1)
    return "Hello: " + arg1.to_s
  end
end

</pre>

見え方

18
19
20
21
22
class Example
  def example(arg1)
    return "Hello: " + arg1.to_s
  end
end

例 4: html エスケープコードを使う場合、オプションにescaped="true" 指定すると正しく表示できます。

<pre lang="xml" escaped="true">
&lt;xml&gt;Hello&lt;/xml&gt;
</pre>

Appearance

<xml>Hello</xml>





Comments

Leave a Reply








Transrator

Recent Posts

Categories

Tag Cloud

execute remove フロントページ 投稿ページ トップページ install WIndows Note Convert META generator 日付 donwload file manage multibyte utf-8 unicode shiftjis euc console サイトマップ 問題 ParmaLink Redirect パーマリンク はみ出る pre テンプレート テーマ タグクラウド マルチランゲージ リダイレクト PHP(タグ) タグ table control HTML(タグ) コマンド 国際化(翻訳) SQLite(タグ) MySQL(タグ) qTranslate プラグイン(タグ) Wordpress(タグ)

Links

Site Description

Joomla!, Wordpress as CMS using a site building, site management, software usage to describe the development tips.

  • はてなブックマークへ追加する
  • Facebookでシェアする
  • twitter でつぶやく
  • Google Plusでシェアする
  • Pocketでシェアする
ページトップへ