How snezhig/obsidian-front-matter-title works
Project type and purpose
• This is an Obsidian plugin written in TypeScript. Its job is to take the YAML front-matter in a Markdown file and display a custom “title” (or other front-matter value) instead of the filename in Obsidian’s Explorer and Graph views.
File structure
• Top-level:
• config/ – Inversify DI container setup and service-binding configurations
• src/ – Core plugin code under these major areas:
· Components – low-level building blocks (EventDispatcher, Cache, Processor, Extractor, ApiAdapter, etc.)
· Creator – assembles the display title from template definitions and placeholders
· Feature – each Obsidian feature (Explorer, Graph, Backlink, NoteLink, etc.) lives here, managed by FeatureService
· Resolver – reads front-matter values using strategies (ArrayStrategy, BooleanStrategy, etc.)
· Settings – settings UI (SettingsTab) and builder patterns to construct plugin options
· Obsidian – a façade abstracting Obsidian API calls
· Storage/Migrator – persistent storage and version migration handlers
· i18n – localization support for multiple languages
• main.ts – plugin entrypoint (Obsidian’s onload/onunload hooks)
• utils/ – bundling and release scripts (esbuild, pack, version bump)
• modules/api-provider – optional external API provider integration
README for additional insights
• Confirms it is strictly a client-side Obsidian plugin, no backend or external server.
• Major feature: templating engine for “title” extraction.
• Points to docs/ for details on Features, Processors, TemplateExamples.
a. Main Components
1. Obsidian Platform
2. FrontMatterTitlePlugin (main.ts & App.ts)
3. DI Container (config/inversify.config.ts)
4. Core Services:
• EventDispatcher
• Resolver (with cached proxy)
• Creator (Template Factory / Composite)
• Processor pipeline
• Cache
• Storage & Migrator
5. FeatureService & FeatureComposer (registers all AbstractFeature implementations)
6. Individual Feature Modules (ExplorerManager, GraphManager, NoteLinkFeature, etc.)
7. Settings UI (SettingsTab + FeatureBuilder / SettingBuilders)
8. i18n module
9. Optional API Adapter & external API provider module
b. Relationships & Data Flows
• Plugin onload → initialize DI container → bind interfaces to implementations
• DI Container → instantiate core services & FeatureService & SettingsService
• Plugin registers SettingsTab and FeatureService listeners in Obsidian API
• User action/file events in Obsidian → EventDispatcher → FeatureService
• FeatureService → for each enabled feature: uses Resolver to read front-matter → Creator to build display string → EventDispatcher or directly calls ObsidianFacade to update UI
• SettingsTab changes → SettingBuilders → update SettingsService → propagate to FeatureService or Processor configurations
• i18n used by UI components and Features to render localized labels
• Cache used by Resolver/Creator to avoid redundant computations
c. Architectural Patterns & Design Principles
• Dependency Injection (Inversify) for loose coupling
• Observer / Event Dispatcher for decoupled event handling
• Strategy pattern in Resolver/Extractor strategies
• Composite + Factory in Template Placeholders (Simple, Composite, BracketsPlaceholder, etc.)
• Builder pattern in Settings (FeatureBuilder, SettingBuilders)
• Proxy pattern in ResolverCachedProxy
d. Key Technologies / Frameworks
• TypeScript
• Inversify (DI)
• Obsidian API (plugin SDK)
• esbuild (bundling)
• Jest (unit tests)
Detail
• Both static structure (packages, classes) and dynamic flows (event dispatch, service calls)
• Don’t omit patterns: label “Strategy”, “Composite”, “Observer” where they occur