How ajarallah/matn works
Matn is a local Arabic-first Markdown reader. The main workflow is: a reader opens a file, folder, or stdin through the CLI; a local HTTP server serves the browser reader and workspace content; rendering and navigation features support reading; optional reader state is persisted separately. The README also documents book navigation, link health, exports, and other reader capabilities. Some browser-side wiring and server routes were not sampled, so those relationships are omitted or marked unverified.
Main entry points: server.mjs Local HTTP server · index.html Browser reader · link-core.cjs Links and health · matn.mjs CLI
Components 15
Launch and serving
- CLI
bin/matn.mjs - Stdin session
src/stdin-session.mjs - Local HTTP server
src/server.mjs
Reading and content
- Browser reader
src/index.html - Markdown rendering
src/render-core.cjs - Large-file rendering
src/render-worker.js - Annotations
src/annotation-core.cjs
Workspace navigation
- Markdown file rules
src/markdown-files.cjs - Search and indexing
src/search-core.cjs - Links and health
src/link-core.cjs - Book navigation
src/book-core.cjs
Reader state and actions
- State actions
src/state-actions.cjs - Persistent state
src/state-store.mjs - File actions
src/platform-actions.mjs
Other components
- Reader
Connections 21
- Reader → CLI: opens content
README.md - CLI → Stdin session: creates session
bin/matn.mjs - CLI → Local HTTP server: starts server
bin/matn.mjs - Local HTTP server → Browser reader: serves reader
src/server.mjs - Browser reader → Local HTTP server: requests content
- Local HTTP server → Markdown rendering: uses core
src/server.mjs - Browser reader → Markdown rendering: renders content
- Browser reader → Large-file rendering: dispatches large files
- Browser reader → Annotations: supports annotations
- Local HTTP server → Markdown file rules: uses rules
src/server.mjs - Local HTTP server → Search and indexing: indexes and searches
src/server.mjs - Local HTTP server → Links and health: checks links
src/server.mjs - Links and health → Search and indexing: uses normalization
src/link-core.cjs - Links and health → Markdown rendering: uses render rules
src/link-core.cjs - Links and health → Markdown file rules: uses filename rules
src/link-core.cjs - Local HTTP server → Book navigation: supports book navigation
src/server.mjs - Browser reader → Book navigation: navigates chapters
- Local HTTP server → Persistent state: reads and updates
src/server.mjs - Persistent state → State actions: applies actions
src/state-store.mjs - Local HTTP server → File actions: runs file actions
src/server.mjs - Browser reader → Persistent state: persists reader state