domrs/
lib.rs

1//! # Overview
2//!
3//! **domrs** is a powerful library designed to streamline the creation
4//! and serialization of HTML, CSS and SVG documents.
5//!
6//! **domrs** empowers developers with a concise and intuitive interface to effortlessly
7//! construct structured and visually appealing documents.
8//!
9//! Key features:
10//!
11//! - **HTML, CSS and SVG support**: seamlessly build HTML web pages, stylized CSS documents
12//!   and dynamic SVG graphics using Rust's strong typing and safety.
13//!
14//! - **Builder pattern**: enjoy the convenience of a builder pattern for creating complex
15//!   document structures, ensuring code readability and maintainability.
16//!
17//! - **Serialization**: effortlessly serialize created documents into standard-compliant
18//!   HTML, CSS or SVG files, facilitating easy integration into web applications,
19//!   storage or reporting tools.
20//!
21//! With its ergonomic design and robust functionality, **domrs** offers a hassle-free
22//! solution for developers seeking a reliable tool to craft web-based documents within Rust projects.
23//! Whether you're building a web app, generating dynamic graphics, or managing stylesheets,
24//! **domrs** provides the tools you need.
25//!
26//! Get started with **domrs** today and unlock the potential for efficient
27//! document creation and serialization in Rust!
28//!
29//! # Getting started
30//!
31//! ## Create HTML document
32//!
33//! ```
34//! use domrs::HtmlDocument;
35//!
36//! let html = HtmlDocument::new();
37//! assert_eq!("<html/>\n", html.to_string());
38//! ```
39//!
40//! ## Create CSS stylesheet
41//!
42//! ```
43//! use domrs::CssDocument;
44//!
45//! let css = CssDocument::new();
46//! assert_eq!("", css.to_string());
47//! ```
48//!
49//! ## Create SVG graphics
50//!
51//! ```
52//! use domrs::SvgDocument;
53//!
54//! let svg = SvgDocument::new();
55//! assert_eq!("<svg/>", svg.to_string());
56//! ```
57
58// #![deny(missing_docs)]
59// #![deny(rustdoc::broken_intra_doc_links)]
60
61mod common;
62mod css;
63mod html;
64mod svg;
65
66pub use common::ToText;
67pub use css::{
68  CssAtRule, CssBorder, CssBorderStyle, CssColor, CssDeclaration, CssDocument, CssElement, CssFontFamily, CssFontGenericFamily, CssFontStyle, CssGroup, CssNumber, CssProperty,
69  CssRuleset, CssSelector, CssSelectorPart, CssUnit, CssValue, DEFAULT_CSS_INDENT, DEFAULT_CSS_OFFSET,
70};
71pub use html::{
72  HtmlAttribute, HtmlBodyElement, HtmlDocument, HtmlElement, HtmlHeadElement, HtmlLinkElement, HtmlStyleElement, DEFAULT_HTML_DOCTYPE, DEFAULT_HTML_INDENT, DEFAULT_HTML_LANGUAGE,
73  DEFAULT_HTML_NAMESPACE, DEFAULT_HTML_OFFSET,
74};
75pub use svg::{SvgAttribute, SvgDocument, SvgNumber, DEFAULT_SVG_INDENT, DEFAULT_SVG_OFFSET};