# avlorayne/textpipeline architecture

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

- Interactive diagram: https://gitdiagram.com/avlorayne/textpipeline
- Repository: https://github.com/avlorayne/textpipeline

## Overview

Text Pipeline is a Unity/TextMeshPro runtime package for stripping custom, HTML-like markup from authored text and applying the corresponding effects to TMP character ranges. The main flow runs from a TMP object’s TextPipeline component through optional text sources, markup analysis and sink execution, then updates the displayed text. Settings control configured source/sink order; the registry supplies markup metadata and cached accessors. The README documents additional sample effects, nested scopes and coroutine scheduling. Some runtime modules and demo code are indexed but not excerpted, so uncertain implementation links are omitted.

Main entry points: [`Runtime/Core/TextPipeline.cs`](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Core/TextPipeline.cs) (TextPipeline), [`Runtime/Core/TextPipelineSettings.cs`](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Core/TextPipelineSettings.cs) (Pipeline settings), [`Runtime/Postprocess/Registry/MarkupRegistry.cs`](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/Registry/MarkupRegistry.cs) (Markup registry), [`Runtime/Postprocess/AnalyseTree/TextInfoMarkupParser.cs`](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/AnalyseTree/TextInfoMarkupParser.cs) (Markup parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime pipeline"]
  node_pipeline["TextPipeline<br/>[TextPipeline.cs]"]
  node_settings["Pipeline settings"]
  node_sources["Text sources<br/>[ITextSource.cs]"]
  node_typefinder["Type discovery<br/>[TypeFinder.cs]"]
end

subgraph group_markup["Markup model"]
  node_parser["Markup parser"]
  node_range["TMP character ranges<br/>[TextInfoRange.cs]"]
  node_treebuilder["Instance tree builder"]
  node_markupnode["Analysis tree<br/>[AnalyseTreeNode.cs]"]
  node_markupattrs["Markup declarations<br/>[MarkupAttribute.cs]"]
  node_datatypes["Markup value types<br/>[MarkupDataType.cs]"]
end

subgraph group_execution["Effect execution"]
  node_registry[("Markup registry<br/>[MarkupRegistry.cs]")]
  node_inject["Property injection<br/>[MarkupInject.cs]"]
  node_executor["Postprocessor executor"]
  node_segment["Text segments<br/>[TextSegment.cs]"]
  node_sink["Effect sinks<br/>[ITextSink.cs]"]
end

subgraph group_demo["Effects demo"]
  node_examples["Demo effect sinks<br/>[ExampleSinks.cs]"]
  node_bootstrap["Demo bootstrap"]
end

node_tmp["TMP text"]
node_designer(("Text author"))

node_designer -->|"authors text"| node_tmp
node_tmp -->|"hosts component"| node_pipeline
node_pipeline -->|"runs preprocessing"| node_sources
node_pipeline -->|"reads configuration"| node_settings
node_settings -->|"discovers types"| node_typefinder
node_pipeline -->|"analyses markup"| node_parser
node_parser -->|"builds tree"| node_markupnode
node_parser -->|"looks up markups"| node_registry
node_pipeline -->|"builds instances"| node_treebuilder
node_pipeline -->|"dispatches sinks"| node_executor
node_executor -->|"calls postprocess"| node_sink
node_executor -->|"creates segments"| node_segment
node_segment -->|"processes characters"| node_range
node_segment -->|"injects properties"| node_inject
node_inject -->|"uses accessors"| node_registry
node_registry -->|"reads declarations"| node_markupattrs
node_registry -->|"validates values"| node_datatypes
node_settings -->|"orders sink types"| node_sink
node_settings -->|"configures sources"| node_sources
node_pipeline -->|"updates display"| node_tmp
node_examples -->|"implements effects"| node_sink
node_bootstrap -->|"replays text"| node_pipeline
node_bootstrap -->|"demonstrates effects"| node_examples

click node_pipeline "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Core/TextPipeline.cs"
click node_settings "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Core/TextPipelineSettings.cs"
click node_sources "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Core/ITextSource.cs"
click node_typefinder "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Core/TypeFinder.cs"
click node_parser "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/AnalyseTree/TextInfoMarkupParser.cs"
click node_range "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/AnalyseTree/TextInfoRange.cs"
click node_treebuilder "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/Build%26Execute/InstanceTreeBuilder.cs"
click node_markupnode "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/AnalyseTree/AnalyseTreeNode.cs"
click node_markupattrs "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Attributes/MarkupAttribute.cs"
click node_datatypes "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Attributes/MarkupDataType.cs"
click node_registry "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/Registry/MarkupRegistry.cs"
click node_inject "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/Registry/MarkupInject.cs"
click node_executor "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/Build%26Execute/PostProcessorExecute.cs"
click node_segment "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/Build%26Execute/TextSegment.cs"
click node_sink "https://github.com/avlorayne/textpipeline/blob/main/Runtime/Core/ITextSink.cs"
click node_examples "https://github.com/avlorayne/textpipeline/blob/main/Samples~/Effects%20Demo/ExampleSinks.cs"
click node_bootstrap "https://github.com/avlorayne/textpipeline/blob/main/Samples~/Effects%20Demo/EffectsDemoBootstrap.cs"

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_pipeline,node_settings,node_sources,node_typefinder toneBlue
class node_parser,node_range,node_treebuilder,node_markupnode,node_markupattrs,node_datatypes toneAmber
class node_registry,node_inject,node_executor,node_segment,node_sink toneMint
class node_examples,node_bootstrap toneRose
class node_tmp,node_designer toneIndigo
```

## Components

### Runtime pipeline

- [TextPipeline](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Core/TextPipeline.cs): `Runtime/Core/TextPipeline.cs`
- [Pipeline settings](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Core/TextPipelineSettings.cs): `Runtime/Core/TextPipelineSettings.cs`
- [Text sources](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Core/ITextSource.cs): `Runtime/Core/ITextSource.cs`
- [Type discovery](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Core/TypeFinder.cs): `Runtime/Core/TypeFinder.cs`

### Markup model

- [Markup parser](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/AnalyseTree/TextInfoMarkupParser.cs): `Runtime/Postprocess/AnalyseTree/TextInfoMarkupParser.cs`
- [TMP character ranges](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/AnalyseTree/TextInfoRange.cs): `Runtime/Postprocess/AnalyseTree/TextInfoRange.cs`
- [Instance tree builder](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/Build%26Execute/InstanceTreeBuilder.cs): `Runtime/Postprocess/Build&Execute/InstanceTreeBuilder.cs`
- [Analysis tree](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/AnalyseTree/AnalyseTreeNode.cs): `Runtime/Postprocess/AnalyseTree/AnalyseTreeNode.cs`
- [Markup declarations](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Attributes/MarkupAttribute.cs): `Runtime/Attributes/MarkupAttribute.cs`
- [Markup value types](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Attributes/MarkupDataType.cs): `Runtime/Attributes/MarkupDataType.cs`

### Effect execution

- [Markup registry](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/Registry/MarkupRegistry.cs): `Runtime/Postprocess/Registry/MarkupRegistry.cs`
- [Property injection](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/Registry/MarkupInject.cs): `Runtime/Postprocess/Registry/MarkupInject.cs`
- [Postprocessor executor](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/Build%26Execute/PostProcessorExecute.cs): `Runtime/Postprocess/Build&Execute/PostProcessorExecute.cs`
- [Text segments](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Postprocess/Build%26Execute/TextSegment.cs): `Runtime/Postprocess/Build&Execute/TextSegment.cs`
- [Effect sinks](https://github.com/avlorayne/textpipeline/blob/main/Runtime/Core/ITextSink.cs): `Runtime/Core/ITextSink.cs`

### Effects demo

- [Demo effect sinks](https://github.com/avlorayne/textpipeline/blob/main/Samples~/Effects%20Demo/ExampleSinks.cs): `Samples~/Effects Demo/ExampleSinks.cs`
- [Demo bootstrap](https://github.com/avlorayne/textpipeline/blob/main/Samples~/Effects%20Demo/EffectsDemoBootstrap.cs): `Samples~/Effects Demo/EffectsDemoBootstrap.cs`

### Other components

- **TMP text**
- **Text author**

## Connections

- Text author → TMP text: authors text (evidence: `README.md`)
- TMP text → TextPipeline: hosts component (evidence: `README.md`)
- TextPipeline → Text sources: runs preprocessing (evidence: `Runtime/Core/TextPipeline.cs`)
- TextPipeline → Pipeline settings: reads configuration (evidence: `Runtime/Core/TextPipeline.cs`)
- Pipeline settings → Type discovery: discovers types (evidence: `Runtime/Core/TextPipelineSettings.cs`)
- TextPipeline → Markup parser: analyses markup (evidence: `Runtime/Core/TextPipeline.cs`)
- Markup parser → Analysis tree: builds tree (evidence: `Runtime/Postprocess/AnalyseTree/TextInfoMarkupParser.cs`)
- Markup parser → Markup registry: looks up markups (evidence: `Runtime/Postprocess/AnalyseTree/TextInfoMarkupParser.cs`)
- TextPipeline → Instance tree builder: builds instances (evidence: `Runtime/Core/TextPipeline.cs`)
- TextPipeline → Postprocessor executor: dispatches sinks (evidence: `Runtime/Core/TextPipeline.cs`)
- Postprocessor executor → Effect sinks: calls postprocess (evidence: `Runtime/Postprocess/Build&Execute/PostProcessorExecute.cs`)
- Postprocessor executor → Text segments: creates segments (evidence: `Runtime/Postprocess/Build&Execute/PostProcessorExecute.cs`)
- Text segments → TMP character ranges: processes characters (evidence: `Runtime/Postprocess/Build&Execute/TextSegment.cs`)
- Text segments → Property injection: injects properties (evidence: `Runtime/Postprocess/Build&Execute/TextSegment.cs`)
- Property injection → Markup registry: uses accessors (evidence: `Runtime/Postprocess/Registry/MarkupInject.cs`)
- Markup registry → Markup declarations: reads declarations (evidence: `Runtime/Postprocess/Registry/MarkupRegistry.cs`)
- Markup registry → Markup value types: validates values (evidence: `Runtime/Postprocess/Registry/MarkupRegistry.cs`)
- Pipeline settings → Effect sinks: orders sink types (evidence: `README.md`)
- Pipeline settings → Text sources: configures sources (evidence: `README.md`)
- TextPipeline → TMP text: updates display (evidence: `Runtime/Core/TextPipeline.cs`)
- Demo effect sinks → Effect sinks: implements effects (evidence: `Samples~/Effects Demo/ExampleSinks.cs`)
- Demo bootstrap → TextPipeline: replays text (evidence: `Samples~/Effects Demo/EffectsDemoBootstrap.cs`)
- Demo bootstrap → Demo effect sinks: demonstrates effects (evidence: `README.md`)
