Tool Open source

rangi

rangi is a tiny, synchronous syntax-highlighting library that converts code into self-contained HTML with theme colors inlined as style attributes, requiring no stylesheet, client-side JavaScript, hydration, or global registry. It bundles 46 languages and 25 themes, supports automatic language detection, custom languages, inline or block output, optional line numbers, raw tokens for custom rendering, and ANSI terminal output. The package has zero runtime dependencies; its full bundle is about 13.2 kB minified and gzipped, while the core code-to-HTML entry point is about 1.5 kB. It runs in Node.js, browsers, workers, and templates, and also provides a command-line interface.

View repository Mentioned in 1 video ↓

What rangi is used for

1 use taken from transcripts — each links to the moment in the video.

  • A tiny synchronous syntax highlighter that returns self-contained HTML without CSS, client-side JavaScript, or hydration. It supports 46 languages and themes and also exposes raw tokens and ANSI terminal output.

Videos mentioning rangi

1 in the library.