Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rvanasa/highlightjs-motoko

Syntax highlighting for the Motoko programming language
https://github.com/rvanasa/highlightjs-motoko

Last synced: about 2 months ago
JSON representation

Syntax highlighting for the Motoko programming language

Awesome Lists containing this project

README

        

# `highlightjs-motoko`

> #### [highlight.js](https://github.com/highlightjs/highlight.js) syntax definitions for [Motoko](https://internetcomputer.org/docs/current/motoko/main/about-this-guide) and related languages.

---

## Installation

```bash
npm i --save highlightjs-motoko
```

## Basic Usage

```js
const hljs = require('highlightjs');
const defineMotoko = require('highlightjs-motoko');

defineMotoko(hljs);
hljs.highlightAll();
```

## Advanced Usage

```js
const hljs = require('highlightjs');
const { motoko, candid } = require('highlightjs-motoko');

// Individually register each language
hljs.registerLanguage('motoko', motoko);
hljs.registerLanguage('candid', candid);

hljs.highlightAll();
```