2023-10-27 21:08:58 +00:00
|
|
|
use serde::Serialize;
|
|
|
|
|
2023-12-19 20:42:37 +00:00
|
|
|
use super::render_context::RenderContext;
|
2023-10-27 21:08:58 +00:00
|
|
|
use crate::error::CustomError;
|
|
|
|
use crate::intermediate::ISrcBlock;
|
|
|
|
|
2023-10-31 23:48:05 +00:00
|
|
|
use super::macros::render;
|
|
|
|
|
2023-10-27 21:08:58 +00:00
|
|
|
#[derive(Debug, Serialize)]
|
|
|
|
#[serde(tag = "type")]
|
|
|
|
#[serde(rename = "src_block")]
|
2023-10-29 13:37:27 +00:00
|
|
|
pub(crate) struct RenderSrcBlock {
|
|
|
|
lines: Vec<String>,
|
2023-12-21 17:07:36 +00:00
|
|
|
language: Option<String>,
|
2023-12-21 19:56:58 +00:00
|
|
|
post_blank: organic::types::PostBlank,
|
2023-10-29 13:37:27 +00:00
|
|
|
}
|
2023-10-27 21:08:58 +00:00
|
|
|
|
2023-12-19 20:42:37 +00:00
|
|
|
render!(RenderSrcBlock, ISrcBlock, original, _render_context, {
|
|
|
|
Ok(RenderSrcBlock {
|
|
|
|
lines: original.lines.clone(),
|
2023-12-21 17:07:36 +00:00
|
|
|
language: original.language.clone(),
|
2023-12-21 19:56:58 +00:00
|
|
|
post_blank: original.post_blank,
|
2023-12-19 20:42:37 +00:00
|
|
|
})
|
|
|
|
});
|