natter/src/context/src_block.rs

25 lines
602 B
Rust
Raw Normal View History

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