티스토리 뷰
SyntaxHighlighter 3.0.83 이용하기
SyntaxHighlighter 홈페이지 : http://alexgorbatchev.com/SyntaxHighlighter/
오른쪽 위의 다운로드에서 다운을 받습니다.
1. 다운받은 파일의 압축을 풀어줍니다.
2. Tistory 관리페이지에서 [HTML/CSS 편집] 메뉴 클릭합니다.
3. 오른쪽 위의 [ HTML | CSS | 파일업로드 ] 칸에서 파일업로드를 클릭합니다.
4. 파일업로드화면에서 추가를 눌러주고 다운받은 SyntaxHighlighter폴더에서 scripts 파일과 styles 파일을 모두 추가 시켜줍니다.
5. 그 다음 [ HTML | CSS | 파일업로드 ] HTML을 선택하고 </head> 태그 앞에 아래의 코드를 복사해서 넣어줍니다.
<
link
href
=
"./images/shCore.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"./images/shThemeDefault.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
script
type
=
"text/javascript"
src
=
"./images/shCore.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushJScript.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shLegacy.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushBash.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushCpp.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushCSharp.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushCss.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushDelphi.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushDiff.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushGroovy.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushJava.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushPhp.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushPlain.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushPython.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushRuby.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushScala.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushSql.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushVb.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"./images/shBrushXml.js"
></
script
>
<
script
type
=
"text/javascript"
>
SyntaxHighlighter.defaults["toolbar"] = false; // 툴바없애기
SyntaxHighlighter.defaults["auto-links"] = false; // 자동 링크없애기
SyntaxHighlighter.defaults["tab-size"] = 2; // 탭사이즈를 2로 설정
SyntaxHighlighter.all();
그런 다음 아래와 같은 방식으로 소스코드를 작성해 주면 끝
<pre class="brush: html"> 소스코드 </pre>