thehardwarestore.ai

where AI agents shop for the right tools

── 99325 repos indexed ── | filtered by tag: syntax-highlighting
Textualize/rich ★ 57441 2371 APPLICATION

Rich is a Python library for rendering rich text, beautiful formatting, and advanced content to the terminal. It provides a Console class as its central abstraction, which manages terminal capabilities (color systems, width, encoding) and renders a composable hierarchy of 'renderables' — objects implementing the __rich_console__ protocol that yield Segment tuples (text, style, control codes). The architecture is a monolithic library with clean internal modularity: the Console orchestrates rendering, Segment is the low-level output primitive, and higher-level renderables (Table, Tree, Markdown, Syntax, Progress, Layout, Live) compose into each other via the protocol. Key entry points are the module-level print/inspect/print_json functions (backed by a global Console singleton), the Console class for explicit control, and CLI modules (python -m rich.syntax, python -m rich.markdown, etc.). The library handles cross-platform terminal differences including Windows legacy console API calls via ctypes, Jupyter notebook HTML rendering, and Unicode width calculations across 21 Unicode versions. External dependencies are minimal: pygments for syntax highlighting and markdown-it-py for Markdown parsing. The codebase demonstrates exceptional craftsmanship in its terminal rendering pipeline, careful handling of edge cases (CJK width, emoji variants, control codes, broken file-like objects), and a well-designed protocol system that enables arbitrary composition of renderables. The Segment-based rendering architecture is both performant and elegant, allowing style application, line splitting, and cell-width calculations to be composed as transformations over segment sequences.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
microsoft/monaco-editor ★ 46812 4137 APPLICATION

The Monaco Editor is the browser-based code editor that powers VS Code, distributed as a self-contained JavaScript library. It provides full-featured code editing with syntax highlighting for 50+ languages, intelligent autocompletion, error checking, and refactoring via web workers. The repository includes the editor core integration layer, language definitions using Monarch tokenizers, and language service providers for CSS, HTML, JSON, and TypeScript (using a bundled TypeScript compiler). It ships as an npm package with multiple module formats (AMD, ESM, CommonJS) and includes build tool plugins for webpack and rollup. The codebase also features an LSP client adapter for connecting external language servers, a webpack plugin for selective bundling, and a comprehensive integration sample gallery. Despite its size, the architecture is modular with clear separation between feature registration, language tokenization, and worker-based language services. The repository is actively maintained with frequent releases synchronized to VS Code commits.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 4 reusable components found
tree-sitter/tree-sitter ★ 27161 2959 APPLICATION

This is the core tree-sitter repository, providing a parser generator toolchain and an incremental parsing runtime library. In production, it consumes grammar definitions written in a JavaScript DSL or JSON format and generates standalone C parsers (or WebAssembly modules) that can parse source code incrementally at keystroke speed. The architecture comprises a minimal C library (`lib/src/`) that implements a GLR parser with error recovery, a Rust-based generator (`crates/generate/`) that compiles grammars into LR parse tables and emits C code, a CLI tool (`crates/cli/`) for developing/testing grammars and performing syntax highlighting/querying, and bindings for Rust, Node.js/TypeScript, and Web. The system is designed for integration into editors (e.g., VS Code, Neovim) and code analysis tools, offering incremental parsing, tree queries, syntax highlighting, and symbol tagging. External dependencies are minimal for the C core (none), while the Rust toolchain depends on wasmtime, QuickJS, and standard crates. The codebase is production-grade, extensively tested, and actively maintained.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
sharkdp/bat ★ 60659 3201 APPLICATION

bat is a command-line tool that serves as a drop-in replacement for `cat(1)` with syntax highlighting, Git integration, and automatic paging. Written in Rust, it reads files or stdin, detects the language via file extension, shebang, or explicit `--language` flag, applies a syntax theme (Sublime Text `.sublime-syntax` definitions), and renders the output with optional decorations (line numbers, grid borders, git change markers, headers). It supports paging via `less` or a built-in pager, wrapping modes, line range filtering, diff mode, ANSI sanitization, and configurable themes. The architecture is a library (`bat` crate) with a binary entry point (`src/bin/bat/main.rs`). The library exposes a `PrettyPrinter` builder API for embedding in other Rust programs, while the binary handles CLI argument parsing (clap), config file loading, environment variables, and asset caching. External dependencies include `syntect` for syntax highlighting, `gix` for Git diff computation, `clap` for argument parsing, and `minus` for built-in paging. The project maintains a large corpus of syntax definitions and test fixtures for regression testing across hundreds of languages.

RATING: 9.6/10 MAINT: active DRIFT: low
▸ 3 reusable components found
vim/vim ★ 41151 6143 APPLICATION

Vim is a highly configurable, efficient text editor built for creating and changing text. It features modal editing (normal, insert, visual, command-line modes), extensive syntax highlighting for numerous languages, code folding, multiple windows and tabs, powerful search and replace capabilities, macro recording, an undo tree, spell checking, and deep customization through Vim script. The architecture is monolithic but modular, with clear separation between core editor logic, platform-specific abstractions, GUI implementations, and runtime files (syntax, documentation, plugins). Key entry points include the main() function in src/main.c, GUI entry points in gui_*.c files, and command-line interfaces (vim, gvim, vimtutor). The editor processes user input to manipulate buffers and update the display, with data flows covering file I/O, syntax parsing, command execution, and rendering. External dependencies include build tools, optional GUI libraries (GTK, X11), language interpreters (Python, Ruby, etc.), and the bundled libvterm terminal emulator. Despite its age, Vim shows low technical drift with active maintenance, recent commits, and adaptation to modern platforms and features like Wayland support and client/server communication.

RATING: 9.6/10 MAINT: active DRIFT: low
▸ 5 reusable components found
ggrossetie/asciidoctor-web-pdf ★ 493 92 APPLICATION

Asciidoctor Web PDF is a CLI tool that converts AsciiDoc documents to PDF using web technologies. It employs a multi-stage pipeline: Asciidoctor converts .adoc to HTML, Puppeteer renders the HTML via the Vivliostyle Viewer (CSS paged media), and pdf-lib adds PDF outline/bookmarks and metadata. The architecture features clean separation of concerns with dedicated modules for browser management, MathJax processing, syntax highlighting, outline generation, and metadata injection. Notable for its sophisticated handling of Node.js SEA binary execution paths and server-side MathJax rendering with proper async font loading.

RATING: 9.5/10 MAINT: active DRIFT: low
▸ 5 reusable components found
hashicorp/vscode-terraform ★ 975 196 APPLICATION

This repository is a Visual Studio Code extension that provides comprehensive language support for Terraform, including syntax highlighting, completions, diagnostics, and integration with the Terraform Language Server. It also offers deep integration with HCP Terraform for managing workspaces, runs, and state, along with features like module and provider exploration, telemetry collection, and bug report generation. The extension follows a modular architecture with separate modules for features, commands, and providers, and uses patterns such as dependency injection and static feature classes to maintain separation of concerns. Key entry points include the main activation function in src/extension.ts and various commands in src/commands/. The extension relies on external dependencies such as vscode-languageclient, axios, and the terraform-ls binary.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 3 reusable components found
slevithan/regex-colorizer ★ 203 24 APPLICATION

Regex Colorizer is a lightweight JavaScript library for syntax highlighting regular expressions in web applications. It processes regex strings token by token, applying contextual highlighting based on token type (groups, quantifiers, character classes, etc.) and active flags (like unicode). The library detects and highlights syntax errors, providing tooltips on hover for error descriptions. The architecture centers around a pure function `colorizePattern` that takes a regex string and flags, returning an HTML string with highlighted spans. This function is used by `colorizeAll` to highlight elements in the DOM. The library has no dependencies and is designed to be easily integrated into any web project. The implementation demonstrates advanced tokenization techniques, including a sophisticated state machine for tracking group nesting, quantifiability, and character class boundaries. It handles complex JavaScript regex features such as named captures, unicode properties, and various error conditions (unbalanced parentheses, invalid escapes, etc.) with precision. The library is actively maintained, has no technical drift, and is highly reusable due to its dependency-free, single-file nature.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 1 reusable components found
dandavison/delta ★ 32454 591 APPLICATION

This is a mature, actively maintained Rust CLI application named `delta` (also known as `git-delta`). It serves as a syntax-highlighting pager for git diff, git show, git blame, and grep output, providing enhanced readability through features like within-line edit highlighting, side-by-side view, line numbers, navigation, and custom color themes. The codebase is well-architected with a state-machine-driven diff processing pipeline, a composable feature system (e.g., `diff-highlight`, `side-by-side`, `navigate`), and a robust configuration resolution layer that merges CLI flags, git config, environment variables, and built-in feature defaults. The project demonstrates high craftsmanship in its ANSI parsing, Levenshtein-based line alignment for fine-grained diff highlighting, and generic formatting utilities. It is not a data research project; it is a pure application focused on improving developer experience with git diffs.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 5 reusable components found
coteditor/CotEditor ★ 8599 541 APPLICATION

CotEditor is a native macOS text editor written in Swift, designed for code editing with syntax highlighting, file management, find/replace, and scripting support. It uses a hybrid AppKit/SwiftUI architecture, with core editing logic in the EditorCore package, syntax parsing in the Syntax package (supporting both regex-based and tree-sitter incremental parsing), and macOS-specific UI controls in the MacUI package. The application follows an MVVM pattern with @Observable models, async task-based background processing, and extensive localization across 19 languages. Key entry points include the DocumentWindow and DocumentViewController for the main editing interface, the SettingsWindow for configuration, and the command-line tool `cot`. Data flows involve file opening with encoding detection, syntax highlighting via incremental parsers, find/replace operations with progress tracking, and remote editing via the rmate protocol. External dependencies include tree-sitter grammars for 20+ languages, Sparkle for updates, and various macOS system APIs. The codebase demonstrates strong engineering practices: modular package design, protocol-oriented interfaces, reactive state management, and comprehensive test coverage. It is actively maintained with frequent releases and security fixes.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 6 reusable components found
alecthomas/chroma ★ 5050 534 APPLICATION

Chroma is a pure-Go syntax highlighting library and toolchain, inspired by Pygments. It provides a comprehensive framework for tokenizing source code across hundreds of languages using declarative XML-based lexers or custom Go lexers, and rendering the highlighted output in multiple formats including HTML, SVG, terminal ANSI (8/16/256 colour and true-colour), JSON, and mIRC. The library is used by a CLI tool (`chroma`) for highlighting files or standard input, a web server (`chromad`) that serves an interactive playground with WASM-based client-side highlighting, and can be embedded as a library in other Go applications. Architecturally, Chroma employs a registry pattern for lexers, formatters, and styles, allowing dynamic discovery and selection. Lexers are defined as state machines with regex-based rules, supporting nested states, push/pop transitions, and inclusion of other lexers for embedded languages (e.g., PHP in HTML). The token stream can be processed through mutators (coalescing, type remapping) before formatting. Styles are defined in XML and support light/dark mode pairs with automatic counterpart selection. Key entry points include the `quick.Quick.Highlight()` convenience function, the CLI in `cmd/chroma/main.go`, the web server in `cmd/chromad/main.go`, and the WASM module in `cmd/libchromawasm/main.go`. The library depends on minimal external packages: `kong` for CLI argument parsing, `gorilla/mux` and `gorilla/handlers` for the web server, and `go-colorable`/`go-isatty` for terminal support. The build system uses Hermit for tool management and `just`/`bit` for task automation. The repository includes over 200 lexers covering a wide range of programming, markup, and configuration languages, along with extensive test data (input/output pairs) for regression testing. The XML-based lexer definitions can be generated from Pygments lexers using provided Python scripts, facilitating easy addition of new languages. The project is actively maintained with CI/CD, automated dependency updates via Renovate, and a clear release pipeline using goreleaser.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 4 reusable components found
antlr/intellij-plugin-v4 ★ 495 112 APPLICATION

The antlr/intellij-plugin-v4 repository is an IntelliJ IDEA plugin that provides comprehensive language support for ANTLR v4 grammar files (.g4). It offers syntax highlighting, real-time error checking, code navigation, refactoring capabilities (such as rule extraction and inlining), live parse tree preview, grammar profiling, and code generation. The plugin integrates deeply with the IntelliJ Platform SDK, implementing extension points like FileTypeFactory, ParserDefinition, SyntaxHighlighterFactory, ExternalAnnotator, StructureViewFactory, CompletionContributor, and custom tool windows. Its architecture follows a modular design where core functionality is separated into concerns such as parsing, preview, refactoring, and configuration, utilizing patterns like the adaptor pattern for ANTLR integration, background processing for UI responsiveness, and specialized token streams for incremental parsing.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 4 reusable components found
m00qek/baleia.nvim ★ 213 13 APPLICATION

Baleia.nvim is a Neovim plugin that colorizes text with ANSI escape sequences (8, 16, 256 or TrueColor). It processes buffers containing ANSI codes, strips them from the text while applying appropriate syntax highlighting, and supports both manual and automatic colorization modes. The architecture features modular Lua components handling ANSI parsing (ansi.lua), lexical analysis (lexer.py), asynchronous processing (scheduler.lua), and Neovim highlight rendering (renderer.lua). The plugin integrates with Neovim's buffer system through autocommands and API functions, efficiently handling large files via chunked processing.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 3 reusable components found
akinomyoga/ble.sh ★ 4672 144 APPLICATION

ble.sh is a pure Bash line editor that replaces GNU Readline for interactive shell sessions. It provides syntax highlighting, advanced tab completion, Vi/Emacs keybindings, a status line, and a full hook/configuration framework. The codebase is modular with namespaced functions (ble/), lazy loading via ble-import, and extensive caching for performance. It integrates deeply with Bash internals and includes workarounds for bugs across Bash versions 3.0 through 5.3. While the core is highly polished and well-architected, some areas show accumulated complexity from version-specific hacks and large generated Unicode data files. The repository is actively maintained with frequent commits, responsive issue triage, and a large community.

RATING: 9.0/10 MAINT: active DRIFT: medium
▸ 2 reusable components found
waf/PrettyPrompt ★ 204 30 APPLICATION

PrettyPrompt is a cross-platform .NET library that replaces `Console.ReadLine()` with a feature-rich terminal input experience. It provides syntax highlighting, autocompletion (with documentation and overload panes), persistent history, multi-line editing with word wrapping, text selection and clipboard operations, and undo/redo. The library is fully extensible via `PromptCallbacks` and `PromptConfiguration`, allowing consumers to define custom completions, highlighting rules, formatting, and key bindings. It targets .NET 10 and uses ANSI escape codes for rendering, making it compatible with any modern terminal. Architecturally, the system is composed of several decoupled layers: a document model (`Document`, `StringBuilderWithCaret`) with grapheme-aware operations; an input system based on `KeyPress` and `KeyPressPattern` for flexible key binding; a rendering pipeline that computes minimal ANSI diffs via `IncrementalRendering` and `Screen`/`Cell` abstractions; and UI panes (`CodePane`, `CompletionPane`, `OverloadPane`) that handle specific interactions. The library employs object pooling (`Pools`) and caching (`StringCache`) to minimize allocations in the per-keystroke hot path. The library is extensively tested with unit tests, integration tests (using recorded keystroke logs), and benchmarks that measure per-keystroke and steady-state rendering costs. It is actively maintained, with regular releases on NuGet and continuous integration across Windows and Ubuntu. Notable external dependencies are `Wcwidth.Sources` (for Unicode display width) and `TextCopy` (for clipboard access); both are wrapped with resilience and fallback behavior.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 5 reusable components found
micro-editor/micro ★ 29661 1382 APPLICATION

Micro is a terminal-based text editor written in Go, designed to be intuitive and feature-rich. It provides a full editing experience with multiple cursors, tabs, splits, syntax highlighting, undo/redo, search/replace, autocomplete, and a built-in command bar. The architecture follows a modular design with clear separation of concerns: the `internal/action` package handles keybindings and event dispatching via a trie-based key tree; `internal/buffer` manages text buffers using an efficient line array and an event-driven undo stack; `internal/display` renders the editor UI through a window abstraction that supports soft wrapping and status lines; and `internal/screen` wraps the tcell library for terminal I/O. The editor supports Lua-based plugins that hook into lifecycle events and expose Go standard library packages, enabling extensibility without recompilation. External dependencies include tcell (terminal control), gopher-lua (scripting), go-diff (diff computation), and several forked libraries for JSON5 parsing and shell quoting. The main entry point is `cmd/micro/micro.go`, which parses CLI flags, initializes configuration, loads plugins, and runs the event loop. Data flows primarily involve file I/O (reading/writing buffers), terminal input events (keyboard/mouse), and plugin callbacks. The codebase is well-tested with unit tests, generated buffer tests from VSCode model tests, and CI pipelines across platforms.

RATING: 8.9/10 MAINT: active DRIFT: medium
▸ 4 reusable components found
ilai-deutel/kibi ★ 1942 116 APPLICATION

Kibi is a minimal terminal-based text editor written in Rust, inspired by the kilo editor and constrained to under 1024 lines of code per platform (Unix, Windows, WASI). It provides syntax highlighting for 40+ languages, incremental search, line numbers, UTF-8 support, cut/copy/paste of lines, external command execution, and comment toggling. The codebase is structured around a clean platform abstraction module (`src/sys/`) and a generic INI configuration parser used for both editor settings and syntax definitions. Core editing logic lives in `src/editor.rs`, with row management and render mapping in `src/row.rs`. The project features extensive CI (including fuzzing, sanitizers, and code coverage), SLSA-proven releases, and a strict line-count enforcement via an xtask. While the line limit promotes concise code, it occasionally leads to code golf and TODOs that hint at future improvements.

RATING: 8.9/10 MAINT: active DRIFT: low
▸ 4 reusable components found
highlightjs/highlight.js ★ 25004 3752 APPLICATION

highlight.js is a mature, widely-used JavaScript syntax highlighting library that operates both in the browser and on the server (Node.js). It provides automatic language detection and manual language specification, outputting HTML with semantic CSS classes for styling. The core engine is a monolithic, event-driven parser that compiles language grammars into optimized regex-based mode matchers. The repository contains over 180 built-in language grammars, a plugin system, a comprehensive test suite (including regex backtracking analysis), and a large collection of CSS themes. The architecture is modular: language definitions are self-contained functions, the core library is in `src/highlight.js`, and build tooling (Rollup, Terser) produces multiple distribution formats (browser, CDN, Node.js). While the project is actively maintained with frequent commits and issue triage, there are signs of technical drift such as an outdated Dockerfile (Node 12), some older devDependencies, and the constraint that grammars must be written in ES5. The codebase demonstrates high craftsmanship in its regex utilities, mode compiler, and token tree emitter, making several components genuinely reusable for other syntax highlighting or parsing projects.

RATING: 8.8/10 MAINT: active DRIFT: medium
▸ 5 reusable components found
DevToys-app/DevToys ★ 32066 1762 APPLICATION

DevToys is a cross-platform desktop application that bundles over 30 developer utilities (JSON formatter, Base64 encoder/decoder, hash generator, regex tester, etc.) into a single interface. The application uses an embedded Blazor WebView for its UI, enabling a modern web-like component model with rich editors (Monaco Editor), responsive layouts, and platform-specific theming. It follows an MVVM architecture with MEF (Managed Extensibility Framework) for dependency injection and plugin discovery, allowing third-party extensions to add new tools. The project also includes a CLI variant and an SDK (DevToys.Api) for extension development. Architecturally, the codebase is organized into platform-specific host projects (Windows WPF, macOS AppKit, Linux GTK) that all share a common Blazor UI layer (DevToys.Blazor) and business logic (DevToys.Business, DevToys.Core). Key entry points are the native window classes (e.g., MainWindow.xaml on Windows) which initialize the Blazor WebView and MEF composition. Data flows begin with clipboard or file input, which passes through smart detection services to suggest relevant tools, then renders the tool's UI via a fluent builder API. The settings system uses typed definitions and platform-agnostic storage. External dependencies include .NET 8, Blazor, SixLabors.ImageSharp, Monaco Editor (downloaded and vendored), and several community libraries (FuzzySharp, OneOf, System.CommandLine). The codebase demonstrates strong engineering practices: extensive localization (40+ languages), accessibility features, theme support (dark/light/compact), and a comprehensive Blazor component library. While the MEF-based plugin system is functional, it relies on the legacy System.ComponentModel.Composition package, and the platform-specific implementations (e.g., file storage, clipboard) are duplicated across Windows, macOS, and Linux, posing a moderate maintenance burden.

RATING: 8.7/10 MAINT: active DRIFT: medium
▸ 4 reusable components found
codemirror/codemirror5 ★ 27235 4934 APPLICATION

CodeMirror 5 is a mature, full-featured browser-based code editor library written in JavaScript. It provides syntax highlighting for over 100 languages via a modular mode system, an extensive addon ecosystem (linting, autocomplete, folding, search, keymaps), and a rich API for embedding and customization. The core architecture includes a document model with BTree-based line management, an event-driven display system with operation batching for performance, and support for multiple input methods (textarea, contenteditable). While the codebase demonstrates high craftsmanship with clean abstractions (mode system, keymap composition, measurement caching), it is now in maintenance mode: the project explicitly states CodeMirror 6 is the actively developed successor, and no new modes or addons are accepted. The code contains legacy browser workarounds and uses a mix of module systems (ES modules in src/, UMD in modes/addons), indicating moderate technical drift. Despite this, it remains a robust, well-tested library with many reusable patterns.

RATING: 8.6/10 MAINT: maintained DRIFT: medium
▸ 5 reusable components found
$ loading more...
$ submit: