Mojolicious::Plugin::LinkEmbedder::Link::Text::GistGithub - gist.github.com link
This class inherit from Mojolicious::Plugin::LinkEmbedder::Link::Text.
This is an example output:
<div class="link-embedder text-gist-github" id="link_embedder_text_gist_github_42">$gist</div> <script> window.link_embedder_text_gist_github_$ID = function(g) { delete window.linkembedder_textgistgithub42; document.getElementById('link_embedder_text_gist_github_42').innerHTML = g.div; if(window.link_embedder_text_gist_github_styled++) return; var s = document.createElement('link'); s.rel = 'stylesheet'; s.href = g.stylesheet; document.getElementsByTagName('head')[0].appendChild(s); }; </script> <script src="https://gist.github.com/$media_id.json?callback=linkembedder_textgistgithub42"></script>
The number "42" is generated dynamically by this module. $gist is the raw text from the gist.
$gist
The GitHub stylesheet will not be included if the container document has already increased window.link_embedder_text_gist_github_styled.
window.link_embedder_text_gist_github_styled
$str = $self->media_id;
Example $str: "/username/123456789".
$str
Returns the HTML code for a script tag that writes the gist.
Jan Henning Thorsen
To install Mojolicious::Plugin::LinkEmbedder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::LinkEmbedder
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::LinkEmbedder
For more information on module installation, please visit the detailed CPAN module installation guide.