diff options
-rw-r--r-- | src/doc.rs | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -234,13 +234,19 @@ impl Document { assert!(level <= 6); let mut number = Element::new(ElementTag::Span); + number.push_attribute(Attribute::new("class", "heading-number")); number.push_child(Content::Text(numberer.number(level))); + let mut htext = Element::new(ElementTag::Span); + htext.push_attribute(Attribute::new("class", "heading-text")); + htext.push_child(Content::Text(text)); + let mut a = Element::new(ElementTag::A); a.push_attribute(crate::html::Attribute::new("href", &format!("#{}", id))); + a.push_attribute(Attribute::new("class", "toc-link")); a.push_child(Content::Elt(number)); a.push_child(Content::Text(" ".into())); - a.push_child(Content::Text(text)); + a.push_child(Content::Elt(htext)); let mut li = Element::new(ElementTag::Li); li.push_child(Content::Elt(a)); @@ -288,6 +294,7 @@ impl Document { fn typeset_meta(&self) -> Element { let mut div = Element::new(ElementTag::Div); + div.push_attribute(Attribute::new("class", "meta")); div.push_child(Content::Elt(Self::title(self.meta.title()))); @@ -304,12 +311,14 @@ impl Document { fn title(title: &str) -> Element { let mut e = Element::new(ElementTag::H1); + e.push_attribute(Attribute::new("class", "title")); e.push_child(Content::Text(title.into())); e } fn authors(authors: &[String]) -> Element { let mut list = Element::new(ElementTag::P); + list.push_attribute(Attribute::new("class", "authors")); list.push_child(Content::Text("By: ".into())); let mut first = true; for a in authors { @@ -324,6 +333,7 @@ impl Document { fn date(date: &str) -> Element { let mut e = Element::new(ElementTag::P); + e.push_attribute(Attribute::new("class", "date")); e.push_child(Content::Text(date.into())); e } |