Skip to content

aana-h2/highlightjs-riscvasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

highlightjs-riscvasm - RISC-V grammar for highlight.js

Usage

Static website

Simply load the grammar after loading Highlight.js:

<link rel="stylesheet" href="/path/to/styles/default.min.css">
<script src="/path/to/highlight.min.js"></script>
<script src="/path/to/riscvasm.min.js">
<script>hljs.highlightAll();</script>

You also can import it as a module:

<link rel="stylesheet" href="/path/to/styles/default.min.css">
<script type="module">
    import hljs from '/path/to/highlight.min.js';
    import riscvasm from '/path/to/riscvasm.es.min.js';
    hljs.registerLanguage('riscv', riscvasm); // register it.
    hljs.highlightAll();
</script>

Your html may look like:

<pre><code class="language-riscv">
    ...
</code></pre>

ES6 Module

It can be imported as a module, then register it. CommonJS also works in the same way.

import hljs from 'highlight.js';
import riscvasm from 'highlightjs-riscvasm';

hljs.registerLanguage("riscv", riscvasm);
hljs.highlightAll();

Your html may look like:

<pre><code class="language-riscv">
    ...
</code></pre>

About

RISC-V grammar for highlight.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published