ToastUI
: NHN์์ ์ง์ํ๋ ๋ฌด๋ฃ ์์ง์ ์๋ํฐ
๐๐ปํ ์คํธ UI ์๋ํฐ ๊ฐ์ ๋ฐ ํํ ๋ฆฌ์ผ
๐๐ป TOAST UI Editor๋ CDN์ ํตํด ์ค์น์์ด ์ฌ์ฉํ ์ ์๋ค.
CodePen
: ํ๋ก ํธ์๋ ์น ๊ฐ๋ฐ์ ํนํ๋ ์จ๋ผ์ธ ์ฝ๋ ํธ์ง๊ธฐ
์ฝ๋
HTML
<script src="https://uicdn.toast.com/editor/latest/toastui-editor-all.min.js"></script>
<link rel="stylesheet" href="https://uicdn.toast.com/editor/latest/toastui-editor.min.css" />
<div id="viewer-1"></div>
CSS
body {
margin: 0;
}
@font-face {
font-family: "GmarketSansMedium";
src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff")
format("woff");
font-weight: normal;
font-style: normal;
}
#viewer-1 {
padding: 0 10px;
}
html > body,
html > body .toastui-editor-contents {
font-family: "GmarketSansMedium";
}
JS
const Editor = toastui.Editor;
const viewer1 = Editor.factory({
el: document.querySelector("#viewer-1"),
viewer: true,
initialValue: `
# ์๋
ํ์ธ์.
## ๋ฐ๊ฐ์์.
- ํํ
- ํธํธ
- ํํ
`
});
์คํ ๊ฒฐ๊ณผ
+ ์ฐธ๊ณ ํ๋ฉด ์ข์ ์ฌ์ดํธ
๋๋ : ํฐํธ๋ฅผ ๋ฌด๋ฃ๋ก ๋ค์ด๋ฐ์ ์ฌ์ฉํ ์ ์๋ ์ฌ์ดํธ
์์์ ์ฌ์ฉํ ํฐํธ๋ ์ง๋ง์ผ ํฐํธ