Created
November 19, 2018 14:19
-
-
Save ggrossetie/4b44db7b60724ceb3d969a449f30a48a to your computer and use it in GitHub Desktop.
Asciidoctor.js Gist extension
This file contains hidden or 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
registry.blockMacro(function () { | |
const self = this; | |
self.named('gist') | |
self.process(function (parent, target, attrs) { | |
const titleHTML = attrs.title ? `<div class="title">${attrs.title}</div>\n` : '' | |
const html = `<div class="openblock gist"> | |
${titleHTML}<div class="content"> | |
<script src="https://gist.github.com/${target}.js"></script> | |
</div> | |
</div>` | |
return self.createBlock(parent, 'pass', html, attrs, {}) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment