Add comprehensive documentation and examples for Owlen architecture and usage
- Include detailed architecture overview in `docs/architecture.md`. - Add `docs/configuration.md`, detailing configuration file structure and settings. - Provide a step-by-step provider implementation guide in `docs/provider-implementation.md`. - Add frequently asked questions (FAQ) document in `docs/faq.md`. - Create `docs/migration-guide.md` for future breaking changes and version upgrades. - Introduce new examples in `examples/` showcasing basic chat, custom providers, and theming. - Add a changelog (`CHANGELOG.md`) for tracking significant changes. - Provide contribution guidelines (`CONTRIBUTING.md`) and a Code of Conduct (`CODE_OF_CONDUCT.md`).
This commit is contained in:
28
examples/custom_theme.rs
Normal file
28
examples/custom_theme.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
// This example demonstrates how to create a custom theme programmatically.
|
||||
|
||||
use owlen_core::theme::Theme;
|
||||
use ratatui::style::{Color, Style};
|
||||
|
||||
fn create_custom_theme() -> Theme {
|
||||
Theme {
|
||||
name: "My Custom Theme".to_string(),
|
||||
author: "Your Name".to_string(),
|
||||
comment: "A simple custom theme".to_string(),
|
||||
base: Style::default().fg(Color::White).bg(Color::Black),
|
||||
user_chat: Style::default().fg(Color::Green),
|
||||
bot_chat: Style::default().fg(Color::Cyan),
|
||||
error: Style::default().fg(Color::Red),
|
||||
info: Style::default().fg(Color::Yellow),
|
||||
border: Style::default().fg(Color::Gray),
|
||||
input: Style::default().fg(Color::White),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let custom_theme = create_custom_theme();
|
||||
|
||||
println!("Created custom theme: {}", custom_theme.name);
|
||||
println!("Author: {}", custom_theme.author);
|
||||
println!("User chat color: {:?}", custom_theme.user_chat.fg);
|
||||
}
|
||||
Reference in New Issue
Block a user