Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

코드미러를 적용하면 에디터의 '소스 보기' 에서 코드 편집을 원활하게 할 수 있습니다.

코드미러를 적용하지 않았을 때 '소스 보기'코드미러를 적용했을 때 '소스 보기'

Code Mirror 사이트에서 js 파일과 css 파일을 다운받아 경로를 추가해 주거나, CDN 을 이용해 코드미러를 적용할 수 있습니다.
또는 사이냅 에디터 패키지의 externals 디렉토리에 포함된 codemirror 스크립트 파일을 사용하셔도 됩니다.

package externals 사용

package 하위 externlas codeMirror script file 사용

index.html
<!-- code mirror -->
<script type="text/javascript" src='../resource/codemirror.min.js'></script>
<script type="text/javascript" src="../resource/xml.min.js"></script>
<link rel='stylesheet' href='../resource/codemirror.min.css'>


CDN 을 이용한 적용

에디터가 설치된 html 파일 <head> 태그에 아래 내용을 추가합니다.

index.html
<!-- code mirror -->
<script type="text/javascript" src='https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/codemirror.min.js'></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/mode/xml/xml.min.js"></script>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/codemirror.min.css'>
  • No labels