logo

한국어

[XE] Syntax Highlighter 설치

관리자 2018.07.16 18:32 조회 수 : 7

■다운로드: https://github.com/syntaxhighlighter/syntaxhighlighter/releases/tag/3.0.83
■참조: http://reslee.kr/59
■Brush aliases: http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/
■CSS Themes: http://alexgorbatchev.com/SyntaxHighlighter/manual/themes/
 

■ XE에 적용하기

XE 관리자 페이지에서
"사이트 디자인 설정 > 레이아웃 > 상세 설정 > 헤더 스크립트"에 아래를 추가.
(Syntax Highlighter 설치 디렉토리가 <www root>/syntaxhighlighter일 경우)

 

<script type="text/javascript" src="/syntaxhighlighter/scripts/XRegExp.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src='/syntaxhighlighter/scripts/shAutoloader.js'></script>
<!-- <script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushAppleScript.js"></script> -->
<!-- <script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushAS3.js"></script> -->
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushBash.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushColdFusion.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushCpp.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushCSharp.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushCss.js"></script>
<!-- <script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushDelphi.js"></script> -->
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushDiff.js"></script>
<!-- <script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushErlang.js"></script> -->
<!-- <script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushGroovy.js"></script> -->
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushJava.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushJavaFX.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushPerl.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushPhp.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushPlain.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushPowerShell.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushPython.js"></script>
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushRuby.js"></script>
<!-- <script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushSass.js"></script> -->
<!-- <script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushScala.js"></script> -->
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushSql.js"></script>
<!-- <script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushVb.js"></script> -->
<script type="text/javascript" src="/syntaxhighlighter/scripts/shBrushXml.js"></script>
<!-- <script type="text/javascript" src="/syntaxhighlighter/scripts/shLegacy.js"></script> -->
<link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shCore.css"/>
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shCoreDefault.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shCoreDjango.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shCoreEclipse.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shCoreEmacs.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shCoreFadeToGrey.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shCoreMDUltra.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shCoreMidnight.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shCoreRDark.css" /> -->
<link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shThemeDefault.css" />
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shThemeDjango.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shThemeEclipse.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shThemeEmacs.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shThemeFadeToGrey.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shThemeMDUltra.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shThemeMidnight.css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="/syntaxhighlighter/styles/shThemeRDark.css" /> -->
<script type="text/javascript">SyntaxHighlighter.all();</script>

 


■ 사용방법

게시물 편집 시 아래와 같은 식으로 brush:<언어>를 넣어주고 ...에 소스코드를 넣어주면 끝.

<pre class='brush: java'>
...
</pre>

 

■ Brush aliases

  • as3, actionscript3
  • bash, shell
  • cf, coldfusion
  • c-sharp, csharp
  • cpp, c
  • css
  • delphi, pas, pascal
  • diff, patch
  • erl, erlang
  • groovy
  • js, jscript, javascript
  • java
  • jfx, javafx
  • perl, pl
  • php
  • plain, text
  • ps, powershell
  • py, python
  • rails, ror, ruby
  • scala
  • sql
  • vb, vbnet
  • xml, xhtml, xslt, html, xhtml