# r41ngee/outdir architecture

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

- Interactive diagram: https://gitdiagram.com/r41ngee/outdir
- Repository: https://github.com/r41ngee/outdir

## Overview

outdir is a small Rust macro library for moving generated build-time files into application code as compile-time inclusions. A build script can use the build helpers to write under OUT_DIR; application code then uses the inclusion macros to embed generated source, bytes, or UTF-8 text. The shared path macro constructs the OUT_DIR-relative path used by inclusion. Relationships are supported by the source excerpts and README; the generated-file store is shown as a conceptual filesystem location.

Main entry points: [`src/lib.rs`](https://github.com/r41ngee/outdir/blob/main/src/lib.rs) (Include macros), [`src/build_macros.rs`](https://github.com/r41ngee/outdir/blob/main/src/build_macros.rs) (Build macros)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_build_script(("Build script"))
node_build_macros["Build macros<br/>[build_macros.rs]"]
node_out_dir[("OUT_DIR files")]
node_application(("Application code"))
node_include_macros["Include macros<br/>[lib.rs]"]
node_path_macro["Path macro<br/>[lib.rs]"]

node_build_script -->|"uses"| node_build_macros
node_build_macros -->|"writes files"| node_out_dir
node_application -->|"uses"| node_include_macros
node_include_macros -->|"expands via"| node_path_macro
node_path_macro -->|"resolves paths"| node_out_dir
node_include_macros -->|"includes files"| node_out_dir

click node_build_macros "https://github.com/r41ngee/outdir/blob/main/src/build_macros.rs"
click node_include_macros "https://github.com/r41ngee/outdir/blob/main/src/lib.rs"
click node_path_macro "https://github.com/r41ngee/outdir/blob/main/src/lib.rs"

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_build_script,node_application toneIndigo
class node_build_macros,node_include_macros,node_path_macro toneTeal
class node_out_dir toneAmber
```

## Components

### Other components

- **Build script**
- [Build macros](https://github.com/r41ngee/outdir/blob/main/src/build_macros.rs): `src/build_macros.rs`
- **OUT_DIR files**
- **Application code**
- [Include macros](https://github.com/r41ngee/outdir/blob/main/src/lib.rs): `src/lib.rs`
- [Path macro](https://github.com/r41ngee/outdir/blob/main/src/lib.rs): `src/lib.rs`

## Connections

- Build script → Build macros: uses (evidence: `README.md`)
- Build macros → OUT_DIR files: writes files (evidence: `src/build_macros.rs`)
- Application code → Include macros: uses (evidence: `README.md`)
- Include macros → Path macro: expands via (evidence: `src/lib.rs`)
- Path macro → OUT_DIR files: resolves paths (evidence: `src/lib.rs`)
- Include macros → OUT_DIR files: includes files (evidence: `src/lib.rs`)
