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
- Host: GitHub
- URL: https://github.com/huozhi/remark-sugar-high
- Owner: huozhi
- Created: 2024-10-25T16:45:05.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-26T18:47:20.000Z (over 1 year ago)
- Last Synced: 2025-05-06T21:08:13.404Z (about 1 year ago)
- Topics: highlight, markdown, markdown-codeblock, remark
- Language: TypeScript
- Homepage: https://remark-sugar-high.vercel.app
- Size: 250 KB
- Stars: 15
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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