Skip to content

TheElectronWill/dotty-hljs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Scala 3 grammar for Highlight.js

How to use

Add scala3.js to your webpage and register the language in hljs.

<script>
    hljs.registerLanguage('scala3', highlightDotty);
    hljs.registerAliases('dotty', 'scala3');
</script>

Then use hljs as usual, e.g.

<pre><code class="language-scala3">enum ItWorks(val x: Boolean)</code></pre>
<script>
    hljs.initHighlightingOnLoad();
</script>