Crate domrs

source ·
Expand description

Overview

domrs is a powerful library designed to streamline the creation and serialization of HTML, CSS and SVG documents.

domrs empowers developers with a concise and intuitive interface to effortlessly construct structured and visually appealing documents.

Key features:

  • HTML, CSS and SVG support: seamlessly build HTML web pages, stylized CSS documents and dynamic SVG graphics using Rust’s strong typing and safety.

  • Builder pattern: enjoy the convenience of a builder pattern for creating complex document structures, ensuring code readability and maintainability.

  • Serialization: effortlessly serialize created documents into standard-compliant HTML, CSS or SVG files, facilitating easy integration into web applications, storage or reporting tools.

With its ergonomic design and robust functionality, domrs offers a hassle-free solution for developers seeking a reliable tool to craft web-based documents within Rust projects. Whether you’re building a web app, generating dynamic graphics, or managing stylesheets, domrs provides the tools you need.

Get started with domrs today and unlock the potential for efficient document creation and serialization in Rust!

Getting started

Create HTML document

use domrs::HtmlDocument;

let html = HtmlDocument::new();
assert_eq!("<html/>\n", html.to_string());

Create CSS stylesheet

use domrs::CssDocument;

let css = CssDocument::new();
assert_eq!("", css.to_string());

Create SVG graphics

use domrs::SvgDocument;

let svg = SvgDocument::new();
assert_eq!("<svg/>", svg.to_string());

Macros

  • Creates <h1> HTML element. The section heading level 1 element.
  • Creates <h2> HTML element. The section heading level 2 element.
  • Creates <h3> HTML element. The section heading level 3 element.
  • Creates <h4> HTML element. The section heading level 4 element.
  • Creates <h5> HTML element. The section heading level 5 element.
  • Creates <h6> HTML element. The section heading level 6 element.

Structs

Enums

Constants

Traits

  • A trait for converting value to a textual representation with provided offset and indentation.