Add template for quote blocks.
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user