28 lines
555 B
Rust
28 lines
555 B
Rust
use std::path::Path;
|
|
|
|
use serde::Serialize;
|
|
|
|
use crate::config::Config;
|
|
use crate::error::CustomError;
|
|
use crate::intermediate::IEntity;
|
|
|
|
#[derive(Debug, Serialize)]
|
|
#[serde(tag = "type")]
|
|
#[serde(rename = "entity")]
|
|
pub(crate) struct RenderEntity {
|
|
html: String,
|
|
}
|
|
|
|
impl RenderEntity {
|
|
pub(crate) fn new(
|
|
config: &Config,
|
|
output_directory: &Path,
|
|
output_file: &Path,
|
|
entity: &IEntity,
|
|
) -> Result<RenderEntity, CustomError> {
|
|
Ok(RenderEntity {
|
|
html: entity.html.clone(),
|
|
})
|
|
}
|
|
}
|