A React component for rendering Markdown with GitHub Flavored Markdown support
npm install markdown-react-viewerThis is a simple markdown viewer built with React. It uses the remark-gfm parser to parse the markdown and then renders it using React components.
You can try out the editor using storybook in the following link:
https://takeshy.github.io/markdown-react-viewer
jsx
import React from 'react';
import MarkdownViewer from 'markdown-react-viewer';export default function SampleViewer() {
return (
markdown="# Read Only Editor",
className="markdown-body",
style={{fontSize: '1.5em'}}
/>
)
}
`Direct Initialization
You can also initialize the editor directly on an HTML element:
you use rails importmap, add the following line to your importmap.rb
※ @latest is the latest version of wysimark-lite. If you want to specify a version, replace @latest with the version you want to use.
`
pin "markdown-react-viewer", to: "https://cdn.jsdelivr.net/npm/markdown-react-viewer@latest/dist/index.js"
``html
`run storybook
`bash
npm run storybook
``