@timberio/smackdown

A markdown and syntax highlighting library built for React

Usage no npm install needed!

<script type="module">
  import timberioSmackdown from 'https://cdn.skypack.dev/@timberio/smackdown';
</script>

README

Installation

yarn add @timberio/smackdown

Usage

import javascript from 'react-syntax-highlighter/languages/prism/javascript'
import { duotoneLight } from 'react-syntax-highlighter/styles/prism'
import { Markdown, registerPrism } from '@timberio/smackdown'

// Register the required languages
registerPrism('javascript', javascript)

const syntax = {
  lineNumbers: true,
  theme: duotoneLight,
  renderer: 'prism'
}

// Render in React
<Markdown
  source="# Some markdown stuff"
  syntax={syntax}
/>

Demos & Storybook

https://smackdown.netlify.com