npm install @sugar-high/remarkTransform fenced code into highlighted HTML.
# Built for Markdown Sugar High turns fenced code into lightweight, highlighted HTML. ```typescript const message = 'Small API, bright code' console.log(message) ```
Sugar High turns fenced code into lightweight, highlighted HTML.
const message = 'Small API, bright code'
console.log(message)
import { remark } from 'remark'import { highlight } from '@sugar-high/remark'import html from 'remark-html'const result = await remark() .use(highlight) .use(html, { sanitize: false }) .process(markdown)return result.toString()Use every language supported by Sugar High.
// Here is a simple function
async function hello() {
console.log('Hello, world from JavaScript!')
return 123 // return a number
}
await hello()
use std::fs; // Import file system utilities
use std::io::{self, Write}; // Import I/O utilities
/* Read file content into a string */
fn read_file(path: &str) -> io::Result<String> {
fs::read_to_string(path) // Read file content into a String
}
fn main() {
match read_file("example.txt") {
Ok(content) => println!("File content:
{}", content),
Err(e) => eprintln!("Error reading file: {}", e),
}
}