# Lumis - [Lumis](/): Lumis is a Tree-sitter syntax highlighter with Neovim themes across 7 runtimes, including community-maintained Java and Python packages. - [Installation](/installation): Install Lumis for CLI, Rust, Elixir, JavaScript / TypeScript, Browsers / CDN, Java, and Python. - [Languages](/languages): Let Lumis load parsers on demand, or preload the languages you know you need. - [Architecture](/architecture): How Lumis processes source code into highlighted output. - [Community](/community): Community runtimes, projects using Lumis, and articles and talks about it. - Usage - [Highlight](/usage/highlight): Highlight code with one Lumis workflow across CLI, Rust, Elixir, JavaScript / TypeScript, and Java. - [Rust](/usage/rust): Rust-specific Lumis APIs including write_highlight, auto-detection, streaming token iteration, custom themes, CSS generation, and feature flags. - [JavaScript / TypeScript](/usage/javascript): Lumis JavaScript and TypeScript API including highlighters, bundles, lazy loading, auto-detection, injected languages, and runtime metadata. - [Elixir](/usage/elixir): Elixir-specific Lumis API including highlight/2, Phoenix, LiveView, custom themes, validation, and multi-theme integration. - [Java](/usage/java): Lumis Java API via lumis4j including highlighting, language and theme selection, and JVM integration. - [Python](/usage/python): Use Lumis in Python through fastpylight, the community-maintained package from Answer.AI. - [CLI](/usage/cli): Highlight files and stdin with the Lumis CLI. - Formatters - [Formatters](/formatters): Choose between HTML Inline, HTML Linked, HTML Multi-Themes, Terminal, BBCode Scoped, or custom formatters in Lumis. - [HTML Inline Formatter](/formatters/html-inline): Options and examples for Lumis HTML inline output. - [HTML Linked Formatter](/formatters/html-linked): Options and examples for Lumis HTML linked output with CSS theme files. - [HTML Multi-Themes Formatter](/formatters/html-multi-themes): Options and examples for Lumis multi-theme HTML output using CSS custom properties. - [Terminal Formatter](/formatters/terminal): Options and examples for Lumis ANSI terminal output. - [BBCode Scoped Formatter](/formatters/bbcode): Options and examples for Lumis BBCode scoped output with highlight-scope tags. - [Custom Formatters](/formatters/custom): Build your own output format on top of Lumis tokens in Rust, JavaScript, TypeScript, and Elixir. - [Annotations](/formatters/annotations): Compose your own semantic ranges into the Lumis event stream and render them from a custom formatter. - Themes - [Themes](/themes): Use built-in Neovim themes, load custom theme JSON, or generate new themes for Lumis. - [CSS Theme Files](/themes/css-files): Use Lumis CSS theme files with htmlLinked output in JavaScript / TypeScript, Elixir, and CDN workflows. - [CSS Builder](/themes/css-builder): Build a theme stylesheet at runtime in Rust, JavaScript / TypeScript, Elixir, and the CLI. - Integrations - [React](/integrations/react): Use Lumis in React with a client `CodeBlock`, a `useLumis` hook, and a server renderer. - [rehype-lumis](/integrations/rehype-lumis): Use Lumis directly in rehype and unified pipelines with rehype-lumis. - [Vite](/integrations/vite): Highlight code in static Vite HTML entry points with Lumis. - [markdown-it](/integrations/markdown-it): Use Lumis directly in markdown-it with markdown-it-lumis. - [VitePress](/integrations/vitepress): Replace VitePress code fence highlighting with Lumis through markdown-it. - [MDX](/integrations/mdx): Use Lumis in MDX pipelines with rehype-lumis. - [Next.js](/integrations/nextjs): Use Lumis in Next.js MDX through rehype-lumis, and in Server Components. - [Astro](/integrations/astro): Use Lumis in Astro markdown and MDX through rehype-lumis. - [unified / rehype](/integrations/unified-rehype): Use Lumis directly in unified pipelines with rehype-lumis. - [react-markdown](/integrations/react-markdown): Use Lumis in react-markdown with rehype-lumis. - [Ratatui](/integrations/ratatui): Render Lumis terminal output inside Ratatui by converting ANSI output into styled text. - [NimblePublisher](/integrations/nimble-publisher): Use Lumis in NimblePublisher with MDEx through a custom HTML converter. - [Tableau](/integrations/tableau): Use Lumis in Tableau through Tableau's built-in MDEx markdown converter options. - [Docusaurus](/integrations/docusaurus): Use Lumis in Docusaurus through MDX rehype plugins. - [Nuxt](/integrations/nuxt): Use Lumis in Nuxt Content through rehype plugins. - Recipes - [Recipes](/recipes): Copy-paste Lumis recipes for common highlighting tasks across runtimes. - [Minimal HTML](/recipes/minimal-html): Render a minimal highlighted HTML snippet with Lumis. - [Auto-detect language](/recipes/auto-detect-language): Let Lumis infer the language from content, filename, or shebang. - [Linked HTML with CSS theme file](/recipes/linked-html-css-theme-file): Render HTML linked output and style it with a theme CSS file. - [Tailwind CSS](/recipes/tailwind-css): Load Lumis theme CSS next to Tailwind v4 and style code lines with utilities. - [Multi-theme HTML](/recipes/multi-theme-html): Render HTML that carries multiple themes for light and dark mode. - [Terminal output](/recipes/terminal-output): Highlight code for terminal output with ANSI colors. - [Wrap output with custom HTML](/recipes/wrap-output-with-custom-html): Wrap highlighted output with custom header and container HTML. - [Custom theme from JSON](/recipes/custom-theme-from-json): Load a custom Lumis theme from JSON and use it for highlighting. - [Injected languages (HTML + CSS + JS)](/recipes/injected-languages-html-css-js): Highlight HTML with nested CSS and JavaScript regions. - [Phoenix LiveView rendering](/recipes/phoenix-liveview-rendering): Render Lumis HTML safely in Phoenix and LiveView templates. - [Stream output to a file (Rust)](/recipes/stream-output-to-a-file-rust): Write highlighted output directly to a file in Rust. - [Generate CSS from a theme (Rust)](/recipes/generate-css-from-a-theme-rust): Generate linked CSS from a built-in Lumis theme in Rust. - [List languages and themes](/recipes/list-languages-and-themes): Inspect available languages and themes across Lumis runtimes. - [Generate a theme from a Neovim colorscheme](/recipes/generate-theme-from-neovim-colorscheme): Generate a Lumis theme JSON file from an upstream Neovim colorscheme. - [Repeated highlighting (JavaScript / TypeScript)](/recipes/repeated-highlighting-javascript): Reuse a JavaScript or TypeScript highlighter for repeated synchronous highlights. - [Browsers / CDN](/recipes/browser-cdn): Highlight code directly in Browsers with ESM CDN imports. - [Local WASM bundle](/recipes/local-wasm-bundle): Load a whole bundle of parser packages in a browser. - [Light/Dark Mode](/recipes/light-dark): Three ways to add light/dark theme switching to syntax-highlighted code with Lumis. - [Filename Title and Copy Button](/recipes/file-title-copy): Build a code block header with a filename label and copy button using Lumis header tags, plain CSS, and browser JavaScript. - [Line Highlighting](/recipes/line-highlighting): Highlight selected lines in Lumis for inline HTML, linked HTML, and CLI workflows. - [Line Numbers](/recipes/line-numbers): Number the lines Lumis renders, in HTML and in the terminal. - [Cache parsers (CLI)](/recipes/cache-parsers-cli): Find the cross-runtime guide to preloading Lumis languages. - [Highlight diffs](/recipes/highlight-diffs): Render a unified diff with the code inside each hunk highlighted as its own language. - [Rainbow brackets](/recipes/rainbow-brackets): Color nested brackets by depth in any Lumis formatter. - CLI - [Install the CLI](/cli/install): Install a Lumis CLI binary or build it from source. - [CLI Commands](/cli/commands): Highlight files, inspect Tree-sitter output, manage languages, and generate themes with the Lumis CLI. - [CLI Behavior](/cli/behavior): Understand Lumis CLI input handling, auto-detection, parser caching, data directories, and theme discovery. - Advanced - [Budget](/advanced/budget): Bound the work one Lumis render may do with a match limit and a time limit, and read the marker that says a bound was reached. - [Declaring parsers](/advanced/lock): Parsers are dependencies. How each runtime declares the languages it may load, and why nothing is fetched at runtime. - [WASM security](/advanced/wasm-security): How Lumis loads parser WebAssembly, what the sandbox enforces, and how parser bytes are checked. - Migrate - [Migrate](/migrate): Upgrade existing Lumis applications, custom formatters, and integrations. - [Elixir upgrades](/migrate/elixir): Upgrade Elixir applications from Lumis 0.6 and adopt parser dependencies in 0.9. - [HTML line markup](/migrate/html-lines): Update CSS, custom formatters, and copy buttons for content-only line spans. - [JavaScript custom languages](/migrate/javascript): Update integrations that supplied their own parser and queries through the JavaScript-only language API. - [MDEx parser packages](/migrate/mdex): Upgrade MDEx integrations from compiled-in grammars to Lumis parser dependencies. - [Autumnus to Lumis](/migrate/autumnus): Rename the Rust autumnus dependency and imports to lumis. - Reference - [Language catalog](/reference/languages): Every language Lumis supports, with its parser source, query source, and parser packages on npm and Hex. - [Themes](/reference/themes): Built-in Lumis themes and their upstream repositories. - [Runtimes](/reference/runtimes): Seven Lumis runtimes, including community-maintained Java and Python packages.