아래 소스 부분을 customize -> Edit HTML -> <head>와 <head> 사이에 넣으면 된다.
1) 구문 강조할 프로그래밍 언어 스크립트( shCore.js
는 필수 나머진 원하는 스크립트만 넣어도 됨)
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'></script>
2)테마 부분 (http://alexgorbatchev.com/SyntaxHighlighter/manual/themes/ 에서 shThemeRDark.css를 원하는 테마로 변경하여 선택할 수 있다 단 shCore.css는 필수
)
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/>
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeRDark.css' rel='stylesheet' type='text/css'/>
3) 설정 부분(http://alexgorbatchev.com/SyntaxHighlighter/manual/configuration/ 을 참고하여 아래 코드에 코드를 추가 하면 된다)
<script type="text/javascript">
SyntaxHighlighter.all();
</script>
4) 포스트 작성시 HTML선택 일반 소스코드 앞부분에 <pre class="brush: js"> 마지막 부분에 </pre> 를 추가
( brush: js 의 js는 자바스크립트를 가리키는 것이므로 c++을 원하면 cpp 를 넣어주면 된다
자세한 것은 http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/ 의 Brush aliases 항목을 참고)
<pre class="brush: js">
/** * SyntaxHighlighter */
function foo()
{
if (counter <= 10)
return;
// it works!
}
</pre>
댓글