Module spreadsheet_ods::text

source ·
Expand description

Text is stored as a simple String whenever possible. When there is a more complex structure, a TextTag is constructed which mirrors the Xml tree structure.

For construction of a new TextTag structure a few helper structs are defined.

use spreadsheet_ods::text::{TextP, TextTag, MetaAuthorName, MetaCreationDate, TextS};
use spreadsheet_ods::style::ParagraphStyleRef;

let p1_ref = ParagraphStyleRef::from("p1");

let txt = TextP::new()
            .style_name(&p1_ref)
            .text("some text")
            .tag(MetaAuthorName::new())
            .tag(TextS::new())
            .tag(MetaCreationDate::new())
            .tag(TextS::new())
            .text("whatever");
println!("{}", txt.into_xmltag());

Structs§

Type Aliases§