코드를 예쁘게 넣는 방법은 많은 방법이 있지만, 쉽게 접근 할수 있는 것!!
바로 Syntax Highlighter
1. Syntax Highlighter Download!!
http://alexgorbatchev.com/SyntaxHighlighter/download
Syntax Highlighter 공식 홈페이지에서 다운로드 받을 수 있다.
2.파일 업로드!!
압축풀면 아래의 폴더가 있다.
- Scripts
- Styles
용량압박이 없다면 모두 업로드 하자!
티스토리에서 Tistory 관리 -> HTML/CSS 편집 -> 파일 업로드 -> 추가 경로 따라가서 업로드해준다.
3.HTML수정!!
***이부분이 중요!!
1. Tistory 관리 >> HTML/CSS 편집 으로 들어가</head>를 찾은 후 바로뒤에 태그 삽입한다.
<
script
type
=
"text/javascript"
src
=
"./images/shCore.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/shBrushJScript.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
>
<
link
type
=
"text/css"
rel
=
"stylesheet"
href
=
"./images/shCore.css"
>
<
link
type
=
"text/css"
rel
=
"stylesheet"
href
=
"./images/shThemeDefault.css"
>
<
script
type
=
"text/javascript"
>
SyntaxHighlighter.all();
</
script
>
2. <body>을 찾아서 아래의 내용으로 덥어씌운다.
-
<body Onload="dp.SyntaxHighlighter.HighlightAll('code');">4.Syntax Highlighter적용!!
작성할때는 HTML타입으로 변경해야한다!!
이제 적용만 하면된다.
적용법은 다음과 같다.
<
textarea
name
=
"code"
class
=
"brush:원하는 언어;"
>
에디터 모드에서 이 사이에 코드를 작성
</
textarea
>
<textarea name=
"code"
class
=
"brush:cpp;"
>
#include <stdio.h>
void
main(){
}
</textarea>
Brush name
Brush aliases
File name
as3, actionscript3
shBrushAS3.js
bash, shell
shBrushBash.js
cf, coldfusion
shBrushColdFusion.js
c-sharp, csharp
shBrushCSharp.js
cpp, c
shBrushCpp.js
css
shBrushCss.js
delphi, pas, pascal
shBrushDelphi.js
diff, patch
shBrushDiff.js
erl, erlang
shBrushErlang.js
groovy
shBrushGroovy.js
js, jscript, javascript
shBrushJScript.js
java
shBrushJava.js
jfx, javafx
shBrushJavaFX.js
perl, pl
shBrushPerl.js
php
shBrushPhp.js
plain, text
shBrushPlain.js
ps, powershell
shBrushPowerShell.js
py, python
shBrushPython.js
rails, ror, ruby
shBrushRuby.js
scala
shBrushScala.js
sql
shBrushSql.js
vb, vbnet
shBrushVb.js
xml, xhtml, xslt, html, xhtml
shBrushXml.js
'알면 유용!! > Tip' 카테고리의 다른 글
[VMwarewin]창크기 조절 (0) | 2015.11.24 |
---|---|
원격시 Administrator 로만 로그인이 된다????? (0) | 2015.10.05 |
[english]How to use the makefile (0) | 2015.04.29 |
[GnuWin32]ARM GCC 컴파일러환경(1) - Windows편 (0) | 2015.04.28 |
[arm-none-eabi]ARM GCC 컴파일러환경(2) - Windows편 (0) | 2015.04.17 |