macOS
brew install highlightlocal Homebrew formula metadata
sudo port install highlightMacPorts ports tree · textproc/highlight/Portfile · 来源: api.github.com
安装
brew install highlightlocal Homebrew formula metadata
sudo port install highlightMacPorts ports tree · textproc/highlight/Portfile · 来源: api.github.com
sudo apk add highlightAlpine Linux edge package indexes · highlight · 来源: dl-cdn.alpinelinux.org
sudo apt install highlightDebian stable package indexes · highlight · 来源: deb.debian.org
sudo dnf install highlightFedora Rawhide package metadata · highlight · 来源: dl.fedoraproject.org
nix profile install nixpkgs#highlightnixpkgs package indexes · highlight · 来源: raw.githubusercontent.com
sudo pacman -S highlightArch Linux sync databases · highlight · 来源: geo.mirror.pkgbuild.com
sudo zypper install highlightopenSUSE Tumbleweed package metadata · highlight · 来源: download.opensuse.org
choco install highlightChocolatey community package catalog · highlight · 来源: community.chocolatey.org
scoop install main/highlightScoop official bucket manifest trees · bucket/highlight.json · 来源: api.github.com
概览
Convert source code to formatted text with syntax highlighting
历史
highlight, by André Simon, converts source code into syntax-highlighted output for formats such as HTML, XHTML, RTF, ODT, TeX, LaTeX, SVG, BBCode, Pango markup, and terminal color escape sequences.
Its long-running appeal is that language definitions, themes, and plug-ins are data-driven Lua scripts rather than hardcoded syntax tables, making it useful both as a CLI converter and as a document-generation component.
The changelog traces the project back to `src2css` 0.1 in April 2002, followed by `highlight` 0.1 in July 2002 and `highlight` 1.0 in August 2002. Early releases added batch conversion, XHTML, RTF, TeX/LaTeX output, and more language definitions.
The 2.x line expanded output formats, language coverage, shared-library targets, filetype mapping, compatibility options for GNU source-highlight, and a rewritten Qt GUI. In 2009, the changelog records a license move from GPLv2 to GPLv3.
The 3.0 beta in June 2010 was a structural change: language definitions, themes, and filetype configuration were converted to Lua scripts, and a plug-in option was added. The 4.x line continued the Lua-script model while adding service-mode, LSP-related improvements, more languages, CMake/Meson work, and C++17 refactoring.
highlight spread through Unix package managers because it is useful in documentation pipelines, static-site generation, editor/tool integrations, and terminal workflows. The input package map lists Alpine, Homebrew, Chocolatey, Debian/Ubuntu, Fedora, MacPorts, Nix, Arch, Scoop, and openSUSE-style packages.
Official extras also show integration beyond one-off CLI use. The Pandoc example demonstrates using highlight as an external highlighter inside document preprocessing, including importing external source files and inline themes.
Common use is `highlight -i main.cpp -o main.cpp.html` for HTML, `highlight < main.cpp > main.cpp.html --syntax cpp` for standard-input workflows, or `highlight -O latex` for TeX/LaTeX output. Batch and recursive options let it process trees of source files.
Users customize behavior through language definitions, themes, plug-ins, file mappings, and output-format flags. The manual documents terminal truecolor and xterm256 output as well as document formats, making the tool relevant both on the command line and in generated artifacts.
highlight is package-nerd material because it is old-school Unix plumbing that still tracks new languages and output targets. It can sit behind manpage/documentation generation, static websites, code samples, and terminal previews without forcing a runtime-heavy web stack.
Its Lua-definition architecture is also useful for downstreams: language and theme behavior can be patched or extended as data files, which fits distribution packaging better than editing core parser code for every syntax tweak.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
highlight | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
http://andre-simon.de/doku/highlight/en/highlight.php
安装元数据
| 软件包键 | brew:highlight |
|---|---|
| 版本 | 4.20 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/highlight |
| 主页 | http://andre-simon.de/doku/highlight/en/highlight.php |
| 仓库 | https://gitlab.com/saalen/highlight |
| 上游文档 | http://andre-simon.de/doku/highlight/en/highlight.php |
| 许可证 | GPL-3.0-or-later |
| 源码归档 | https://gitlab.com/saalen/highlight/-/archive/v4.20/highlight-v4.20.tar.gz |
| 最后更新 | 2026-05-24T11:59:53Z |
| Pulse | updated |
| 依赖 | lua |
| 构建依赖 | boost, pkgconf |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | highlight |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
highlight 4.10-1+b2
Universal source code to formatted text converter
sudo apt install highlighthighlight-common 4.10-1
source code to formatted text converter (architecture independent files)
sudo apt install highlight-commonlibhighlight-perl 4.10-1+b2
perl bindings for highlight source code to formatted text converter
sudo apt install libhighlight-perlhighlight
nix profile install nixpkgs#highlighthighlight 4.10-1build2
Universal source code to formatted text converter
sudo apt install highlighthighlight-common 4.10-1build2
source code to formatted text converter (architecture independent files)
sudo apt install highlight-commonlibhighlight-perl 4.10-1build2
perl bindings for highlight source code to formatted text converter
sudo apt install libhighlight-perlhighlight 4.19-r0
Fast and flexible source code highlighter
http://www.andre-simon.de/doku/highlight/highlight.html
sudo apk add highlighthighlight-bash-completion 4.19-r0
Bash completions for highlight
http://www.andre-simon.de/doku/highlight/highlight.html
sudo apk add highlight-bash-completionhighlight-doc 4.19-r0
Fast and flexible source code highlighter (documentation)
http://www.andre-simon.de/doku/highlight/highlight.html
sudo apk add highlight-dochighlight-fish-completion 4.19-r0
Fish completions for highlight
http://www.andre-simon.de/doku/highlight/highlight.html
sudo apk add highlight-fish-completionhighlight-zsh-completion 4.19-r0
Zsh completions for highlight
http://www.andre-simon.de/doku/highlight/highlight.html
sudo apk add highlight-zsh-completionhighlight 4.20-4.fc45
Universal source code to formatted text converter
sudo dnf install highlighthighlight-gui 4.20-4.fc45
GUI for the highlight source code formatter
sudo dnf install highlight-guihighlight 4.20-1
Fast and flexible source code highlighter - CLI version
http://www.andre-simon.de/doku/highlight/highlight.html
sudo pacman -S highlighthighlight 4.18-1.4
Universal Source Code to Formatted Text Converter
sudo zypper install highlight来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.