use quarto_error_reporting::{generic_error, generic_warning};
fn main() {
println!("=== Example 1: Using generic_error! macro ===\n");
let error = generic_error!("Something went wrong during migration");
println!("{}", error.to_text(None));
println!();
println!("Error code: {:?}", error.code);
println!();
println!("=== Example 2: Using generic_warning! macro ===\n");
let warning = generic_warning!("This feature is not yet fully migrated");
println!("{}", warning.to_text(None));
println!();
println!("=== Example 3: Migration pattern in practice ===\n");
let path = "/nonexistent/file.qmd";
let migration_error = generic_error!(format!("File not found: {}", path));
println!("Migration-style error:");
println!("{}", migration_error.to_text(None));
println!();
println!("=== Example 4: JSON output shows file/line info ===\n");
let error_with_location = generic_error!("Error with source tracking");
let json = error_with_location.to_json();
println!("{}", serde_json::to_string_pretty(&json).unwrap());
println!();
println!("Note: The generic_error! and generic_warning! macros are intended");
println!("for migration purposes only. New code should use DiagnosticMessageBuilder");
println!("with proper error codes (Q-X-Y) instead of Q-0-99.");
}