diff options
author | Vika <vika@fireburn.ru> | 2023-08-08 14:57:28 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2023-08-08 14:57:28 +0300 |
commit | 27b5bcc274675eab956e70bc59ba3e137e5aa676 (patch) | |
tree | c931a316ea47c9a148c684baace8c4c34271e5a8 /templates-neo/src/mf2.rs | |
parent | fbea42e5494c96174097bf3809a5b53d11d68a48 (diff) | |
download | kittybox-27b5bcc274675eab956e70bc59ba3e137e5aa676.tar.zst |
templates-neo: add a test CLI that renders entries
This allows interactively testing the markup.
Diffstat (limited to 'templates-neo/src/mf2.rs')
-rw-r--r-- | templates-neo/src/mf2.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/templates-neo/src/mf2.rs b/templates-neo/src/mf2.rs index c4d49a2..e59b51c 100644 --- a/templates-neo/src/mf2.rs +++ b/templates-neo/src/mf2.rs @@ -18,7 +18,7 @@ pub enum Error { got: PropertyValue }, #[error("missing property: {0}")] - MissingProperty(&'static str) + MissingProperty(&'static str), } pub enum Image { @@ -30,7 +30,7 @@ pub enum Image { } impl Image { - fn build(self, img: &mut html::media::builders::ImageBuilder) -> &mut html::media::builders::ImageBuilder { + pub fn build(self, img: &mut html::media::builders::ImageBuilder) -> &mut html::media::builders::ImageBuilder { match self { Image::Plain(url) => img.src(String::from(url)), Image::Accessible { src, alt } => img.src(String::from(src)).alt(alt) @@ -132,7 +132,7 @@ impl TryFrom<Item> for Card { } impl Card { - fn build_section(self, section: &mut html::content::builders::SectionBuilder) -> &mut html::content::builders::SectionBuilder { + pub fn build_section(self, section: &mut html::content::builders::SectionBuilder) -> &mut html::content::builders::SectionBuilder { section .class("mini-h-card") .anchor(|a| a @@ -143,7 +143,7 @@ impl Card { ) } - fn build(self, article: &mut html::content::builders::ArticleBuilder) -> &mut html::content::builders::ArticleBuilder { + pub fn build(self, article: &mut html::content::builders::ArticleBuilder) -> &mut html::content::builders::ArticleBuilder { let urls: Vec<_> = self.urls.into_iter().filter(|u| *u != self.uid).collect(); article @@ -373,7 +373,7 @@ impl TryFrom<Item> for Entry { } impl Entry { - fn build(self, article: &mut ArticleBuilder) -> &mut ArticleBuilder { + pub fn build(self, article: &mut ArticleBuilder) -> &mut ArticleBuilder { article .class("h-entry") .header(|header| header @@ -406,7 +406,7 @@ impl Entry { }) ) }) - ) + ) .main(|main| { if let Some(lang) = self.content.0.lang { main.lang(lang); |