diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a44ee2..41fa111 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,15 +9,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added -* Escape HTML strings -* `id` and `class` attributes +* `Node`, `Attribute` and `Document` types +* `html` function to create an html document +* Attribute values and text nodes are escaped for HTML +* `lang`, `id` and `class` attributes * Nodes * Html document (`html`, `head` and `body`) * Meta (`title`) - * Text (`h1`, `h2`, `h3`, `h4`, `h5`, `h6`, and `text`) + * Text (`h1` to `h6`, and `text`) * Container (`div`) - * Escape hatches (`raw and `raw_unsafe`) -* `Node`, `Attribute` and `Document` types + * Escape hatches (`raw` and `raw_unsafe`) * implement `From<(&'static str, Cow<'static, str)>` for `Attribute` * implement `From<&'static str>` and `From` for `Node` * implement `From<[Node; N]>` and `From>` for `Node` (group nodes without wrapping them in a `div`) diff --git a/src/lib.rs b/src/lib.rs index 6fcf92b..b520fc2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,13 +3,6 @@ pub mod attributes; pub mod nodes; -pub mod prelude { - pub use crate::attributes::*; - pub use crate::html; - pub use crate::nodes::*; - pub use crate::{Attribute, Document, Node}; -} - use std::{borrow::Cow, fmt::Display}; #[derive(Debug, Clone)] diff --git a/tests/render_spec.rs b/tests/render_spec.rs index 8df3581..e3ae35f 100644 --- a/tests/render_spec.rs +++ b/tests/render_spec.rs @@ -1,6 +1,6 @@ use rstest::rstest; -use fun_html::prelude::*; +use fun_html::{attributes::*, html, nodes::*, Attribute, Document, Node}; #[test] fn should_render_empty_document() {