티스토리 뷰
웹접근성을 고려한 개발에 관심이 많다면 에디터에도 관심이 많을 것이라고 생각합니다.
에디터로 인해서 피치 못하게 접근성을 놓치는 경우가 있을 수 있기 때문입니다.
물론 본인의 경험과 실력 향상을 위해 직접 구현을 하는 것도 좋다고 생각하지만,
기존의 오픈소스를 활용하는 것도 좋은 방법이라고 생각합니다.
라이센스
Summernote may be freely distributed under the MIT license.
라고 명시되어 있습니다. 무료라고 생각하시면 됩니다.
우선, 서머노트 홈페이지에 들어갑니다. http://summernote.org/
Github 주소 : https://github.com/summernote/summernote
서머노트는 부트스트랩과 jQuery를 기본으로 사용하고 있기 때문에 두가지를 꼭 명시 해야 합니다.
1 2 3 4 5 6 7 |
서머노트 선언 | cs |
1 2 3 4 5 6 7 8 | $(document).ready(function() { $('#summernote').summernote({ height: 300, // set editor height minHeight: null, // set minimum height of editor maxHeight: null, // set maximum height of editor focus: true // set focus to editable area after initializing summernote }); }); | cs |
$(document).ready(function() {
$('#summernote').summernote();
});
스크립트로 서머노트를 선언해야 합니다.
또한, 서머노트의 옵션이 다양하게 있으니 선언시에 이러한 사항을 고려하시면 됩니다.
1 2 3 | <textarea name="content" id="summernote" value=""></textarea> | cs |
- https://github.com/summernote/awesome-summernote 어섬서머노트.
- 이곳에서 보면 커스텀된 기능이 정말 많다.
emoji 를 사용할 수 있다.
- https://api.github.com/emojis 이곳의 이모티콘을 사용할 수 있다.
- 사용법은 summernote 의 API를 보고 따라해야 한다.
코드미러를 지원한다.
- 코드미러에 대해서 우선 공부를 좀 해야 이해가 되겠지?
Codemirror as codeview
If you include a
CodeMirror
on a page, you can use CodeMirror to Codeview. Include jQuery, Bootstrap and CodeMirror with summernote.
<!-- include libraries(jQuery, bootstrap) -->
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js"></script>
<!-- include codemirror (codemirror.css, codemirror.js, xml.js, formatting.js) -->
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.css">
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/theme/monokai.css">
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/xml/xml.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/2.36.0/formatting.js"></script>
<!-- include summernote css/js-->
<link href="summernote.css">
<script src="summernote.js"></script>
Initialize Summernote with codemirror options
$('.summernote').summernote({
height: 150, //set editable area's height
codemirror: { // codemirror options
theme: 'monokai'
}
});
위의 내용처럼 에디터에 입력 후 코드미러의 적용 유무를 가지고 살펴본다.
1. 코드미러 미적용.
2. 코드미러 적용.
코드미러란,
CodeMirror는 각종 컴퓨터 프로그램 코드를 웹상에서 쾌적한 환경으로 편집할 수 있도록 구축하는데 도움주는 자바스크립트 라이브러리이다.
Plugin list
Below is useful plugin list.
For more plugin lists, visit to awesome-summernote.
멘션을 보내는 기능, 단어 힌트 기능 등등이 있다.
Integration3rd parties available in django, rails, angular and so on.
Django
Handy update for your django admin page.
Ruby On Rails
This gem was built to gemify the assets used in Summernote.
AngularJS
AngularJS directive to Summernote.
Apache Wicket
Summernote widget for Wicket Bootstrap.
Webpack
Example about using summernote with webpack.
Meteor
Example about using summernote with meteor.
'API' 카테고리의 다른 글
Postcodify 오픈소스 도로명주소 검색 API (0) | 2017.07.29 |
---|---|
C3.js 차트 API (0) | 2017.07.25 |
Chart.js 사용법 / 적용법 (0) | 2017.07.25 |
NicEdit ( WYSIWYG textarea 를 대체하여 사용. ) (0) | 2017.07.23 |
핸들바스 handlebars (0) | 2017.07.23 |
- Total
- Today
- Yesterday
- 힘냉면록
- 톰캣
- 최고심
- html
- input
- Oracle
- 오라클
- node관리
- floating button
- Eclipse
- 성수밥
- Mac
- 아파치
- jstree
- SQL
- 맥
- Lalavel
- server.xml
- 성수뚝떡
- 이클립스
- 터미널
- 조직도관리
- tree로만들기
- 르프리크
- Tomcat
- 위잇딜라이트
- Apach
- 토라식당
- 메뉴관리
- 정규식
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |