gist-embedder

0.2.0 • Public • Published

Gist Embedder

Library for Embedding GitHub Gist.

npm license

Installation

Using npm

$ npm install gist-embedder

Using CDN

<script src="https://unpkg.com/gist-embedder/dist/gist-embedder.min.js">
</script> 

Usage

Initialize Gist Embedder with the following script:

var gistEmbedder = new GistEmbedder()
gistEmbedder.embedAll()

Now, you can embed gists by their ID:

<code data-gist-id='<ID>'></code>

You can also supply additional options as data attributes (starting with data-gist-).

Available Options

Live Demo

data-gist-id

(required)

ID of the Gist. Example: 9a6413b3ba584ae68330856ed19888cd

data-gist-file

(optional)

Filename to embed from multi-file gist. Example: main.js

data-gist-lines

(optional)

Lines to display. Example: 1-5,7,9-13

data-gist-highlight

(optional)

Lines to highlight. Example: 2-5,9-12

data-gist-no-footer

(optional)

Hide the footer. Example: true

data-gist-no-gutter

(optional)

Hide the gutter (line numbers. Example: true

License

Gist Embedder is licensed under the MIT License. Check the LICENSE file for details.

Readme

Keywords

Package Sidebar

Install

npm i gist-embedder

Weekly Downloads

13

Version

0.2.0

License

MIT

Last publish

Collaborators

  • muniftanjim