
This is largely to make changing the type signature of these functions easier by significantly reducing the amount of places that duplicates the signature.
43 lines
869 B
Rust
43 lines
869 B
Rust
use std::path::Path;
|
|
|
|
use serde::Serialize;
|
|
|
|
use crate::config::Config;
|
|
use crate::error::CustomError;
|
|
use crate::intermediate::IQuoteBlock;
|
|
|
|
use super::macros::render;
|
|
use super::RenderElement;
|
|
|
|
#[derive(Debug, Serialize)]
|
|
#[serde(tag = "type")]
|
|
#[serde(rename = "quote_block")]
|
|
pub(crate) struct RenderQuoteBlock {
|
|
children: Vec<RenderElement>,
|
|
}
|
|
|
|
render!(
|
|
RenderQuoteBlock,
|
|
IQuoteBlock,
|
|
original,
|
|
config,
|
|
output_directory,
|
|
output_file,
|
|
{
|
|
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 })
|
|
}
|
|
);
|