NAME
Mojolicious::Plugin::LinkEmbedder::Link::Text::GistGithub - gist.github.com link
DESCRIPTION
This class inherit from Mojolicious::Plugin::LinkEmbedder::Link::Text.
OUTPUT HTML
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.
The GitHub stylesheet will not be included if the container document has already increased window.link_embedder_text_gist_github_styled
.
ATTRIBUTES
media_id
$str = $self->media_id;
Example $str
: "/username/123456789".
provider_name
METHODS
to_embed
Returns the HTML code for a script tag that writes the gist.
AUTHOR
Jan Henning Thorsen