사용방법
글 입력 시 <pre lang="LANGUAGE" line="1">
와 </pre> 사이에 해당 코드를 기입해주면 된다.
예제 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, 라인번호를 15번부터 시작
<pre lang="ruby" line="15">
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>
지원하는 언어들
다음의 언어들을 지원한다:
abap, actionscript, actionscript3, ada, apache, applescript, aptsources, asm, asp, autoit, avisynth, bash, bf, bibtex, blitzbasic, bnf, boo, c, cmac, caddcl, cadlisp, cil, cfdg, cfm, cmake, cobol, cpp-qt, cpp, csharp, css, d, dcs, delphi, diff, div, dos, dot, eiffel, email, erlang, fo, fortran, freebasic, genero, gettext, glsl, gml, bnuplot, groovy, haskell, hq9plus, html4strict, idl, ini, inno, intercal, io, java, java5, javascript, kixtart, klonec, klonecpp, latex, lisp, locobasic, lolcode lotusformulas, lotusscript, lscript, lsl2, lua, m68k, make, matlab, mirc, modula3, mpasm, mxml, mysql, nsis, oberon2, objc, ocaml-brief, ocaml, oobas, oracle11, oracle8, pascal, per, pic16, pixelbender, perl, php-brief, php, plsql, povray, powershell, progress, prolog, properties, providex, python, qbasic, rails, rebol, reg, robots, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, tcl, teraterm, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xml, xorg_conf, xpp, z80
(굵은 글씨는 인기 있는 언어임)
출처 : http://wordpress.org/extend/plugins/wp-syntax/other_notes/
번역 및 편집 : 임민형
gggg
^^
1234
아이폰테스트
The WP syntax error is most commonly found in systems while the coding process is being done. This is a useful post that will definitely help the programmers to the core and will enable them to do it more effectively.