osd_core/lib.rs
1//! osd-core: OpenSequenceDiagrams core library - A sequence diagram parser and SVG renderer
2//!
3// Suppress some clippy warnings that are stylistic or too strict
4#![allow(clippy::too_many_arguments)]
5#![allow(clippy::type_complexity)]
6#![allow(clippy::uninlined_format_args)]
7#![allow(clippy::if_same_then_else)]
8#![allow(clippy::needless_range_loop)]
9#![allow(clippy::manual_strip)]
10#![allow(clippy::option_map_unit_fn)]
11#![allow(clippy::manual_inspect)]
12//!
13//! # Example
14//!
15//! ```
16//! use osd_core::{parse, render};
17//!
18//! let input = r#"
19//! title Example
20//! Alice->Bob: Hello
21//! Bob-->Alice: Hi there
22//! "#;
23//!
24//! let diagram = parse(input).unwrap();
25//! let svg = render(&diagram);
26//! println!("{}", svg);
27//! ```
28//!
29//! # Themed rendering
30//!
31//! ```
32//! use osd_core::{parse, render_with_config, Config, Theme};
33//!
34//! let input = "Alice->Bob: Hello";
35//! let diagram = parse(input).unwrap();
36//! let config = Config::default().with_theme(Theme::modern_blue());
37//! let svg = render_with_config(&diagram, config);
38//! ```
39
40pub mod ast;
41pub mod parser;
42pub mod renderer;
43pub mod theme;
44
45pub use ast::*;
46pub use parser::{parse, ParseError};
47pub use renderer::{render, render_with_config, Config};
48pub use theme::{LifelineStyle, ParticipantShape, Theme};