Last active
May 26, 2017 11:42
-
-
Save MunifTanjim/9a6413b3ba584ae68330856ed19888cd to your computer and use it in GitHub Desktop.
Gist Embedder - Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Gist Embedder</title> | |
<script src='https://unpkg.com/gist-embedder/dist/gist-embedder.min.js'></script> | |
</head> | |
<body> | |
<code | |
data-gist-id='9a6413b3ba584ae68330856ed19888cd'> | |
</code> | |
<script> | |
var gistEmbedder = new GistEmbedder() | |
gistEmbedder.embedAll() | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Install as npm package: | |
* npm install gist-embedder | |
*/ | |
const GistEmbedder = require('gist-embedder') | |
let gistEmbedder = new GistEmbedder() | |
let gistToEmbed = document.querySelector(`[data-gist-id='9a6413b3ba584ae68330856ed19888cd']`) | |
gistEmbedder.embed(gistToEmbed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment