Add children to heading.

This commit is contained in:
Tom Alexander
2023-10-27 18:59:40 -04:00
parent bd982fb62d
commit c279bad13a
62 changed files with 406 additions and 203 deletions

View File

@@ -16,17 +16,24 @@ pub(crate) struct RenderSection {
}
impl RenderSection {
pub(crate) fn new<D: AsRef<Path>, F: AsRef<Path>>(
pub(crate) fn new(
config: &Config,
output_directory: D,
output_file: F,
output_directory: &Path,
output_file: &Path,
section: &ISection,
) -> Result<RenderSection, CustomError> {
let children = section
.children
.iter()
.map(|obj| RenderElement::new(config, &output_directory, &output_file, obj))
.collect::<Result<Vec<_>, _>>()?;
let children = {
let mut ret = Vec::new();
for obj in section.children.iter() {
ret.push(RenderElement::new(
config,
&output_directory,
&output_file,
obj,
)?);
}
ret
};
Ok(RenderSection { children })
}