Skip to content

denvaar/cute-md-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cute-md-editor

It's a Markdown text editor field 🎉

screen shot 2017-06-11 at 4 19 27 pm

  • Uses Showdown to do the converting bewteeen markdown and HTML
  • Drag n drop file upload (optional)
  • Pretty & simple interface
  • Plops well into other projects
  • Made with ❤️

TODO's

  • Drag n Drop file uploads
  • Smarter toolbar buttons
  • Get the bundle size smaller (Probably get rid of FontAwesome)
    • update: Down to 22 Kb

Install

It's published using Node Package Manager, so...

npm install cute-md-editor

Then just use it in your project as you please:

import MarkdownEditor from 'cute-md-editor';

// <MarkdownEditor />

Usage

It's designed to work as a normal React component, but if you want to render it on the DOM as a stand alone form field, you can utilize the elementId and elementName props.

Available props:

  • content -- Initial content for the editor field.
  • elementId -- An id that will be placed on the underlying textarea.
  • elementName -- A name that will be placed on the underlying textarea.
/* example using axios */
import axios from 'axios';

const callback = (files) => {
  let data = new FormData();
  data.append("expected_field_name_goes_here", files);
  return axios.post("/path/to/image/upload/endpoint", data);
};

/* example using whatwg-fetch */
import 'whatwg-fetch';

const callback = (files) => {
  let formData = new FormData();
  formData.append("expected_field_name_goes_here", files);
  let data = {
    method: 'POST',
    body: formData
  };
  return fetch("/path/to/image/upload/endpoint", data);
};

License

MIT

About

Markdown text editor field

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published