App and Managers
TheApp class is the central hub of Inkdown, coordinating all managers and the application lifecycle. This document covers the App class and all manager implementations.
App Class
Location:packages/core/src/App.ts
The App class is instantiated once per application and manages all core systems.
Construction
Properties
All managers are accessible as properties on the App instance:Lifecycle Methods
Manager Descriptions
PluginManager
Location:packages/core/src/PluginManager.ts
Manages the lifecycle of built-in and community plugins.
Key APIs
Configuration Storage
Plugin states are stored inapp.json under the plugins key:
ThemeManager
Location:packages/core/src/ThemeManager.ts
Manages theme loading, switching, and color scheme changes.
Key APIs
Built-in Themes
default-dark: Default dark themedefault-light: Default light theme
CommunityThemeManager
Location:packages/core/src/CommunityThemeManager.ts
Handles browsing, installing, and managing community themes from GitHub.
Key APIs
ConfigManager
Location:packages/core/src/ConfigManager.ts
Provides persistent key-value storage for application and plugin settings.
Key APIs
Config Files
| Key | File | Purpose |
|---|---|---|
app | app.json | Main application settings |
installed-themes | installed-themes.json | Community theme metadata |
installed-plugins | installed-plugins.json | Community plugin metadata |
editor | editor.json | Editor preferences |
shortcuts | shortcuts.json | Keyboard shortcuts |
TabManager
Location:packages/core/src/TabManager.ts
Manages editor tabs and their state.
Key APIs
Tab Structure
CommandManager
Location:packages/core/src/managers/CommandManager.ts
Central registry for all commands (keyboard shortcuts, command palette).
Key APIs
EditorRegistry
Location:packages/core/src/EditorRegistry.ts
Tracks CodeMirror editor instances.
Key APIs
Workspace
Location:packages/core/src/managers/Workspace.ts
Manages file operations and file events.
Key APIs
Manager Initialization Order
The App initializes managers in a specific order to handle dependencies:- ConfigManager - Needed by all other managers for loading settings
- FontManager - Load system fonts early
- ThemeManager - Apply theme before UI renders
- CommunityThemeManager - Scan installed themes
- SyncManager - Initialize sync system
- BookmarkManager - Load bookmarks
- TagManager - Load tags
- CommunityPluginManager - Load community plugins
- PluginManager - Load and enable all plugins
- TabManager - Restore tabs from last session
- CommandManager - Register core commands
Related Documentation
- Architecture Overview - High-level architecture
- Editor System - Editor architecture
- Theme System - Theme management details
- Config System - Configuration details
