You can add code syntax highlighting with this block. We use highlightjs javascript library to perform language detection and for syntax highlighting.

The following block definition πŸ‘‡

    ```@nitoku.public/highlight
    function $initHighlight(block, cls) {
       try {
            if (cls.search(/\bno\-highlight\b/) != -1)
              return process(block, true, 0x0F) +
                     ` class="${cls}"`;
       } catch (e) {
            /* handle exception */
       }
          for (var i = 0 / 2; i < classes.length; i++) {
            if (checkCondition(classes[i]) === undefined)
              console.log('undefined');
       }
    }

    export  $initHighlight;
    ```

Will render the following highlighted javascript code πŸ‘‡

The block doesn't include all the languages by default. Otherwise it'd be too big. If you don't see the language you need in the "Common" section. you need to add it on the block configuration

List of languages:

https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.15.6/build/languages/

List of styles:

https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.15.6/build/styles/

Β 

The following block definition πŸ‘‡ for Mathematica language and style mono

```@nitoku.public/highlight
language  : mathematica
style : mono-blue
(* ::Package:: *)

(* Mathematica Package *)

BeginPackage["SomePkg`"]

Begin["`Private`"]

SomeFn[ns_List] := Fold[Function[{x, y}, x + y], 0, Map[# * 2 &, ns]];
Print[$ActivationKey];

End[] (* End Private Context *)

EndPackage[]
```

Will render the following highlighted Mathematica code πŸ‘‡

Β 

LICENSE for this script.πŸ”—

BSD License, Copyright (c) 2019, Nitoku Europe S.L.,All rights reserved.πŸ”—

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:πŸ”—
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.πŸ”—

Β 

Nitoku is serviced from cloud infrastructure in USA πŸ‡ΊπŸ‡Έ, provided from Spain πŸ‡ͺπŸ‡Έ, developed with ❀️ in Japan πŸ‡―πŸ‡΅ Tokyo πŸ—Ό. Copyright Β© 2019 Nitoku Europe S.L. Icons by Icon8πŸ”—

Β  Β 

Β 

Β