Skip to content

Advanced usage

matubu edited this page Nov 10, 2021 · 3 revisions

Custom Usage 🔧

You can use the highlightElement to allow better control what and when to highlight elements, For example, here’s the equivalent of highlightAll:

document
	.querySelectorAll('[class*="shj-lang-"]')
	.forEach(elm => highlightElement(elm));

The highlightElement can also take the language and the layout mode of element to highlight:

highlightElement(elm, '[language]', '[multi|in|one]line')

Styling 🌈

  • The class shj-mode-noheader allow you to remove the header with the language name
  • The class shj-mode-window allow you to replace your code snippet by a apple like window
Clone this wiki locally