Make converstion to intermediate state async.

We are going to need to do things like call external tools for syntax highlighting so we are going to need async in there eventually.
This commit is contained in:
Tom Alexander
2023-10-27 15:55:19 -04:00
parent 4a6948cde7
commit f9377d7609
9 changed files with 48 additions and 35 deletions

View File

@@ -18,7 +18,7 @@ pub(crate) struct BlogPostPage {
}
impl BlogPostPage {
pub(crate) fn new<'parse, P: Into<PathBuf>>(
pub(crate) async fn new<'parse, P: Into<PathBuf>>(
path: P,
registry: &mut Registry<'parse>,
document: &organic::types::Document<'parse>,
@@ -26,10 +26,14 @@ impl BlogPostPage {
let path = path.into();
let mut children = Vec::new();
if let Some(section) = document.zeroth_section.as_ref() {
children.push(IDocumentElement::Section(ISection::new(registry, section)?));
children.push(IDocumentElement::Section(
ISection::new(registry, section).await?,
));
}
for heading in document.children.iter() {
children.push(IDocumentElement::Heading(IHeading::new(registry, heading)?));
children.push(IDocumentElement::Heading(
IHeading::new(registry, heading).await?,
));
}
Ok(BlogPostPage {