React Markdown
Install
yarn add react prismjs @nju33/react-markdown
Example
import { Markdown } from '@nju33/react-markdown'
// ...
return <Markdown contents={markdownContents} />
If you put a code, additionally import a prismjs theme too.
import 'path/to/your-favorite-theme.css'
If you want to use your favorite element, you can use it.
For instance, If you would like to use my favorite Heading component pass to the MarkdownRenderer
.
import { MarkdownRenderer, Markdown } from '@nju33/react-markdown'
// ...
return (
<MarkdownRenderer
value={{
Heading: MyFavoriteHeading
}}>
<Markdown contents={markdownContents} />
</MarkdownRenderer>
)
Contributors ✨
Thanks goes to these wonderful people (emoji key):
純 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!