Add render phase to tables.
This commit is contained in:
@@ -6,11 +6,37 @@ use crate::config::Config;
|
||||
use crate::error::CustomError;
|
||||
use crate::intermediate::ITable;
|
||||
|
||||
use super::macros::rnoop;
|
||||
use super::macros::render;
|
||||
use super::table_row::RenderTableRow;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename = "table")]
|
||||
pub(crate) struct RenderTable {}
|
||||
pub(crate) struct RenderTable {
|
||||
children: Vec<RenderTableRow>,
|
||||
}
|
||||
|
||||
rnoop!(RenderTable, ITable);
|
||||
render!(
|
||||
RenderTable,
|
||||
ITable,
|
||||
original,
|
||||
config,
|
||||
output_directory,
|
||||
output_file,
|
||||
{
|
||||
let children = {
|
||||
let mut ret = Vec::new();
|
||||
for obj in original.children.iter() {
|
||||
ret.push(RenderTableRow::new(
|
||||
config,
|
||||
output_directory,
|
||||
output_file,
|
||||
obj,
|
||||
)?);
|
||||
}
|
||||
ret
|
||||
};
|
||||
|
||||
Ok(RenderTable { children })
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user