Skip to content

Latest commit

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

react-remarkable

A React component for rendering Markdown with remarkable.

npm install --save react-remarkable

Usage

varReact=require('react');varMarkdown=require('react-remarkable');varMyComponent=React.createClass({render(){return(<div>{/* Pass Markdown source to the `source` prop */}<Markdownsource="**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

About

A React component for rendering Markdown with remarkable

Resources

Stars

457 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages