블로그에 소스를 삽입 하자!




1.  The latest SyntaxHighlighter version is 3.0.83download.

shttp://alexgorbatchev.com/SyntaxHighlighter/download/


2. syntaxhighlighter_3.0.83\scripts 의 파일들을 모두 업로드한다.  shCore.js and shCore.css) 

3. D:\downloads\syntaxhighlighter_3.0.83\syntaxhighlighter_3.0.83\styles 의 파일 중, 

shCore.css 그외 테마들 중에 선태해서 업로드한다 ( 나는, shCoreRDark.css )


4. skin.html에 css와 js를 include한다. 


* css (shCore.css 와 사용할 테마.css)


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


* js


필요한 js를 모두 import 한다.

<script type="text/javascript">
    SyntaxHighlighter.all();

</script>




http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html


5. 설치는 끝.


* 사용 방법

<pre /> method
 
function test()
{
alert('test');
}

<script /> method
<script type="syntaxhighlighter" class="brush: js">
<![CDATA[
  /**
   * SyntaxHighlighter
   */
  function foo()
  {
      if (counter <= 10)
          return;
      // it works!
  }
]]>
</script>



* brush


Brush name

Brush aliases

File name

ActionScript3as3, actionscript3shBrushAS3.js
Bash/shellbash, shellshBrushBash.js
ColdFusioncf, coldfusionshBrushColdFusion.js
C#c-sharp, csharpshBrushCSharp.js
C++cpp, cshBrushCpp.js
CSScssshBrushCss.js
Delphidelphi, pas, pascalshBrushDelphi.js
Diffdiff, patchshBrushDiff.js
Erlangerl, erlangshBrushErlang.js
GroovygroovyshBrushGroovy.js
JavaScriptjs, jscript, javascriptshBrushJScript.js
JavajavashBrushJava.js
JavaFXjfx, javafxshBrushJavaFX.js
Perlperl, plshBrushPerl.js
PHPphpshBrushPhp.js
Plain Textplain, textshBrushPlain.js
PowerShellps, powershellshBrushPowerShell.js
Pythonpy, pythonshBrushPython.js
Rubyrails, ror, rubyshBrushRuby.js
ScalascalashBrushScala.js
SQLsqlshBrushSql.js
Visual Basicvb, vbnetshBrushVb.js
XMLxml, xhtml, xslt, html, xhtmlshBrushXml.js



기타 사용 방법 참조

http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html



반응형

+ Recent posts