2012. 11. 19. 22:50

티스토리 code highlight 1.5 적용

원본글 : http://gyuha.tistory.com/193

 

 

SyntaxHighlighter_1.5.1.rar

 

 

압축을 푼후 style,script 를 모두 업로드

 

skin.html에 추가

<link type="text/css" rel="stylesheet" href="./images/SyntaxHighlighter.css"></link>

</body> 바로 위에 추가

 

<script class="javascript" src="./images/shCore.js"></script>
<script class="javascript" src="./images/shBrushCSharp.js"></script>
<script class="javascript" src="./images/shBrushCpp.js"></script>
<script class="javascript" src="./images/shBrushCss.js"></script>
<script class="javascript" src="./images/shBrushDelphi.js"></script>
<script class="javascript" src="./images/shBrushJScript.js"></script>
<script class="javascript" src="./images/shBrushJava.js"></script>
<script class="javascript" src="./images/shBrushPhp.js"></script>
<script class="javascript" src="./images/shBrushPython.js"></script>
<script class="javascript" src="./images/shBrushRuby.js"></script>
<script class="javascript" src="./images/shBrushSql.js"></script>
<script class="javascript" src="./images/shBrushVb.js"></script>
<script class="javascript" src="./images/shBrushXml.js"></script>
<script class="javascript">
    dp.SyntaxHighlighter.ClipboardSwf = './images/clipboard.swf';
    dp.SyntaxHighlighter.HighlightAll('code');
</script>

사용법

html모드에서 class 해당언어 설정

<pre name="code" class="java">
   ... some code here ...
</pre>

 

언어  명칭
C++ cpp, c, c++
C# c#, c-sharp, csharp
CSS css
Delphi delphi, pascal
Java java
Java Script js, jscript, javascript
PHP php
Python py, python
Ruby rb, ruby, rails, ror
Sql sql
VB vb, vb.net
XML/HTML xml, html, xhtml, xslt