Add template for quote blocks.

This commit is contained in:
Tom Alexander
2023-10-27 19:53:18 -04:00
parent f6c475c80c
commit 5bbb12327b
5 changed files with 204 additions and 166 deletions

View File

@@ -6,10 +6,14 @@ use crate::config::Config;
use crate::error::CustomError;
use crate::intermediate::IQuoteBlock;
use super::RenderElement;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "quote_block")]
pub(crate) struct RenderQuoteBlock {}
pub(crate) struct RenderQuoteBlock {
children: Vec<RenderElement>,
}
impl RenderQuoteBlock {
pub(crate) fn new(
@@ -18,6 +22,19 @@ impl RenderQuoteBlock {
output_file: &Path,
original: &IQuoteBlock,
) -> Result<RenderQuoteBlock, CustomError> {
Ok(RenderQuoteBlock {})
let children = {
let mut ret = Vec::new();
for obj in original.children.iter() {
ret.push(RenderElement::new(
config,
&output_directory,
&output_file,
obj,
)?);
}
ret
};
Ok(RenderQuoteBlock { children })
}
}