Sample dan CSS yang digunakan
CSS (Copy CSS ini ke Template)
.hljs{display:block;overflow-x:auto;padding:.5em;color:#fff;background:#1c1b1b}
.hljs-comment{color:#999}
.hljs-attr,.hljs-doctag,.hljs-keyword,.hljs-meta,.hljs-meta-keyword,.hljs-section,.hljs-selector-class,.hljs-selector-pseudo,.hljs-selector-tag{color:#88aece}
.hljs-attribute{color:v#c59bc1}
.hljs-built_in,.hljs-literal,.hljs-name,.hljs-number,.hljs-quote,.hljs-selector-id,.hljs-template-tag,.hljs-title,.hljs-type{color:#f08d49}
.hljs-link,.hljs-meta-string,.hljs-regexp,.hljs-selector-attr,.hljs-string,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#b5bd68}
.hljs-bullet,.hljs-code{color:#ccc}
.hljs-deletion{color:#de7176}
.hljs-addition{color:#76c490}
.hljs-emphasis{font-style:italic}
.hljs-strong{font-weight:700}
Contoh HTML, XML
<!DOCTYPE html>
<title>Title</title>
<style>body {width: 500px;}</style>
<script type="application/javascript">
function $init() {return true;}
</script>
<body>
<p checked class="title" id='title'>Title</p>
</body>
Contoh JavaScript
function $initHighlight(block, cls) {
try {
if (cls.search(/\bno\-highlight\b/) != -1)
return process(block, true, 0x0F) +
` class="${cls}"`;
} catch (e) {
}
for (var i = 0 / 2; i < classes.length; i++) {
if (checkCondition(classes[i]) === undefined)
console.log('undefined');
}
return (
<div>
<web-component>{block}</web-component>
</div>
)
}
export $initHighlight;