react-gist

Github Gist React component

MIT 7 个版本
安装
npm install react-gist
yarn add react-gist
pnpm add react-gist
bun add react-gist
README

react-gist

NPM

Use this component to add a github gist on your website.

Preview

Get the id from the gist url https://gist.github.com/{your_name}/{id} and set it as a property of the component.

Example

Single-file gist:

var React = require('react');
var Gist = require('react-gist');

React.render(
    <Gist id='5104372' />,
    document.body
);

Edit react-gist-example-single-file

Multi-file gist:

var React = require('react');
var Gist = require('react-gist');

React.render(
    <Gist id='5995ea726914f280afb3' file='Chef-Dockerfile' />,
    document.body
);

Edit react-gist-example-multi-file

Usage

<Gist id={string} file={string} />

  • id {string} Id of the gist
  • file {string} Name of a specific file in a multi-file gist

License

MIT, see LICENSE.md for details.

版本列表
1.2.4 2021-11-03
1.2.2 2020-07-16
1.2.1 2018-01-19
1.2.0 2017-12-17
1.1.0 2017-02-20
1.0.1 2014-11-17
1.0.0 2014-10-30