1.1.1 • Published 7 years ago

cute-md-editor v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

cute-md-editor

It's a Markdown text editor field :tada:

  • Uses Showdown to do the converting bewteeen markdown and HTML
  • Pretty & simple interface
  • Plops well into other projects
  • Made with :heart:

TODO's

  • Drag n Drop file uploads
  • Smarter toolbar buttons
  • Get the bundle size smaller (Probably get rid of FontAwesome)

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

1.1.1

7 years ago

1.1.0

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago