Present code with style

使用 spectacle 来展示代码的风格。(Present code with style using spectacle.)

  • Owner: jamiebuilds/spectacle-code-slide
  • Platform: Linux, Mac, Windows
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

spectacle-code-slide

使用 spectacle 展示代码的风格。

老兄,您刚更改了代码演示游戏 - @kenwheeler

安装

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

用法

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>
    );
  }
}

语法高亮

PrismJS 提供。有关文档,请参阅 http://prismjs.com/

Main metrics

Overview
Name With Ownerjamiebuilds/spectacle-code-slide
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
PlatformLinux, Mac, Windows
License:MIT License
所有者活动
Created At2016-03-26 22:26:57
Pushed At2018-11-16 16:42:17
Last Commit At2018-01-09 16:26:22
Release Count16
Last Release Namev0.5.2 (Posted on 2018-01-09 16:26:22)
First Release Namev0.1.0 (Posted on 2016-03-26 15:31:28)
用户参与
Stargazers Count4.2k
Watchers Count51
Fork Count168
Commits Count54
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count11
Pull Requests Open Count6
Pull Requests Close Count9
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

spectacle-code-slide

Present code with style using spectacle.

Dude, you just changed the code presentation game@kenwheeler

Install

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

Usage

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. See http://prismjs.com/ for docs.