SkillAgentSearch skills...

Lumis

Syntax Highlighter powered by Tree-sitter and Neovim themes.

Install / Use

/learn @leandrocp/Lumis

README

<h1 align="center">Lumis</h1> <p align="center"> <a href="https://lumis.sh"><img src="assets/intro.jpg" alt="Lumis Syntax Highlighter"></a> </p> <p align="center"> <a href="https://lumis.sh">lumis.sh</a> - <a href="https://lumis.sh/doc">docs</a> </p> <p align="center"> <a href="https://crates.io/crates/lumis"><img src="https://img.shields.io/crates/v/lumis" alt="Crates.io"></a> <a href="https://www.npmjs.com/package/@lumis-sh/lumis"><img src="https://img.shields.io/npm/v/@lumis-sh/lumis" alt="npm"></a> <a href="https://hex.pm/packages/lumis"><img src="https://img.shields.io/hexpm/v/lumis" alt="Hex.pm"></a> <a href="https://central.sonatype.com/artifact/io.roastedroot/lumis4j"><img src="https://img.shields.io/maven-central/v/io.roastedroot/lumis4j" alt="Maven Central"></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License"></a> </p>

Features

  • 110+ Tree-sitter languages - Fast, accurate, and updated syntax parsing
  • 120+ Neovim themes - Updated and curated themes from the Neovim community
  • 6 platforms - CLI, Rust, Elixir, Node.js, Browser, Java
  • Multiple outputs - HTML (inline/linked), Terminal (ANSI), Multi-theme (light/dark), BBCode, and custom formatters
  • Language auto-detection - File extension, shebang, and emacs-mode support
  • Streaming-friendly - Handles incomplete code
<table> <tr> <td><img src="assets/ruby.png" alt="Ruby with Catppuccin Frappe theme"></td> <td><img src="assets/sql.png" alt="SQL with GitHub Light theme"></td> </tr> </table>

Quick Start

CLI

cargo install lumis-cli

lumis highlight app.js --theme dracula

Rust

use lumis::{highlight, HtmlInlineBuilder, languages::Language, themes};

let theme = themes::get("dracula").unwrap();

let formatter = HtmlInlineBuilder::new()
    .lang(Language::Javascript)
    .theme(Some(theme))
    .build()
    .unwrap();

let html = highlight("const x = 1", formatter);

Node.js / Browser

Works in Node.js and browsers.

import { highlight } from '@lumis-sh/lumis'
import { htmlInline } from '@lumis-sh/lumis/formatters'
import javascript from '@lumis-sh/lumis/langs/javascript'
import dracula from '@lumis-sh/themes/dracula'

const html = await highlight('const x = 1', htmlInline({ language: javascript, theme: dracula }))

Elixir

Lumis.highlight!("const x = 1", language: "javascript", formatter: {:html_inline, theme: "dracula"})

Java

By @andreaTP. More details at https://chicory.dev/blog/syntax-highlight

import io.roastedroot.lumis4j.core.Lumis;
import io.roastedroot.lumis4j.core.Lang;
import io.roastedroot.lumis4j.core.Theme;

var lumis = Lumis.builder().build();

var highlighter = lumis.highlighter()
    .withLang(Lang.JAVASCRIPT)
    .withTheme(Theme.DRACULA)
    .build();

var result = highlighter.highlight("const x = 1");
System.out.println(result.string());

Documentation

| Platform | Install | Package | Docs | |----------|---------| ------- | -----| | CLI | cargo install lumis-cli | crates.io/lumis-cli | README.md | | Rust | cargo add lumis | crates.io/lumis | README.mddocs.rs | | Elixir | {:lumis, "~> 0.1"} | hex.pm/lumis | README.mdhexdocs | | Node.js/Browser | npm install @lumis-sh/lumis | npmjs.com/@lumis-sh/lumis | README.md | | Java | io.roastedroot:lumis4j:latest | io.roastedroot/lumis4j | README.md |

Architecture

Every Lumis package is built around the same three pieces:

  • themes extracted from Neovim
  • languages backed by Tree-sitter grammars
  • formatters that turn highlighted tokens into output

Given some source code, Lumis parses it with the selected Tree-sitter language, resolves styles from the chosen theme, and then formats the highlighted result into HTML, ANSI, or any custom output.

WASM Versions

The npm WASM package versions follow the pattern <tree-sitter-version>.<seq> where:

  • tree-version-version is the major-minor version of the Tree-sitter compatible version
  • seq is a patch number for Lumis own updates

For example, @lumis-sh/wasm-rust@0.26.0 is the first published version compatible with Tree-sitter 0.26, while @lumis-sh/wasm-javascript@0.26.1 is a patch update compatible with Tree-sitter 0.26 (usually containing upstream parser updates).

Contributing

Contributions aew welcome! Feel free to open issues or PRs for bugs, features, new themes languages.

See CONTRIBUTING.md

Acknowledgements

  • Makeup for setting up the baseline for the Elixir package
  • Inkjet for the Rust implementation in the initial versions
  • Shiki and syntect for the hard work defining how syntax highlighters should work

License

MIT

Related Skills

View on GitHub
GitHub Stars79
CategoryDevelopment
Updated11h ago
Forks8

Languages

C

Security Score

100/100

Audited on Mar 28, 2026

No findings