Add regular link.
This commit is contained in:
@@ -6,18 +6,39 @@ use crate::config::Config;
|
||||
use crate::error::CustomError;
|
||||
use crate::intermediate::IRegularLink;
|
||||
|
||||
use super::RenderObject;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename = "regular_link")]
|
||||
pub(crate) struct RenderRegularLink {}
|
||||
pub(crate) struct RenderRegularLink {
|
||||
path: String,
|
||||
children: Vec<RenderObject>,
|
||||
}
|
||||
|
||||
impl RenderRegularLink {
|
||||
pub(crate) fn new(
|
||||
config: &Config,
|
||||
output_directory: &Path,
|
||||
output_file: &Path,
|
||||
comment: &IRegularLink,
|
||||
regular_link: &IRegularLink,
|
||||
) -> Result<RenderRegularLink, CustomError> {
|
||||
Ok(RenderRegularLink {})
|
||||
let children = {
|
||||
let mut ret = Vec::new();
|
||||
for obj in regular_link.children.iter() {
|
||||
ret.push(RenderObject::new(
|
||||
config,
|
||||
&output_directory,
|
||||
&output_file,
|
||||
obj,
|
||||
)?);
|
||||
}
|
||||
ret
|
||||
};
|
||||
|
||||
Ok(RenderRegularLink {
|
||||
path: regular_link.path.clone(),
|
||||
children,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user