Standardize the construction of intermediate BlogPostPage.

This commit is contained in:
Tom Alexander
2023-12-19 17:09:11 -05:00
parent 261fe8a1a2
commit 4bb1f9983a
27 changed files with 405 additions and 248 deletions

View File

@@ -7,11 +7,17 @@ pub(crate) struct ISrcBlock {
pub(crate) lines: Vec<String>,
}
intermediate!(ISrcBlock, SrcBlock, original, _registry, {
let lines = original
.get_value()
.split_inclusive('\n')
.map(|s| s.to_owned())
.collect();
Ok(ISrcBlock { lines })
});
intermediate!(
ISrcBlock,
&'orig organic::types::SrcBlock<'parse>,
original,
_registry,
{
let lines = original
.get_value()
.split_inclusive('\n')
.map(|s| s.to_owned())
.collect();
Ok(ISrcBlock { lines })
}
);