Initial structure for unhighlighted source blocks.

This commit is contained in:
Tom Alexander 2023-10-29 09:37:27 -04:00
parent d9a3b13780
commit 313313ae53
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 13 additions and 4 deletions

View File

@ -9,7 +9,9 @@ use crate::intermediate::ISrcBlock;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "src_block")]
pub(crate) struct RenderSrcBlock {}
pub(crate) struct RenderSrcBlock {
lines: Vec<String>,
}
impl RenderSrcBlock {
pub(crate) fn new(
@ -18,6 +20,8 @@ impl RenderSrcBlock {
output_file: &Path,
original: &ISrcBlock,
) -> Result<RenderSrcBlock, CustomError> {
Ok(RenderSrcBlock {})
Ok(RenderSrcBlock {
lines: original.lines.clone(),
})
}
}

View File

@ -3,13 +3,18 @@ use crate::error::CustomError;
use super::registry::Registry;
#[derive(Debug)]
pub(crate) struct ISrcBlock {}
pub(crate) struct ISrcBlock {
pub(crate) lines: Vec<String>,
}
impl ISrcBlock {
pub(crate) async fn new<'parse>(
registry: &mut Registry<'parse>,
original: &organic::types::SrcBlock<'parse>,
) -> Result<ISrcBlock, CustomError> {
Ok(ISrcBlock {})
// let contents = original.contents.
Ok(ISrcBlock {
lines: Vec::new(), // TODO
})
}
}