Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
X-Tag contributed tags
tag: xtag-code-v0.0…

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
code
README.md
xtag.json

README.md

X-Tag Contributed Tags

x-code

Creates a highlighted code snippet using highlight.js.

Usage

<x-code data-lang="javascript">function() {
    console.log('hi');
}
var foo=1, bar="baz";
</x-code>

Dynamically create an x-code tag:

var code = document.createElement('x-code');
code.text = 'var foo = "bar";';
document.body.appendChild(code);

Be sure to include code.css somewhere in your stylesheets.

See Highlight.js docs for more info.

Something went wrong with that request. Please try again.