Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.forkbox Use dockerhub image Aug 23, 2018
other Add readme and license Aug 25, 2018
packages v0.1.2 Aug 26, 2018
.gitignore Ignore talk Aug 23, 2018
license Add readme and license Aug 25, 2018
package.json v0.1.2 Aug 26, 2018
readme.md Fix typo Aug 26, 2018
yarn.lock Add oao Aug 26, 2018

readme.md

Code Surfer <🏄/>

Contribute with Forkbox

React component for scrolling, zooming and highlighting code.

How to use with mdx-deck

Add the dependency (and raw-loader if you want to load the code from a file):

$ yarn add --dev mdx-deck-code-surfer raw-loader

And then use it from your .mdx:

---

import { CodeSurfer } from "mdx-deck-code-surfer"

<CodeSurfer
  title="Some Title"
  notes="Start with this note"
  code={require("!raw-loader!./my-snippet.js")}
  showNumbers={false}
  dark={false}
  steps={[
    { lines: [6], notes: "Note for the first step" },
    { range: [5, 9] },
    { tokens: { 9: [3, 4, 5] }, notes: "Note for the third step" }
  ]}
/>

---

Related / Credits

License

Released under MIT license.