Skip to content

Syntax Highlighter powered by Tree-sitter

Syntax highlighting for 7 runtimes

Including community-maintained Java and Python packages.

>curl -LsSf https://lumis.sh/install.sh | sh

7 Runtimes

CLI, Rust, Elixir, JavaScript / TypeScript, Browsers / CDN. Java and Python maintained by the community.

110+ Languages

Compiled Tree-sitter grammars containing highlights and injections.

250+ Themes

Neovim colorschemes btw. Pick one of the built-in themes or bring your own.

5 Formatters

HTML Inline, HTML Linked, Multi Theme, Terminal, BBCode + bring your own.

<Playground />

Try it live.

Highlighting...

<Quickstart />

Install, import, highlight.

Install
cargo install lumis-cli
Usage
lumis highlight index.js --lang javascript --theme dracula

<Runtimes />

7 runtimes. Pick yours.

CLI

>curl -LsSf https://lumis.sh/install.sh | sh

Rust

>cargo add lumis

Elixir

>{:lumis, "~> 0.10"}

JavaScript / TypeScript

>npm install @lumis-sh/lumis

Browsers / CDN

>npm install @lumis-sh/lumis

Java

>io.roastedroot:lumis4j:0.0.7

Python

>pip install fastpylight

<Integrations />

Plug the building blocks.

React

react-markdown

markdown-it

Astro

Nuxt

Ratatui

Nimble Publisher

Tableau

Docusaurus

Vite

VitePress

Build your own


<Formatters />

Built-in formatters or bring your own.

html_inline

Inline styles on every token. Zero config, works everywhere.

html_linked

Class names instead of inline styles. Full control, cacheable stylesheets.

html_multi_theme

CSS custom properties for multiple themes. Automatic switching with prefers-color-scheme.

terminal

ANSI escape codes. Same themes, same colors, rendered in your shell.

bbcode_scoped

BBCode with scoped color tags. Forum posts, game chat, Discord-style rich text.

custom

Implement the formatter trait/interface to output any format. Markdown, LaTeX, whatever.


<Inspector />

Tree-sitter parsing every token.

HTML + JavaScript
Token -
Scope -
Language -
Byte range -
Foreground -

<Streaming />

Fast and accurate even for incomplete code.

Markdown + incomplete fenced code

<Injections />

Highlight nested injected languages.

3 languages
CSS HTML JavaScript
Multi-level nesting
Each injected language gets its own parser, loaded during the pass that finds it. No depth limits, no second pass.
Language-aware scopes
Tokens know which language they belong to. Themes apply the right colors automatically.
Real embedded syntax
Injected blocks are not plain text, so strings, keywords, and punctuation keep the right scopes.

<Parsers />

Pre-built WASM parsers.

Install one parser package
>npm install @lumis-sh/wasm-html
Or choose a preset bundle
>npm install @lumis-sh/wasm-bundle-full
110+ grammars
Every language includes highlight queries and injection support, tested for conformance.
Loaded when a document needs them
Node reads each parser from the package a project installed, and loads the languages injected inside a document in the same pass. A browser loads the packages it imports. Nothing comes from a CDN unless you configure a resolver.
Persistent and verified
Every parser Lumis downloads is checked against the SHA-256 its package declares before it runs. Node.js, Bun, Deno, browsers, and Elixir keep parsers across restarts.
Verified on npm
Published with provenance. Browse all packages at npm.

<Community />

Lumis in the wild.

See how other projects use Lumis.

Community runtimes

roastedroot maintains Lumis4J for Java. Answer.AI maintains fastpylight for Python. Both packages have their own APIs and releases. Check the guides for supported features and examples.

Community runtime guides

Used by

  • Elixir

    Hex.pm

    Highlights package source.

  • Elixir

    Tuist

    Highlights Markdown through MDEx.

  • Elixir

    Oban Pro

    Highlights website code examples through MDEx.

  • Elixir

    Petal Components

    Highlights HEEx component examples through MDEx.

  • TypeScript

    SocratiCode

    Uses Lumis parsers to analyze HEEx and EEx templates.

  • Rust

    see

    Highlights code and Markdown in the terminal.

Full project list and integration links

Mentions

All mentions

To add your project or a mention, send a PR.