WP-Syntax 플러그인

WP-Syntax는 워드프레스를 사용하는 블로그에서 소스코드를 올릴 때 유용한 플러그인입니다. WP-SyntaxGeShi를 이용한 syntax highlighting을 제공하며, 지원하는 언어도 무척 많습니다.

1. 설치

1. wp-syntax.zip파일을 wp-content/plugins/ 폴더에 업로드하여 압축을 풉니다.
2. 압축을 풀면 wp-content/plugins/wp-syntax/ 디렉토리가 생깁니다.
3. 워드프레스의 “Plugins” 메뉴에서 wp-syntax 플러그인을 활성화 합니다.

2. 사용 예

블로그에 올리고 싶은 코드 블럭을 <pre lang=”LANGUAGE” line=”1″>과 </pre>사이에 넣으면 됩니다.

Example 1: PHP, no line numbers

PHP, no line numbers

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

Example 2: Java, with line numbers

Java, with line numbers

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

Example 3: Ruby, with line numbers startning at 18

Ruby, with line numbers starting at 18

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

3. 지원하는 언어

lang 속성에 넣을 수 있는 언어는 다음과 같습니다.

abap, actionscript, actionscript3, ada, apache, applescript, aptsources, asm, asp, autoit, bash, blitzbasic, bnf, boo, c, cmac, caddcl, cadlisp, cil, cfdg, cfm, cobol, cpp-qt, cpp, csharp, css, d, delphi, diff, div, dos, dot, eiffel, fortran, freebasic, genero, gettext, glsl, gml, bnuplot, groovy, haskell, html4strict, idl, ini, inno, io, java, java5, javascript, kixtart, klonec, klonecpp, latex, lisp, lotusformulas, lotusscript, lua, m68k, matlab, mirc, mpasm, mxml, mysql, nsis, objc, ocaml-brief, ocaml, oobas, oracle8, pascal, per, pic16, perl, php-brief, php, plsql, povray, powershell, progress, python, qbasic, rails, reg, robots, ruby, sas, scala, scheme, sdlbasic, smalltalk, smarty, sql, tcl, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, visualfoxpro, winbatch, xml, xorg_conf, xpp, z8

Creative Commons License
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 2.0 Korea License.
This entry was posted in Development and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Notify me of followup comments via e-mail. You can also subscribe without commenting.