# jeziellago/compose-markdown architecture

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

- Interactive diagram: https://gitdiagram.com/jeziellago/compose-markdown
- Repository: https://github.com/jeziellago/compose-markdown

## Overview

Compose Markdown is an Android library that exposes Markdown as a Jetpack Compose composable while rendering through a TextView-based Markwon pipeline. The main flow is caller content → MarkdownText → MarkdownRender and its configured extensions → CustomTextView display and interaction. The README also documents tables, task lists, HTML, images/GIFs, linkification, highlighting, selectable text, and block-level accessibility. Relationships reflect the supplied source excerpts and README; unsampled modules are included where their paths and capabilities are documented, but their internal wiring is not inferred.

Main entry points: [`markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownRender.kt`](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownRender.kt) (Markwon setup), [`markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownText.kt`](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownText.kt) (MarkdownText), [`markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightPlugin.kt`](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightPlugin.kt) (Highlight plugin), [`markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/CustomTextView.kt`](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/CustomTextView.kt) (Custom TextView)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Compose API"]
  node_markdown_text["MarkdownText<br/>[MarkdownText.kt]"]
  node_auto_size["Auto-size config<br/>[AutoSizeConfig.kt]"]
  node_text_appearance["Text appearance"]
end

subgraph group_render["Markdown Rendering"]
  node_renderer["Markwon setup<br/>[MarkdownRender.kt]"]
  node_core_plugin["Core Markdown"]
  node_images_plugin["Images and GIFs<br/>[ImagesPlugin.kt]"]
  node_syntax_plugin["Highlight plugin"]
  node_syntax_extension["Highlight extension"]
  node_delimiter["Highlight delimiters"]
  node_syntax_node["Highlight node<br/>[SyntaxHighlight.kt]"]
  node_strike_renderer["Strikethrough renderer"]
end

subgraph group_view["Display and Interaction"]
  node_text_view["Custom TextView<br/>[CustomTextView.kt]"]
end

node_caller(("Compose caller"))
node_image_loader["Coil image loader"]

node_caller -->|"provides content"| node_markdown_text
node_markdown_text -->|"creates renderer"| node_renderer
node_markdown_text -->|"creates and updates"| node_text_view
node_markdown_text -->|"applies config"| node_auto_size
node_renderer -->|"registers plugin"| node_core_plugin
node_renderer -->|"registers plugin"| node_images_plugin
node_renderer -->|"registers plugin"| node_syntax_plugin
node_images_plugin -->|"loads images"| node_image_loader
node_syntax_plugin -->|"registers extension"| node_syntax_extension
node_syntax_plugin -->|"renders node"| node_syntax_node
node_syntax_extension -->|"configures parser"| node_delimiter
node_delimiter -->|"creates node"| node_syntax_node
node_renderer -.->|"sets rendered text"| node_text_view
node_text_view -.->|"displays remote media"| node_image_loader

click node_markdown_text "https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownText.kt"
click node_auto_size "https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/AutoSizeConfig.kt"
click node_text_appearance "https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/TextAppearanceExt.kt"
click node_renderer "https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownRender.kt"
click node_core_plugin "https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/core/MardownCorePlugin.kt"
click node_images_plugin "https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/image/ImagesPlugin.kt"
click node_syntax_plugin "https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightPlugin.kt"
click node_syntax_extension "https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightExtension.kt"
click node_delimiter "https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightDelimiterProcessor.kt"
click node_syntax_node "https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlight.kt"
click node_strike_renderer "https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/StrikethroughNodeRenderer.kt"
click node_text_view "https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/CustomTextView.kt"

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_markdown_text,node_auto_size,node_text_appearance toneBlue
class node_renderer,node_core_plugin,node_images_plugin,node_syntax_plugin,node_syntax_extension,node_delimiter,node_syntax_node,node_strike_renderer toneAmber
class node_text_view toneMint
class node_caller,node_image_loader toneIndigo
```

## Components

### Compose API

- [MarkdownText](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownText.kt): `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownText.kt`
- [Auto-size config](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/AutoSizeConfig.kt): `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/AutoSizeConfig.kt`
- [Text appearance](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/TextAppearanceExt.kt): `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/TextAppearanceExt.kt`

### Markdown Rendering

- [Markwon setup](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownRender.kt): `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownRender.kt`
- [Core Markdown](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/core/MardownCorePlugin.kt): `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/core/MardownCorePlugin.kt`
- [Images and GIFs](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/image/ImagesPlugin.kt): `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/image/ImagesPlugin.kt`
- [Highlight plugin](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightPlugin.kt): `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightPlugin.kt`
- [Highlight extension](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightExtension.kt): `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightExtension.kt`
- [Highlight delimiters](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightDelimiterProcessor.kt): `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightDelimiterProcessor.kt`
- [Highlight node](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlight.kt): `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlight.kt`
- [Strikethrough renderer](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/StrikethroughNodeRenderer.kt): `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/StrikethroughNodeRenderer.kt`

### Display and Interaction

- [Custom TextView](https://github.com/jeziellago/compose-markdown/blob/main/markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/CustomTextView.kt): `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/CustomTextView.kt`

### Other components

- **Compose caller**
- **Coil image loader**

## Connections

- Compose caller → MarkdownText: provides content (evidence: `README.md`)
- MarkdownText → Markwon setup: creates renderer (evidence: `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownText.kt`)
- MarkdownText → Custom TextView: creates and updates (evidence: `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownText.kt`)
- MarkdownText → Auto-size config: applies config (evidence: `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownText.kt`)
- Markwon setup → Core Markdown: registers plugin (evidence: `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownRender.kt`)
- Markwon setup → Images and GIFs: registers plugin (evidence: `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownRender.kt`)
- Markwon setup → Highlight plugin: registers plugin (evidence: `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/MarkdownRender.kt`)
- Images and GIFs → Coil image loader: loads images (evidence: `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/image/ImagesPlugin.kt`)
- Highlight plugin → Highlight extension: registers extension (evidence: `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightPlugin.kt`)
- Highlight plugin → Highlight node: renders node (evidence: `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightPlugin.kt`)
- Highlight extension → Highlight delimiters: configures parser (evidence: `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightExtension.kt`)
- Highlight delimiters → Highlight node: creates node (evidence: `markdowntext/src/main/java/dev/jeziellago/compose/markdowntext/plugins/syntaxhighlight/SyntaxHighlightDelimiterProcessor.kt`)
- Markwon setup → Custom TextView: sets rendered text
- Custom TextView → Coil image loader: displays remote media
