<commit_before>
A custom element that loads a resource, applies highlight.js and displays it as a code listing.

Currently it is hard coded to use the 'tomorrow' highlight.js theme.

The `src/code-block.js` contains a script that uses
[custom elements](http://w3c.github.io/webcomponents/spec/custom/) and the
[shadow DOM](http://w3c.github.io/webcomponents/spec/shadow/). A script for
highlight.js needs to be explicitly included. The CSS has been inlined into the
script and does not need to be added.

The `src/code-block.html` contains an
[HTML import](http://w3c.github.io/webcomponents/spec/imports/) that uses
[custom elements](http://w3c.github.io/webcomponents/spec/custom/), the
[shadow DOM](http://w3c.github.io/webcomponents/spec/shadow/) and
[HTML templates](https://html.spec.whatwg.org/multipage/scripting.html#the-template-element).<commit_msg>Updated README.<commit_after>
# Listing Web Component

The Listing Web Component provides a web component that allows code listings to
be easily embedded into your website.
I started development on this after discovering that I was
[unable to embed Gists in XHTML pages](https://www.mattunderscore.com/article/42).

It provides a custom element that loads a resource, applies highlight.js and
displays it as a code listing.

Currently it is hard coded to use the 'tomorrow' highlight.js theme.

The `src/code-block.js` contains a script that uses
[custom elements](http://w3c.github.io/webcomponents/spec/custom/) and the
[shadow DOM](http://w3c.github.io/webcomponents/spec/shadow/).
A script for highlight.js needs to be explicitly included.
The CSS has been inlined into the script and does not need to be added.

The `src/code-block.html` contains an
[HTML import](http://w3c.github.io/webcomponents/spec/imports/) that uses
[custom elements](http://w3c.github.io/webcomponents/spec/custom/), the
[shadow DOM](http://w3c.github.io/webcomponents/spec/shadow/) and
[HTML templates](https://html.spec.whatwg.org/multipage/scripting.html#the-template-element).
{'fraction_non_alphanumeric': 0.11336633663366337, 'fraction_numerical': 0.005940594059405941, 'mean_word_length': 4.7578347578347575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1129451', 'n_tokens_mistral': 607, 'n_tokens_neox': 596, 'n_words': 203}