ForgeKomponenty
sk

Komponenty

j-HighlightSyntax

jComponent 20 · jcomponent@20 component Príklad načítaný s jComponent 20

Jednoduchý zvýrazňovač syntaxe pomocou Highlight.js.


Konfigurácia:

  • type musí obsahovať typ obsahu na zvýraznenie

Použite ho so <ui-component name="highlightsyntax">. Keď komponent ešte nie je načítaný, jComponent ho stiahne pri prvom použití z adresy v DEF.fallback (predvolene CDN Componentator). Autor: Peter Širka. Zdroj: úložisko komponentov Componentator, licencia MIT.

example.html
<ui-component name="highlightsyntax" path="exampleHTML" config="type:html"></ui-component>
<ui-component name="highlightsyntax" path="exampleJS" config="type:js"></ui-component>
<ui-component name="highlightsyntax" path="exampleCSS" config="type:css"></ui-component>

<script>
	var exampleHTML = "This is <b>HTML</b>";
	var exampleJS = "var a = 0;";
	var exampleCSS = "body { color: red; }";
</script>