# mugiwara85/codeblockcustomizer architecture

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

- Interactive diagram: https://gitdiagram.com/mugiwara85/codeblockcustomizer
- Repository: https://github.com/mugiwara85/codeblockcustomizer

## Overview

Codeblock Customizer is an Obsidian plugin that applies configurable code-block and inline-code presentation in both editor and reading views. The main user workflow is to configure styling and behavior, write Markdown code blocks with optional parameters, and view the customized output. Its domain stages include parameter parsing, editor decorations, reading-view rendering, and specialized features such as prompts and grouped blocks. The graph also shows settings and shared rendering utilities. Some subsystem paths are supported by the tree and README, but their internal wiring was not sampled, so uncertain links are omitted.

Main entry points: [`src/main.ts`](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/main.ts) (Plugin runtime), [`src/Parsing.ts`](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/Parsing.ts) (Parameter parser), [`src/ReadingView/CodeBlockRenderer.ts`](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ReadingView/CodeBlockRenderer.ts) (Reading renderer), [`src/EditorView/CodeBlockPositions.ts`](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/EditorView/CodeBlockPositions.ts) (Block positions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Plugin entry"]
  node_plugin["Plugin runtime<br/>[main.ts]"]
end

subgraph group_parse["Parsing and state"]
  node_parser["Parameter parser<br/>[Parsing.ts]"]
  node_positions["Block positions"]
  node_utils["Shared utilities<br/>[Utils.ts]"]
  node_const["Language and style constants<br/>[Const.ts]"]
end

subgraph group_views["Code presentation"]
  node_editor["Editor decorations<br/>[MainViewPlugin.ts]"]
  node_reading["Reading renderer"]
  node_postprocessors["Reading post-processors<br/>[PostProcessors.ts]"]
  node_inline["Inline code"]
  node_viewutils["View utilities"]
end

subgraph group_features["Customization features"]
  node_groups["Tabbed code groups"]
  node_editorgroups["Editor code groups"]
  node_folding["Code folding<br/>[Folding.ts]"]
  node_prompts["Terminal prompts<br/>[PromptManager.ts]"]
  node_highlight["Highlight rules<br/>[HighlightRules.ts]"]
  node_htmlblocks["HTML code blocks<br/>[HtmlCodeBlocks.ts]"]
  node_execute["Code execution integration<br/>[ExecuteCode.ts]"]
end

subgraph group_settings["Settings"]
  node_settings["Plugin settings<br/>[Settings.ts]"]
  node_settingsui["Settings interface<br/>[SettingsTab.ts]"]
  node_syntaxdefaults["Syntax theme defaults"]
end

node_user(("Obsidian user"))
node_markdown["Markdown code"]

node_user -->|"uses"| node_plugin
node_user -->|"authors"| node_markdown
node_markdown -->|"sets parameters"| node_parser
node_plugin -->|"registers extensions"| node_editor
node_plugin -->|"registers settings"| node_settingsui
node_plugin -->|"loads defaults"| node_syntaxdefaults
node_plugin -->|"imports"| node_positions
node_positions -->|"parses blocks"| node_parser
node_positions -->|"finds HTML blocks"| node_htmlblocks
node_editor -->|"uses parameters"| node_parser
node_editor -->|"uses prompts"| node_prompts
node_editor -->|"uses rules"| node_highlight
node_plugin -->|"registers renderer"| node_reading
node_plugin -->|"registers renderer"| node_groups
node_plugin -->|"registers renderer"| node_inline
node_plugin -->|"registers processors"| node_postprocessors
node_reading -->|"uses utilities"| node_viewutils
node_reading -->|"uses parameters"| node_parser
node_reading -->|"loads Prism"| node_utils
node_postprocessors -->|"uses renderer"| node_reading
node_inline -->|"parses inline parameters"| node_parser
node_inline -->|"uses rules"| node_highlight
node_settingsui -->|"edits settings"| node_settings
node_settingsui -->|"uses defaults"| node_syntaxdefaults
node_parser -->|"resolves prompt definitions"| node_prompts
node_parser -->|"converts HTML fences"| node_htmlblocks
node_editorgroups -->|"uses positions"| node_positions
node_folding -->|"uses positions"| node_positions
node_execute -->|"uses parameters"| node_parser

click node_plugin "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/main.ts"
click node_parser "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/Parsing.ts"
click node_positions "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/EditorView/CodeBlockPositions.ts"
click node_editor "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/EditorView/MainViewPlugin.ts"
click node_reading "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ReadingView/CodeBlockRenderer.ts"
click node_postprocessors "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ReadingView/PostProcessors.ts"
click node_inline "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ReadingView/InlineCodeRenderer.ts"
click node_viewutils "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ReadingView/ReadingViewUtils.ts"
click node_groups "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ReadingView/GroupedCodeBlockRenderer.ts"
click node_editorgroups "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/EditorView/GroupedCodeBlocks.ts"
click node_folding "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/EditorView/Folding.ts"
click node_prompts "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/PromptManager.ts"
click node_highlight "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/HighlightRules.ts"
click node_htmlblocks "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/HtmlCodeBlocks.ts"
click node_execute "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ExecuteCode.ts"
click node_settings "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/Settings.ts"
click node_settingsui "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/SettingsTab/SettingsTab.ts"
click node_syntaxdefaults "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/SyntaxThemeDefaults.ts"
click node_utils "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/Utils.ts"
click node_const "https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/Const.ts"

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_plugin,node_user toneBlue
class node_parser,node_positions,node_utils,node_const toneAmber
class node_editor,node_reading,node_postprocessors,node_inline,node_viewutils toneMint
class node_groups,node_editorgroups,node_folding,node_prompts,node_highlight,node_htmlblocks,node_execute toneRose
class node_settings,node_settingsui,node_syntaxdefaults,node_markdown toneIndigo
```

## Components

### Plugin entry

- [Plugin runtime](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/main.ts): `src/main.ts`

### Parsing and state

- [Parameter parser](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/Parsing.ts): `src/Parsing.ts`
- [Block positions](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/EditorView/CodeBlockPositions.ts): `src/EditorView/CodeBlockPositions.ts`
- [Shared utilities](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/Utils.ts): `src/Utils.ts`
- [Language and style constants](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/Const.ts): `src/Const.ts`

### Code presentation

- [Editor decorations](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/EditorView/MainViewPlugin.ts): `src/EditorView/MainViewPlugin.ts`
- [Reading renderer](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ReadingView/CodeBlockRenderer.ts): `src/ReadingView/CodeBlockRenderer.ts`
- [Reading post-processors](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ReadingView/PostProcessors.ts): `src/ReadingView/PostProcessors.ts`
- [Inline code](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ReadingView/InlineCodeRenderer.ts): `src/ReadingView/InlineCodeRenderer.ts`
- [View utilities](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ReadingView/ReadingViewUtils.ts): `src/ReadingView/ReadingViewUtils.ts`

### Customization features

- [Tabbed code groups](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ReadingView/GroupedCodeBlockRenderer.ts): `src/ReadingView/GroupedCodeBlockRenderer.ts`
- [Editor code groups](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/EditorView/GroupedCodeBlocks.ts): `src/EditorView/GroupedCodeBlocks.ts`
- [Code folding](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/EditorView/Folding.ts): `src/EditorView/Folding.ts`
- [Terminal prompts](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/PromptManager.ts): `src/PromptManager.ts`
- [Highlight rules](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/HighlightRules.ts): `src/HighlightRules.ts`
- [HTML code blocks](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/HtmlCodeBlocks.ts): `src/HtmlCodeBlocks.ts`
- [Code execution integration](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/ExecuteCode.ts): `src/ExecuteCode.ts`

### Settings

- [Plugin settings](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/Settings.ts): `src/Settings.ts`
- [Settings interface](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/SettingsTab/SettingsTab.ts): `src/SettingsTab/SettingsTab.ts`
- [Syntax theme defaults](https://github.com/mugiwara85/codeblockcustomizer/blob/master/src/SyntaxThemeDefaults.ts): `src/SyntaxThemeDefaults.ts`

### Other components

- **Obsidian user**
- **Markdown code**

## Connections

- Obsidian user → Plugin runtime: uses (evidence: `README.md`)
- Obsidian user → Markdown code: authors (evidence: `README.md`)
- Markdown code → Parameter parser: sets parameters (evidence: `README.md`)
- Plugin runtime → Editor decorations: registers extensions (evidence: `src/main.ts`)
- Plugin runtime → Settings interface: registers settings (evidence: `src/main.ts`)
- Plugin runtime → Syntax theme defaults: loads defaults (evidence: `src/main.ts`)
- Plugin runtime → Block positions: imports (evidence: `src/main.ts`)
- Block positions → Parameter parser: parses blocks (evidence: `src/EditorView/CodeBlockPositions.ts`)
- Block positions → HTML code blocks: finds HTML blocks (evidence: `src/EditorView/CodeBlockPositions.ts`)
- Editor decorations → Parameter parser: uses parameters (evidence: `src/EditorView/MainViewPlugin.ts`)
- Editor decorations → Terminal prompts: uses prompts (evidence: `src/EditorView/MainViewPlugin.ts`)
- Editor decorations → Highlight rules: uses rules (evidence: `src/EditorView/MainViewPlugin.ts`)
- Plugin runtime → Reading renderer: registers renderer (evidence: `src/main.ts`)
- Plugin runtime → Tabbed code groups: registers renderer (evidence: `src/main.ts`)
- Plugin runtime → Inline code: registers renderer (evidence: `src/main.ts`)
- Plugin runtime → Reading post-processors: registers processors (evidence: `src/main.ts`)
- Reading renderer → View utilities: uses utilities (evidence: `src/ReadingView/CodeBlockRenderer.ts`)
- Reading renderer → Parameter parser: uses parameters (evidence: `src/ReadingView/CodeBlockRenderer.ts`)
- Reading renderer → Shared utilities: loads Prism (evidence: `src/ReadingView/CodeBlockRenderer.ts`)
- Reading post-processors → Reading renderer: uses renderer (evidence: `src/ReadingView/PostProcessors.ts`)
- Inline code → Parameter parser: parses inline parameters (evidence: `src/ReadingView/InlineCodeRenderer.ts`)
- Inline code → Highlight rules: uses rules (evidence: `src/ReadingView/InlineCodeRenderer.ts`)
- Settings interface → Plugin settings: edits settings (evidence: `src/SettingsTab/SettingsTab.ts`)
- Settings interface → Syntax theme defaults: uses defaults
- Parameter parser → Terminal prompts: resolves prompt definitions (evidence: `src/Parsing.ts`)
- Parameter parser → HTML code blocks: converts HTML fences (evidence: `src/Parsing.ts`)
- Editor code groups → Block positions: uses positions (evidence: `src/EditorView/GroupedCodeBlocks.ts`)
- Code folding → Block positions: uses positions (evidence: `src/EditorView/Folding.ts`)
- Code execution integration → Parameter parser: uses parameters (evidence: `src/ExecuteCode.ts`)
