# Install source-highlight with Homebrew, apk, apt, dnf, MacPorts, pacman, zypper

Source-code syntax highlighter. Version 3.1.9 via Homebrew; verified 2026-06-22.

## Install

```sh
sudo av install brew:source-highlight
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install source-highlight
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install source-highlight
```

  Evidence: MacPorts ports tree: textproc/source-highlight/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add source-highlight
```

  Evidence: Alpine Linux edge package indexes: source-highlight from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install libsource-highlight-common
```

  Evidence: Debian stable package indexes: libsource-highlight-common from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install source-highlight
```

  Evidence: Fedora Rawhide package metadata: source-highlight from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- pacman (92%):

```sh
sudo pacman -S source-highlight
```

  Evidence: Arch Linux sync databases: source-highlight from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install libsource-highlight-devel
```

  Evidence: openSUSE Tumbleweed package metadata: libsource-highlight-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

## Package facts

- **Package key:** brew:source-highlight
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/source-highlight>
- **Version:** 3.1.9
- **Source summary:** Source-code syntax highlighter
- **Homepage:** <https://www.gnu.org/software/src-highlite/>
- **Repository:** <https://git.savannah.gnu.org/cgit/src-highlite.git>
- **Upstream docs:** <https://www.gnu.org/software/src-highlite/source-highlight.html>
- **License:** GPL-3.0-or-later
- **Source archive:** <https://ftpmirror.gnu.org/gnu/src-highlite/source-highlight-3.1.9.tar.gz>
- **Last updated:** 2026-06-22T14:06:20-07:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- check-regexp (cli)
- cpp2html (cli)
- java2html (cli)
- source-highlight (cli)
- source-highlight-esc.sh (cli)
- source-highlight-settings (cli)
- src-hilite-lesspipe.sh (cli)
- check-regexp (alias)
- cpp2html (alias)
- java2html (alias)
- source-highlight (alias)
- source-highlight-esc.sh (alias)
- source-highlight-settings (alias)
- src-hilite-lesspipe.sh (alias)

## Dependencies

- boost

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 3.1.9
- Package-manager updated: 2026-06-22
- Local data: ok
- Upstream repository: https://www.gnu.org/software/src-highlite/
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

GNU Source-highlight is a GNU command-line tool and C++ library that turns source files into syntax-highlighted documents in formats such as HTML, ANSI escape sequences, LaTeX, Texinfo, DocBook, ODF, Groff, and others.

### Project history

The manual explains that GNU Source-highlight grew out of the older GNU `cpp2html` and `java2html` programs, which were kept as compatibility scripts after the unified `source-highlight` command arrived. The official NEWS file marks version 1.0 as the first Source-highlight release while noting that it already incorporated those earlier tools.

The project moved from a focused source-to-HTML converter into a configurable highlighter: version 2.0 added user-defined input language definitions, version 2.1 added user-defined output language definitions, version 2.2 added ctags-backed cross references, and version 3.0 added a reusable C++ highlighting library.

### Adoption history

The official manual lists many supported languages and output formats, and the NEWS file records additions such as ANSI escape output for `less`, ODF, MediaWiki, HTML5, S-expressions, Groff, Go, Rust, and other language definitions. That breadth made it attractive to distributions and documentation pipelines.

### How it is used

Users invoke `source-highlight` to convert source code or plain text into highlighted documents. The package also ships helpers such as `check-regexp`, compatibility scripts such as `cpp2html` and `java2html`, and `src-hilite-lesspipe.sh` for viewing highlighted files through `less`.

### Why package nerds care

Package nerds care because it is a very GNU-flavored packaging specimen: configurable data files, many generated output targets, shell-compatible helper programs, a library split, `less` integration, Savannah hosting, and a user config at `~/.source-highlight/source-highlight.conf`.

### Timeline

- 1999: Copyright period begins in the official NEWS file.
- 1.0: First Source-highlight release, incorporating existing `cpp2html` and `java2html` programs.
- 2.0: User-defined input language definitions added.
- 2.1: User-defined output format definitions added.
- 2.2: ctags-backed cross references added.
- 3.0: C++ library and `source-highlight-settings` added.
- 2015: Manual edition 3.1.8 documented the broad language and output-format set.
- 2023: Savannah ChangeLog shows modernization work requiring C++11 and replacing Boost shared pointers with standard ones.

### Related projects

- `cpp2html` and `java2html` are predecessor/compatibility tools documented by the GNU manual.
- The manual lists related front-ends and integrations such as Source-highlight-qt, QSource-Highlight, SourceHighlightIDE, Ksrc2highlight, Ikiwiki integration, and Perl/PHP/Python bindings.

### Sources

- <https://git.savannah.gnu.org/cgit/src-highlite.git/plain/ChangeLog>
- <https://git.savannah.gnu.org/cgit/src-highlite.git/plain/NEWS>
- <https://www.gnu.org/software/src-highlite/source-highlight.html>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.source-highlight/source-highlight.conf
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** source-highlight
- **Version Scheme:** 0
- **Revision:** 6
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Debian apt - libsource-highlight-common - 3.1.9-4.3: normalized package name match | Debian stable package indexes: libsource-highlight-common from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | architecture-independent files for source highlighting library | http://www.gnu.org/software/src-highlite/
- Debian apt - libsource-highlight-dev - 3.1.9-4.3+b1: normalized package name match | Debian stable package indexes: libsource-highlight-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | development files for source highlighting library | http://www.gnu.org/software/src-highlite/
- Debian apt - libsource-highlight4t64 - 3.1.9-4.3+b1: normalized package name match | Debian stable package indexes: libsource-highlight4t64 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | source highlighting library | http://www.gnu.org/software/src-highlite/
- Debian apt - source-highlight - 3.1.9-4.3+b1: normalized package name match | Debian stable package indexes: source-highlight from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | convert source code to syntax highlighted document | http://www.gnu.org/software/src-highlite/
- Ubuntu apt - libsource-highlight-common - 3.1.9-4.3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libsource-highlight-common from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | architecture-independent files for source highlighting library | http://www.gnu.org/software/src-highlite/
- Ubuntu apt - libsource-highlight-dev - 3.1.9-4.3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libsource-highlight-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | development files for source highlighting library | http://www.gnu.org/software/src-highlite/
- Ubuntu apt - libsource-highlight4t64 - 3.1.9-4.3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libsource-highlight4t64 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | source highlighting library | http://www.gnu.org/software/src-highlite/
- Ubuntu apt - source-highlight - 3.1.9-4.3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: source-highlight from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | convert source code to syntax highlighted document | http://www.gnu.org/software/src-highlite/
- apk - source-highlight - 3.1.9-r14: normalized package name match | Alpine Linux edge package indexes: source-highlight from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Produces a document with syntax highlighting | https://www.gnu.org/software/src-highlite/
- apk - source-highlight-bash-completion - 3.1.9-r14: normalized package name match | Alpine Linux edge package indexes: source-highlight-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Bash completions for source-highlight | https://www.gnu.org/software/src-highlite/
- apk - source-highlight-dev - 3.1.9-r14: normalized package name match | Alpine Linux edge package indexes: source-highlight-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Produces a document with syntax highlighting (development files) | https://www.gnu.org/software/src-highlite/
- apk - source-highlight-doc - 3.1.9-r14: normalized package name match | Alpine Linux edge package indexes: source-highlight-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Produces a document with syntax highlighting (documentation) | https://www.gnu.org/software/src-highlite/
- dnf - source-highlight - 3.1.9-27.fc44: normalized package name match | Fedora Rawhide package metadata: source-highlight from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Produces a document with syntax highlighting | http://www.gnu.org/software/src-highlite/
- dnf - source-highlight-devel - 3.1.9-27.fc44: normalized package name match | Fedora Rawhide package metadata: source-highlight-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Development files for source-highlight | http://www.gnu.org/software/src-highlite/
- pacman - source-highlight - 3.1.9-18: normalized package name match | Arch Linux sync databases: source-highlight from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Convert source code to syntax highlighted document | https://www.gnu.org/software/src-highlite/
- zypper - libsource-highlight-devel - 3.1.9-5.17: normalized package name match | openSUSE Tumbleweed package metadata: libsource-highlight-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Source Code Highlighting C++ Library | https://www.gnu.org/software/src-highlite


## Related links

- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [asciidoc](https://www.automicvault.com/pkg/brew/asciidoc/) - Popular package that depends on this formula.
- [highlight](https://www.automicvault.com/pkg/brew/highlight/) - Shares av.db curated category or tags: cli, developer-tools, source-code, syntax-highlighting.
- [ccat](https://www.automicvault.com/pkg/brew/ccat/) - Shares av.db curated category or tags: cli, developer-tools, syntax-highlighting.
- [chroma](https://www.automicvault.com/pkg/brew/chroma/) - Shares av.db curated category or tags: cli, developer-tools, syntax-highlighting.
- [cppi](https://www.automicvault.com/pkg/brew/cppi/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, gnu.
- [findent](https://www.automicvault.com/pkg/brew/findent/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, source-code.
- [hindent](https://www.automicvault.com/pkg/brew/hindent/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, source-code.
- [pygments](https://www.automicvault.com/pkg/brew/pygments/) - Shares av.db curated category or tags: cli, developer-tools, syntax-highlighting.
- [scalariform](https://www.automicvault.com/pkg/brew/scalariform/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, source-code.
- [enscript](https://www.automicvault.com/pkg/brew/enscript/) - Both packages work with overlapping file formats or content types. Shared terms: cli, developer, developer-tools, gnu, highlighting.
- [gperf](https://www.automicvault.com/pkg/brew/gperf/) - Local package facts share a topical domain. Shared terms: cli, code, developer, developer-tools, generation.

## Combined YAML source

View the package source record on GitHub. [combined/source-highlight.yml](https://github.com/automic-vault/db/blob/main/combined/source-highlight.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
