Add children to heading.
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user