Posts Tagged ‘Wordpress’

h1

How do I post source code?

May 5, 2008

Reference

WordPress에서 source code를 넣을 때는

[sourcecode language='css']…[/sourcecode]

와 같이 사용하면 되고 현재 지원되는 언어는 다음과 같습니다.
* cpp
* csharp
* css
* delphi
* html
* java
* jscript
* php
* python
* ruby
* sql
* vb
* xml
(보기)

지원되지 않는 언어는 source-highlight를 이용해서 얻은 html code를 붙여넣으니 괜찮게 나오네요.
source-highlight -i source.sh -o source.html
줄 번호도 붙이고 싶을 때는 -n option을 사용합니다.(보기)