//! Type definitions and shared constants for the markdown converter

use anyhow::Result;

/// Result type alias for cleaner error handling
pub type ConverterResult<T> = Result<T>;

/// Configuration for content conversion
#[derive(Debug, Clone)]
pub struct ConversionConfig {
    pub input_file: String,
    pub output_file: Option<String>,
    pub input_dir: Option<String>,
    pub output_dir: Option<String>,
    pub content_root_path: String,
    pub target_site_path: String,
}

impl ConversionConfig {
    /// Create a new conversion configuration with default paths
    pub fn new() -> Self {
        Self {
            input_file: String::new(),
            output_file: None,
            input_dir: None,
            output_dir: None,
            content_root_path: std::env::var("CONTENT_BUILD_PATH")
                .unwrap_or_else(|_| "content".to_string()),
            target_site_path: "target/site".to_string(),
        }
    }
}

impl Default for ConversionConfig {
    fn default() -> Self {
        Self::new()
    }
}
