Sample dan CSS yang digunakan
CSS (Copy CSS ini ke Template)
.hljs{display:block;overflow-x:auto;padding:0.5em;background:white;color:black}
.hljs-comment,.hljs-quote{color:#800}
.hljs-keyword,.hljs-selector-tag,.hljs-section,.hljs-title,.hljs-name{color:#008}
.hljs-variable,.hljs-template-variable{color:#660}
.hljs-string,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-regexp{color:#080}
.hljs-literal,.hljs-symbol,.hljs-bullet,.hljs-meta,.hljs-number,.hljs-link{color:#066}
.hljs-title,.hljs-doctag,.hljs-type,.hljs-attr,.hljs-built_in,.hljs-builtin-name,.hljs-params{color:#606}
.hljs-attribute,.hljs-subst{color:#000}.hljs-formula{background-color:#eee;font-style:italic}
.hljs-selector-id,.hljs-selector-class{color:#9b703f}.hljs-addition{background-color:#baeeba}
.hljs-deletion{background-color:#ffc8bd}
.hljs-doctag,.hljs-strong{font-weight:bold}
.hljs-emphasis{font-style:italic}
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;