summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2024-04-20 09:45:48 +0300
committerLars Wirzenius <liw@liw.fi>2024-04-20 09:45:48 +0300
commitbe6eb22bb2336d6509a3030e079614b59da75cb8 (patch)
treeb57a2c6cba81bd805a3f7071eda4ff2c852a600e
parent296dcf7ec3b45e085c41f4938dd8b1ad71e921b5 (diff)
downloadhtml-page-be6eb22bb2336d6509a3030e079614b59da75cb8.tar.gz
feat! rename Document to HtmlPage0.3.0
HtmlPage seems like a better name. Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/lib.rs12
3 files changed, 8 insertions, 8 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 2847138..e7c4361 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -13,7 +13,7 @@ dependencies = [
[[package]]
name = "html-page"
-version = "0.2.1"
+version = "0.3.0"
dependencies = [
"html-escape",
]
diff --git a/Cargo.toml b/Cargo.toml
index 282f0d2..c644710 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "html-page"
-version = "0.2.1"
+version = "0.3.0"
edition = "2021"
authors = [
"Lars Wirzenius <liw@liw.fi>",
diff --git a/src/lib.rs b/src/lib.rs
index fe22010..946db72 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -28,19 +28,19 @@ use std::fmt::{Display, Formatter};
/// An HTML document ("page'),consisting of a head and a body element.
///
/// ~~~
-/// # use html_page::{Document, Element, Tag};
+/// # use html_page::{HtmlPage, Element, Tag};
/// let title = Element::new(Tag::Title).with_text("my page");
-/// let doc = Document::default().with_head_element(title);
+/// let doc = HtmlPage::default().with_head_element(title);
/// assert_eq!(format!("{}", doc), "<!DOCTYPE html>\n<HTML>\n\
/// <HEAD><TITLE>my page</TITLE></HEAD>\n<BODY/>\n</HTML>\n");
/// ~~~
#[derive(Clone, Debug, Eq, PartialEq)]
-pub struct Document {
+pub struct HtmlPage {
head: Element,
body: Element,
}
-impl Default for Document {
+impl Default for HtmlPage {
fn default() -> Self {
Self {
head: Element::new(Tag::Head),
@@ -49,7 +49,7 @@ impl Default for Document {
}
}
-impl Document {
+impl HtmlPage {
/// Append an element to the head.
pub fn push_to_head(&mut self, e: Element) {
self.head.push_child(e);
@@ -86,7 +86,7 @@ impl Document {
}
}
-impl Display for Document {
+impl Display for HtmlPage {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> {
writeln!(f, "<!DOCTYPE html>")?;
writeln!(f, "<{}>", Tag::Html)?;