react-remarkable
A React component for rendering Markdown with remarkable
Last updated 7 years ago by mxstbr .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install react-remarkable 
SYNC missed versions from official npm registry.

react-remarkable

A React component for rendering Markdown with remarkable.

npm install --save react-remarkable

Usage


var React = require('react');
var Markdown = require('react-remarkable');

var MyComponent = React.createClass({

  render() {
    return (
      <div>
        {/* Pass Markdown source to the `source` prop */}
        <Markdown source="**Markdown is awesome!**" />

        {/* Or pass it as children */}
        {/* You can nest React components, too */}
        <Markdown>{`
          ## Reasons React is great

          1. Server-side rendering
          2. This totally works:

          <SomeOtherAmazingComponent />

          Pretty neat!
        `}</Markdown>
      </div>
    );
  }

});

Available props:

  • options - Hash of Remarkable options
  • source - Markdown source. You can also pass the source as children, which allows you to mix React components and Markdown.
  • container - Element to use as container. Defaults to div.

Syntax Highlighting

Atom

You can enable syntax highlighting in Atom using the following steps:

Go to Settings > Packages > language-babel Settings > Enter this for JavaScript Tagged Literal Grammar Extensions:

"(?<=<Markdown>{)":source.gfm

screen shot 2017-05-28 at 9 04 27 am

Shortly you'll see that markdown syntax highlighting is enabled.

screen shot 2017-05-28 at 9 06 31 am

License

MIT

Current Tags

  • 1.1.3                                ...           latest (7 years ago)

5 Versions

  • 1.1.3                                ...           7 years ago
  • 1.1.2                                ...           7 years ago
  • 1.1.1                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (2)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE