Skip to content

๐Ÿ”ฅMarkdown ์„ ์ด์šฉํ•œ ๋ฌธ์„œํŽธ์ง‘์„ ๋„์™€์ฃผ๋Š” React ์ „์šฉ Markdown Editor ์ž…๋‹ˆ๋‹ค.

Notifications You must be signed in to change notification settings

LineGu/Markdown_Editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


Markdown์œผ๋กœ ๋ฌธ์„œ ํŽธ์ง‘์„ ๊ฐ„๋‹จํ•˜๊ฒŒ!


๐Ÿคฉ์ฃผ์š” ์„œ๋น„์Šค

Markdown Editor๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ๋ชจ๋ฐ”์ผ ๋ฐ˜์‘ํ˜•๊ณผ Dark Mode๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.


Markdown Editor

Develog Markย ย ย ย ย ย ย Develog Mark

๊ธฐ๋ณธ์ ์ธ ๋””์ž์ธ์€ Velopert ๋‹˜์˜ Velog ์„œ๋น„์Šค๋ฅผ Clone ํ•˜์˜€์Šต๋‹ˆ๋‹ค.


Tool Bar

Tool Bar


๊ธฐ๋Šฅ

  1. Tool Bar๋ฅผ ์ด์šฉํ•ด์„œ ํ•œ๋ฒˆ์— ์ž‘์„ฑ์ค‘์ธ ๋ฌธ์„œ๋ฅผ ํŽธ์ง‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (Bold, Italic, Header, Quote, Check Box, Img, Table, Code ๋“ฑ)
  2. Tool Bar๋ฅผ ์ด์šฉํ•œ ๋ฌธ์„œ ํŽธ์ง‘ ์‹œ Cursor๋ฅผ ์ž๋™์œผ๋กœ ์ƒํ™ฉ์— ๋งž๊ฒŒ ์ด๋™์‹œ์ผœ ๋ฐ”๋กœ ์ž‘์—…์— ๋Œ์ž…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค! (ํŽธ์ง‘ ๋ฐฉ์‹์— ๋”ฐ๋ผ ์ƒ์ด)
  3. ๋ฌธ์„œ์— Tag๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ๊ฒ€์ƒ‰ ์‹œ ํŽธ๋ฆฌํ•˜๊ณ , ๋ฌธ์„œ๋“ค์„ ์„ธ๋ถ€์ ์œผ๋กœ ๋ถ„๋ฅ˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  4. ๊ธ€์„ ์ž‘์„ฑํ•˜๋ฉด ๋ฐ”๋กœ๋ฐ”๋กœ Previewํ‹€ ํ†ตํ•ด ์‹ค์‹œ๊ฐ„์œผ๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค!
  5. Text์˜ ๋ณ€ํ™”๊ฐ€ ์žˆ๋‹ค๋ฉด(Header, Bold, Italic ๋“ฑ) ๊ธ€์˜ ์ž‘์„ฑ๋ž€์—๋„ ๋ฐ˜์˜์ด ๋ฉ๋‹ˆ๋‹ค.
  6. Drag and Drop ๋ฐ ํŒŒ์ผ ์„ ํƒ์œผ๋กœ Img๋ฅผ ๋ฐ”๋กœ ํ˜ธ์ŠคํŒ…ํ•˜๊ณ  ๊ธ€์— ์ ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (Imgur API ์‚ฌ์šฉ)
  7. ํ‘œ(Table) ์ถ”๊ฐ€๋ฅผ ์‹œ๊ฐ์ ์œผ๋กœ ํŽธ๋ฆฌํ•˜๊ฒŒ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (์•„๋ž˜ ์‚ฌ์ง„ ์ฐธ๊ณ )
Markdown exampleย ย ย ย ย ย ย Table example

๊ธฐ์ˆ ์ ์ธ ๊ฒฝํ—˜ ๋ฐ ๊ฐœ๋ฐœํ•œ ๊ธฐ๋Šฅ

  • Toolbar๋ฅผ ์ œ๊ณตํ•˜์—ฌ ์‚ฌ์šฉ์ž๊ฐ€ ๋ฌธ์„œ ํŽธ์ง‘์— ํŽธ๋ฆฌํ•˜๋„๋ก ๊ฐœ๋ฐœ
    • Bold, Italic, Header, Quote, Check Box, Img, Table, Code, Link
  • Toolbar๋ฅผ ์ด์šฉํ•œ ํŽธ์ง‘ ์ดํ›„์— ์ปค์„œ๋ฅผ ์ž๋™์œผ๋กœ ์ด๋™์‹œ์ผœ UX ํ–ฅ์ƒ (ํŽธ์ง‘ ์ข…๋ฅ˜์— ๋”ฐ๋ผ ๋‹ค๋ฅด๊ฒŒ ๋™์ž‘)
  • ํ˜„์žฌ Cursor์˜ ์œ„์น˜, Selection์˜ ์—ฌ๋ถ€์— ๋”ฐ๋ผ ๋‹ค๋ฅธ ๋™์ž‘์„ ํ•˜์—ฌ, ์ง๊ด€์ ์ธ ๋ฌธ์„œ ํŽธ์ง‘์ด ๊ฐ€๋Šฅํ•˜๋„๋ก ๊ตฌํ˜„ (HackMD ๋ฐฉ์‹ ์ฐจ์šฉ)
  • ์ด๋ฏธ์ง€๋ฅผ Drag & Drop์œผ๋กœ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ๋„๋ก ๊ตฌํ˜„
  • ์ด๋ฏธ์ง€ ํ˜ธ์ŠคํŒ… ๊ธฐ๋Šฅ ๊ตฌํ˜„
  • ์ด๋ฏธ์ง€์˜ ์—…๋กœ๋“œ ์ค‘, ์—…๋กœ๋“œ ์ง„ํ–‰ ์ƒํƒœ๋ฅผ ์‹ค์‹œ๊ฐ„์œผ๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋„๋ก ๊ตฌํ˜„
  • ํ‘œ ์ถ”๊ฐ€ ์‹œ ์ง๊ด€์ ์œผ๋กœ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ๋„๋ก Microsoft Word์˜ ํ‘œ ์ถ”๊ฐ€ ๋ฐฉ์‹ ๊ตฌํ˜„
  • Context API ๋ฅผ ์ด์šฉํ•œ ์ƒํƒœ ๊ด€๋ฆฌ
  • Class๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ Edit Logic์„ ๋ถ„๋ฆฌํ•˜๊ณ , Edit์ด ์ถ”๊ฐ€๋  ๋•Œ๋ฅผ ๋Œ€๋น„ํ•˜์—ฌ ์ฝ”๋“œ ๊ตฌ์กฐ๋ฅผ ์„ค๊ณ„
  • ๋ฏธ๋””์–ด ์ฟผ๋ฆฌ๋ฅผ ์ด์šฉํ•œ ๋ฐ˜์‘ํ˜• ์›น ์ œ์ž‘
  • Dark Mode ์™€ Light Mode ์ง€์›

๋ฐœ์ƒํ•œ ์ด์Šˆ ๋ฐ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

  • ๋ฌธ์„œ ์ž‘์„ฑ ๊ณต๊ฐ„์„ Textarea๋กœ ์‚ฌ์šฉํ•˜์—ฌ Textarea ๋‚ด Text์˜ ํฌ๊ธฐ๋‚˜ Style์„ ์ปจํŠธ๋กค ํ•  ์ˆ˜ ์—†๋Š” ์ด์Šˆ

    โ†’ Div์™€ contenteditable๋ฅผ ์ด์šฉํ•˜์—ฌ Textarea๋ฅผ ๋Œ€์ฒดํ•˜๊ธฐ๋กœ ํ•˜์˜€๊ณ , ์ด์™€ ์ปค์„œ์˜ ์œ„์น˜๊นŒ์ง€ ํ•จ๊ป˜ ์ œ๊ณตํ•ด์ฃผ๋Š” Codemirror ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉ

  • Toolbar์— ์ƒˆ๋กœ์šด Edit ๋ฐฉ์‹์ด ์ถ”๊ฐ€๋  ๊ฒฝ์šฐ ๊ตฌ์กฐ๊ฐ€ ๋งค์šฐ ๋ณต์žกํ•˜์—ฌ ๊ฐ ๋กœ์ง์ด ์—‰ํ‚ค๋Š” ๊ฒฝ์šฐ ๋ฐœ์ƒ

    โ†’ ๊ฐ Edit์„ ๋‹ด๋‹นํ•˜๋Š” Class๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ๊ฐ Edit๋ณ„๋กœ ๊ณตํ†ต์ ์ด๋‚˜ ์ฐจ์ด์ ์„ ๊ธฐ์ค€์œผ๋กœ Class์˜ ๊ณ„์ธต๊ตฌ์กฐ๋ฅผ ๋ถ„๋ฆฌํ•จ. ์ด๋กœ์จ ๋กœ์ง์„ ์‹คํ–‰์‹œํ‚ค๋Š” Execute Method์— Instance๋งŒ ๊ฐˆ์•„ ๋ผ์›Œ ์ฃผ๋Š” ๋ฐฉ์‹์œผ๋กœ ๋ณ€๊ฒฝ(์ƒˆ๋กœ์šด Edit ๋ฐฉ์‹ ์ถ”๊ฐ€์— ์šฉ์ด). ๋˜ํ•œ, interface๋กœ ์„ค๊ณ„๋ฅผ ์ถ”์ƒํ™”ํ•˜์—ฌ ์•ž์œผ๋กœ ์ถ”๊ฐ€๋  ๋ฐฉ์‹์—์„œ๋„ ํœด๋จผ ์—๋Ÿฌ๋ฅผ ๋ฐฉ์ง€ํ•จ.

  • Client์˜ ์‚ฌ์šฉ์ž ํ™”๋ฉด์ด ๋งค์šฐ ์ž‘์•„์ง€๋ฉด ํŽธ์ง‘ํ•˜๊ธฐ ์–ด๋ ค์›Œ์ง€๋Š” ์ด์Šˆ.

    โ†’ ๋ฏธ๋””์–ด ์ฟผ๋ฆฌ๋ฅผ ์ด์šฉํ•˜์—ฌ ํŠน์ • ํฌ๊ธฐ ๋””์Šคํ”Œ๋ ˆ์ด ์ดํ•˜์—์„œ๋Š” ์ง€์› ๋ถˆ๊ฐ€ ๋ฉ”์‹œ์ง€ ํ‘œ์‹œ

About

๐Ÿ”ฅMarkdown ์„ ์ด์šฉํ•œ ๋ฌธ์„œํŽธ์ง‘์„ ๋„์™€์ฃผ๋Š” React ์ „์šฉ Markdown Editor ์ž…๋‹ˆ๋‹ค.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published