# deathau/cm-typewriter-scroll-obsidian architecture

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

- Interactive diagram: https://gitdiagram.com/deathau/cm-typewriter-scroll-obsidian
- Repository: https://github.com/deathau/cm-typewriter-scroll-obsidian

## Overview

This Obsidian plugin provides centered typewriter scrolling, adjustable vertical offset, and an optional Zen mode that dims inactive editor lines. The user enables or configures it through Obsidian; the plugin applies settings to the editor and updates its styling. The main implementation has a CodeMirror 6 extension and a legacy CodeMirror add-on. The README documents the user-facing capabilities; the edges between implementation files are based on the shown imports and calls.

Main entry points: [`main.ts`](https://github.com/deathau/cm-typewriter-scroll-obsidian/blob/main/main.ts) (Plugin settings and commands), [`extension.ts`](https://github.com/deathau/cm-typewriter-scroll-obsidian/blob/main/extension.ts) (CodeMirror 6 scrolling), [`typewriter-scrolling.js`](https://github.com/deathau/cm-typewriter-scroll-obsidian/blob/main/typewriter-scrolling.js) (Legacy CodeMirror scrolling), [`styles.scss`](https://github.com/deathau/cm-typewriter-scroll-obsidian/blob/main/styles.scss) (Zen and scroll styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Plugin control"]
  node_plugin["Plugin settings and commands<br/>[main.ts]"]
end

subgraph group_editor["Editor scrolling"]
  node_cm6["CodeMirror 6 scrolling<br/>[extension.ts]"]
  node_legacy["Legacy CodeMirror scrolling"]
end

subgraph group_presentation["Editor presentation"]
  node_styles["Zen and scroll styles<br/>[styles.scss]"]
end

node_obsidian(("Obsidian"))

node_obsidian -->|"loads plugin"| node_plugin
node_plugin -->|"registers extension"| node_cm6
node_plugin -->|"sets option"| node_legacy
node_plugin -->|"imports styles"| node_styles

click node_plugin "https://github.com/deathau/cm-typewriter-scroll-obsidian/blob/main/main.ts"
click node_cm6 "https://github.com/deathau/cm-typewriter-scroll-obsidian/blob/main/extension.ts"
click node_legacy "https://github.com/deathau/cm-typewriter-scroll-obsidian/blob/main/typewriter-scrolling.js"
click node_styles "https://github.com/deathau/cm-typewriter-scroll-obsidian/blob/main/styles.scss"

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 toneBlue
class node_cm6,node_legacy toneAmber
class node_styles toneMint
class node_obsidian toneIndigo
```

## Components

### Plugin control

- [Plugin settings and commands](https://github.com/deathau/cm-typewriter-scroll-obsidian/blob/main/main.ts): `main.ts`

### Editor scrolling

- [CodeMirror 6 scrolling](https://github.com/deathau/cm-typewriter-scroll-obsidian/blob/main/extension.ts): `extension.ts`
- [Legacy CodeMirror scrolling](https://github.com/deathau/cm-typewriter-scroll-obsidian/blob/main/typewriter-scrolling.js): `typewriter-scrolling.js`

### Editor presentation

- [Zen and scroll styles](https://github.com/deathau/cm-typewriter-scroll-obsidian/blob/main/styles.scss): `styles.scss`

### Other components

- **Obsidian**

## Connections

- Obsidian → Plugin settings and commands: loads plugin (evidence: `README.md`)
- Plugin settings and commands → CodeMirror 6 scrolling: registers extension (evidence: `main.ts`)
- Plugin settings and commands → Legacy CodeMirror scrolling: sets option (evidence: `main.ts`)
- Plugin settings and commands → Zen and scroll styles: imports styles (evidence: `main.ts`)
