ratatui_toolkit/widgets/markdown_widget/foundation/source/mod.rs
1//! Markdown content source abstraction.
2//!
3//! Provides a unified interface for loading markdown content from either
4//! a string or a file path, with support for auto-reload when the file changes.
5
6mod constructors;
7mod methods;
8mod traits;
9
10use std::path::PathBuf;
11
12/// Represents the source of markdown content.
13///
14/// This enum provides a unified interface for working with markdown content
15/// that can come from either a static string or a file on disk.
16#[derive(Debug, Clone)]
17pub enum MarkdownSource {
18 /// Static string content (no auto-reload support).
19 String(String),
20
21 /// File-based content with auto-reload support.
22 File {
23 /// Path to the markdown file.
24 path: PathBuf,
25 /// Cached content from the file.
26 content: String,
27 },
28}