# @magoo/spectacle-code-slide

> Present code with style.

Latest version **0.5.3** (published 2018-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @magoo/spectacle-code-slide
pnpm add @magoo/spectacle-code-slide
yarn add @magoo/spectacle-code-slide
bun add @magoo/spectacle-code-slide
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.3 |
| Published | 2018-12-06 |
| First published | 2018-12-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 6.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 1 |
| Author | James Kyle |
| Maintainers | adaschevici |

## Links

- npm: https://www.npmjs.com/package/@magoo/spectacle-code-slide
- Repository: https://github.com/adaschevici/spectacle-code-slide
- Homepage: https://github.com/adaschevici/spectacle-code-slide#readme
- Issues: https://github.com/adaschevici/spectacle-code-slide/issues
- npm.io page: https://npm.io/package/@magoo/spectacle-code-slide

## Dependencies (7)

- [spectacle](https://npm.io/package/spectacle.md) ^5.2.2
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.0
- [lodash.clamp](https://npm.io/package/lodash.clamp.md) ^4.0.1
- [component-raf](https://npm.io/package/component-raf.md) ^1.2.0
- [lodash.memoize](https://npm.io/package/lodash.memoize.md) ^4.0.1
- [component-tween](https://npm.io/package/component-tween.md) ^1.2.0
- [lodash.padstart](https://npm.io/package/lodash.padstart.md) ^4.2.0

## Recent versions

- 0.5.3 (latest) — 2018-12-06

## README

# [spectacle](http://stack.formidable.com/spectacle)-code-slide

Present code with style using [spectacle](https://github.com/FormidableLabs/spectacle).

<img src="demo.gif" width="400"/>

> _Dude, you just changed the code presentation game_ – [@kenwheeler](https://github.com/kenwheeler)

## Install

```
$ npm install --save spectacle
$ npm install --save spectacle-code-slide
```

## Usage

```js
import React from 'react';
import { Spectacle, Deck } from 'spectacle';
import CodeSlide from 'spectacle-code-slide';
import shiaLabeoufMagicGif from "./shiaLabeoufMagic.gif"
import preloader from "spectacle/lib/utils/preloader";

preloader({
  shiaLabeoufMagicGif
});

export default class Presentation extends React.Component {
  render() {
    return (
      <Spectacle theme={theme}>
        <Deck transition={[]} transitionDuration={0} progress="bar">
          // ...
          <CodeSlide
            transition={[]}
            lang="js"
            code={require("raw-loader!../assets/code.example")}
            ranges={[
              { loc: [0, 270], title: "Walking through some code" },
              { loc: [0, 1], title: "The Beginning" },
              { loc: [1, 2] },
              { loc: [1, 2], note: "Heres a note!" },
              { loc: [2, 3] },
              { loc: [4, 7], image: shiaLabeoufMagicGif },
              { loc: [8, 10] },
              // ...
            ]}/>
          // ...
        </Deck>
      </Spectacle>
    );
  }
}
```

## Syntax Highlighting

Provided by [PrismJS](https://github.com/PrismJS/prism). See http://prismjs.com/ for docs.

---
_Source: https://npm.io/package/@magoo/spectacle-code-slide · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
