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

https://github.com/huozhi/remark-sugar-high

remark plugin for Sugar High syntax highlighter
https://github.com/huozhi/remark-sugar-high

highlight markdown markdown-codeblock remark

Last synced: about 1 year ago
JSON representation

remark plugin for Sugar High syntax highlighter

Awesome Lists containing this project

README

          

# remark-sugar-high

Remark plugin for [Sugar High](https://sugar-high.vercel.app) syntax highlighter.

[Website](https://remark-sugar-high.vercel.app/)

## Installation

```bash
$ npm i -S remark-sugar-high
```

## Usage

Input markdown file:

```
\`\`\`javascript {2,5}
// Here is a simple function
async function hello() {
console.log('Hello, world from JavaScript!')
return 123 // return a number
}

await hello()
\`\`\`
```

Using [remark](https://github.com/remarkjs/remark):

```js
const { highlight } = require('remark-sugar-high');

await remark()
.use(highlight)
.use(require('remark-html'))
.process(file, (err, file) => console.log(String(file)));
```

Output HTML

```html

// Here is a simple function

async function hello() {
console.log('Hello, world from JavaScript!')
return 123 // return a number
}

await hello()

```

Customize the color theme with sugar-high CSS variables. Check [sugar-high highlight-with-css section](https://github.com/huozhi/sugar-high#highlight-with-css) for more details.

## License

MIT