Sample dan CSS yang digunakan
CSS (Copy CSS ini ke Template)
.hljs-comment,.hljs-quote{color:#7e7777}
.hljs-variable,.hljs-template-variable,.hljs-attribute,.hljs-tag,.hljs-name,.hljs-regexp,.hljs-link,.hljs-name,.hljs-selector-id,.hljs-selector-class{color:#ca4949}
.hljs-number,.hljs-meta,.hljs-built_in,.hljs-builtin-name,.hljs-literal,.hljs-type,.hljs-params{color:#b45a3c}
.hljs-string,.hljs-symbol,.hljs-bullet{color:#4b8b8b}
.hljs-title,.hljs-section{color:#7272ca}
.hljs-keyword,.hljs-selector-tag{color:#8464c4}
.hljs-deletion,.hljs-addition{color:#1b1818;display:inline-block;width:100%}
.hljs-deletion{background-color:#ca4949}
.hljs-addition{background-color:#4b8b8b}
.hljs{display:block;overflow-x:auto;background:#1b1818;color:#8a8585;padding:0.5em}
.hljs-emphasis{font-style:italic}
.hljs-strong{font-weight:bold}
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;