AcidJs.XHilite is a syntax highlighter HTML5 Web Component, based on Lea Verou‘s Prism.JS and wrapped as a custom tag with support for multiple languages and both declarative and async loading of the code to be highlighted.
HTML Attributes of the Tag
Any native HTML attribute (
style, etc.) is supported, plus the component-specific:
language– The language to highlight, for example
"markup"(usable with HTML, SVG, XML, etc.). Check prismjs.com for a complete list of supported languages.
width– Optional width in pixels of the code block, for example:
height– Optional height in pixels of the code block, for example:
src– Instead of adding the code to highlight in the tag, you can specify path to the file which content needs to be highlighted, for example:
document.querySelector, etc. as well as their jQuery or other libraries aliases).
Check the screenshots below or go straight to the demo and download: