# kojix2/wombat architecture

> Architecture diagram of the GitHub repository kojix2/wombat, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kojix2/wombat
- Repository: https://github.com/kojix2/wombat

## Overview

Wombat is a small Crystal binding for bat-c, exposing syntax-highlighted strings and file output, plus the installed bat-c version. The documented user flow is to call Wombat’s API, which provides bat-backed highlighting; file output may invoke less. Source excerpts were unavailable, so relationships are limited to those described in the README.

Main entry points: [`src/wombat.cr`](https://github.com/kojix2/wombat/blob/main/src/wombat.cr) (Wombat API), [`src/wombat/lib_bat.cr`](https://github.com/kojix2/wombat/blob/main/src/wombat/lib_bat.cr) (bat-c binding), [`src/wombat/version.cr`](https://github.com/kojix2/wombat/blob/main/src/wombat/version.cr) (Version access)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Crystal caller"))
node_api["Wombat API<br/>[wombat.cr]"]
node_binding["bat-c binding<br/>[lib_bat.cr]"]
node_batc["bat-c library"]
node_bat["bat highlighter"]
node_less["less pager"]
node_version["Version access<br/>[version.cr]"]

node_user -->|"calls highlighting"| node_api
node_api -->|"uses binding"| node_binding
node_binding -->|"wraps"| node_batc
node_batc -->|"wraps"| node_bat
node_bat -->|"invokes for files"| node_less
node_user -->|"checks version"| node_version

click node_api "https://github.com/kojix2/wombat/blob/main/src/wombat.cr"
click node_binding "https://github.com/kojix2/wombat/blob/main/src/wombat/lib_bat.cr"
click node_version "https://github.com/kojix2/wombat/blob/main/src/wombat/version.cr"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user,node_batc,node_bat,node_less toneIndigo
class node_api toneMint
class node_binding,node_version toneTeal
```

## Components

### Other components

- **Crystal caller**
- [Wombat API](https://github.com/kojix2/wombat/blob/main/src/wombat.cr): `src/wombat.cr`
- [bat-c binding](https://github.com/kojix2/wombat/blob/main/src/wombat/lib_bat.cr): `src/wombat/lib_bat.cr`
- **bat-c library**
- **bat highlighter**
- **less pager**
- [Version access](https://github.com/kojix2/wombat/blob/main/src/wombat/version.cr): `src/wombat/version.cr`

## Connections

- Crystal caller → Wombat API: calls highlighting (evidence: `README.md`)
- Wombat API → bat-c binding: uses binding (evidence: `README.md`)
- bat-c binding → bat-c library: wraps (evidence: `README.md`)
- bat-c library → bat highlighter: wraps (evidence: `README.md`)
- bat highlighter → less pager: invokes for files (evidence: `README.md`)
- Crystal caller → Version access: checks version (evidence: `README.md`)
