react-markdown2

0.11.6 • Public • Published

npm version Build Status Total downloads

Dependency Status devDependency Status

markdown

Yet another react component to render markdown.

Install

npm install --save react-markdown2

Usage

import React, {Component} from "react";
import Markdown from "react-markdown2";
 
class Example extends Component {
    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>
                    {`
                    ## Header
                    1. One
                    2. Two
                    `}
 
                    <div>Nested component</div>
 
                    {`Test`}
                </Markdown>
            </div>
        )
    }
}

Webpack build pipeline

See webpack.config.js as an example how to integrate this package into your webpack pipeline, i.e. you need to use the following webpack plugins:

  • extract-text-webpack-plugin
  • style-loader
  • sass-loader
  • css-loader
  • postcss-loader
  • webpack-sources

TODO

  • Use markdown-it to render markdown content
  • Use prismjs for syntax highlighting
  • Diagrams
  • KaTeX
    • basic integration
    • import katex css
  • MathJax
  • Auto-embeddable links
    • Video services
      • youtube
      • vimeo
      • vine
      • daylymotion
      • viddler
      • blip.tv
      • liveleak
      • ted
      • ustream
    • Audio services
      • soundcloud
    • Code snippets
      • github gist
      • codepen
      • ideone
      • jsbin
      • jsfiddle
      • plunker
    • Social media
      • twitter
      • facebook
    • Maps
      • google maps
  • Unified diff fence blocks
  • Automatically detect and render diff patch blocks
  • Integrate/implement embed.js features
  • render HTML content if content-type is not markdown
  • allow to extend markdown rendering with markdown-it plugins

Licence

MIT. See LICENSE.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.11.69latest

Version History

VersionDownloads (Last 7 Days)Published
0.11.69
0.11.50
0.11.40
0.11.30
0.11.20
0.11.11
0.11.00
0.10.580
0.10.570
0.10.560
0.10.550
0.10.540
0.10.530
0.10.520
0.10.510
0.10.501
0.10.490
0.10.480
0.10.470
0.10.450
0.10.440
0.10.430
0.10.421
0.10.410
0.10.400
0.10.390
0.10.380
0.10.370
0.10.360
0.10.350
0.10.340
0.10.330
0.10.320
0.10.310
0.10.300
0.10.290
0.10.280
0.10.270
0.10.260
0.10.250
0.10.240
0.10.230
0.10.220
0.10.210
0.10.200
0.10.190
0.10.180
0.10.170
0.10.160
0.10.150
0.10.140
0.10.130
0.10.120
0.10.111
0.10.100
0.10.90
0.10.80
0.10.70
0.10.60
0.10.50
0.10.40
0.10.30
0.10.20
0.10.10
0.10.00
0.9.00
0.8.10
0.8.00
0.7.00
0.6.00
0.5.10
0.5.00
0.4.50
0.4.40
0.4.30
0.4.20
0.4.10
0.4.00
0.3.00
0.2.00
0.1.00

Package Sidebar

Install

npm i react-markdown2

Weekly Downloads

13

Version

0.11.6

License

MIT

Last publish

Collaborators

  • sergeyt