# danioso/gulp-inc architecture

> Architecture diagram of the GitHub repository danioso/gulp-inc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/danioso/gulp-inc
- Repository: https://github.com/danioso/gulp-inc

## Overview

##### Main Components

a. Input Layer:
- Source files (HTML, Markdown, etc.)
- Include directive syntax (#= include /path/to/file.md)

b. Processing Pipeline:
- gulp-inc Plugin Core (central component)
- File Reader Component
- Preprocessor Interface
- Content Injection Engine

c. Output Layer:
- Processed files
- Gulp Output Stream

##### Component Relationships

- Interface points where the plugin connects with Gulp's pipeline

##### Specific Elements

a. Input Section:
- Source Files (HTML)
- Directives
- External Files (MD, etc.)

b. Processing Section:
- File Detection (regex matcher)
- File Resolution (path resolver)
- Preprocessor Handler
- Content Injection

c. Output Section:
- Transformed Files
- Gulp Stream Output

##### Additional Details

Important aspects:
- Configuration options (regex, preprocessor)
- Stream processing indicators
- File transformation flow
- Integration points with external preprocessors

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Define styles
    classDef input fill:#e1f5fe,stroke:#0288d1
    classDef processing fill:#e8f5e9,stroke:#388e3c
    classDef preprocessor fill:#fff3e0,stroke:#f57c00
    classDef output fill:#f3e5f5,stroke:#7b1fa2

    %% Input Layer
    subgraph Input
        SF["Source Files (HTML)"]:::input
        ID["Include Directives<br>#= include /path"]:::input
        EF["External Files<br>(MD, etc.)"]:::input
    end

    %% Processing Layer
    subgraph Processing
        PC["Plugin Core"]:::processing
        FR["File Reader"]:::processing
        PI["Preprocessor Interface"]:::processing
        CIE["Content Injection<br>Engine"]:::processing
    end

    %% Preprocessor Layer
    subgraph Preprocessor
        PH["Preprocessor Handler"]:::preprocessor
        RM["Regex Matcher"]:::preprocessor
        PR["Path Resolver"]:::preprocessor
    end

    %% Output Layer
    subgraph Output
        TF["Transformed Files"]:::output
        GSO["Gulp Stream Output"]:::output
    end

    %% Connections
    SF --> PC
    ID --> PC
    EF --> PC
    PC --> FR
    FR --> PI
    PI --> PH
    PH --> RM
    PH --> PR
    PR --> CIE
    RM --> CIE
    CIE --> TF
    TF --> GSO

    %% Click events
    click PC "https://github.com/danioso/gulp-inc/blob/master/index.js"
    
    %% Legend
    subgraph Legend
        L1["Input Components"]:::input
        L2["Processing Components"]:::processing
        L3["Preprocessor Components"]:::preprocessor
        L4["Output Components"]:::output
    end
```
