mdx-code

2.0.0 • Public • Published

mdx-code

A MDX Deck Layout that renders code blocks on a slide as a Runnable RunKit playground. Only for JavaScript (Node)

Install

yarn add --exact mdx-code

Use

import Code from 'mdx-code';
 
# Regular Slide
 
---
 
<Code>
 
```js A playground slide!
console.log('Hello world');
```
 
</Code>
 

1

Preambles

A slide can have two code blocks. The first code block is run before the second, but the playground only displays the second.

<Code>
 
```js
const x = [1, 2, 3];
```
```js x is already defined
x.map(i => i*2);
```
 
</Code>

2

Authors

Dependencies (2)

Dev Dependencies (6)

Package Sidebar

Install

npm i mdx-code

Weekly Downloads

8

Version

2.0.0

License

MIT

Unpacked Size

198 kB

Total Files

3

Last publish

Collaborators

  • pranaygp