dpaez / choo-md-editor

Markdown Editor built with Choo / for Choo.

Home Page:https://dbtek.github.io/choo-md-editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Choo Markdown Editor Standard - JavaScript Style Guide

Markdown Editor built with Choo / for Choo. It can be used inside a Choo app or as a standalone library.

screenshot

Install

 $ npm i -S choo-md-editor

Usage

choo-md-editor depends on some parts of Bulma styles. If you use Bulma in your project use choo-md-editor.bulma.css instead of whole choo-md-editor.css.

Material Icons are being used please include it's css too.

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Standalone Library

  const element = document.getElementById('editor-container')
  const editor = require('choo-md-editor')
  editor(element, {onChange: (val) => console.info('Markdown changed', val)})

Inside choo app

  app = choo()
  ...
  app.model(require('choo-md-editor/model'))
  ...
  const editor = require('choo-md-editor/component')
  const mainView = (state, prev, send) => {
    html `
      <div>
        $editor(state, send)
      </div>
    `
  }

Credits

Author

İsmail Demirbilek @dbtek

About

Markdown Editor built with Choo / for Choo.

https://dbtek.github.io/choo-md-editor

License:MIT License


Languages

Language:JavaScript 81.7%Language:CSS 11.2%Language:HTML 7.1%