Add render phase to tables.
This commit is contained in:
42
src/context/table_cell.rs
Normal file
42
src/context/table_cell.rs
Normal file
@@ -0,0 +1,42 @@
|
||||
use std::path::Path;
|
||||
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::error::CustomError;
|
||||
use crate::intermediate::ITableCell;
|
||||
|
||||
use super::macros::render;
|
||||
use super::RenderObject;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[serde(tag = "type")]
|
||||
#[serde(rename = "table_cell")]
|
||||
pub(crate) struct RenderTableCell {
|
||||
children: Vec<RenderObject>,
|
||||
}
|
||||
|
||||
render!(
|
||||
RenderTableCell,
|
||||
ITableCell,
|
||||
original,
|
||||
config,
|
||||
output_directory,
|
||||
output_file,
|
||||
{
|
||||
let children = {
|
||||
let mut ret = Vec::new();
|
||||
for obj in original.children.iter() {
|
||||
ret.push(RenderObject::new(
|
||||
config,
|
||||
output_directory,
|
||||
output_file,
|
||||
obj,
|
||||
)?);
|
||||
}
|
||||
ret
|
||||
};
|
||||
|
||||
Ok(RenderTableCell { children })
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user