项目作者: arturfsousa

项目描述 :
Megadraft embed plugin
高级语言: JavaScript
项目地址: git://github.com/arturfsousa/megadraft-embed.git
创建时间: 2016-10-06T19:48:26Z
项目社区:https://github.com/arturfsousa/megadraft-embed

开源协议:MIT License

下载


megadraft-embed - Megadraft Plugin Build Status codecov

Megradraft plugin to embed media URLs.

Supported Medias

We support the following medias:

  • Twitter: Users should provide a valid twitter post URL like:
    https://twitter.com/RedeGlobo/status/840532910696361984.

If you need some other media, check the section: Add new sources above.

Usage

Include the plugin in the plugins prop of your Megadraft instance.

  1. import React from "react";
  2. import ReactDOM from "react-dom";
  3. import Megadraft from "megadraft";
  4. import plugin from "megadraft-embed";
  5. class Example extends React.Component {
  6. render(){
  7. return (
  8. <Megadraft plugins={[plugin]} ></Megadraft>
  9. );
  10. }
  11. }
  12. ReactDOM.render(<Example ></Example>, document.getElementById("container"));

Contributing

Install, run, test.

  1. # Install npm dependencies
  2. make setup
  3. # Gulp dev-server task with webpack + sass running on http://localhost:8080/
  4. make run
  5. # Run mocha tests + eslint
  6. make test

If you’re constantly running tests, there’s a faster alternative using mocha’s
watch feature:

  1. make watch_unit

Add new sources

Releasing

There’s a prepublish script entry on package.json that runs build tasks
before publishing the package.

  1. npm publish

Third Party

The sample plugin uses the extension icon from https://design.google.com/icons/
under Apache License Version 2.0.

Social Medias: