Add comment as a no-op.

This commit is contained in:
Tom Alexander
2023-10-27 16:13:23 -04:00
parent 5891ac7fb7
commit 354d24cf69
7 changed files with 55 additions and 2 deletions

23
src/context/comment.rs Normal file
View File

@@ -0,0 +1,23 @@
use std::path::Path;
use serde::Serialize;
use crate::config::Config;
use crate::error::CustomError;
use crate::intermediate::IComment;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "comment")]
pub(crate) struct RenderComment {}
impl RenderComment {
pub(crate) fn new<D: AsRef<Path>, F: AsRef<Path>>(
config: &Config,
output_directory: D,
output_file: F,
comment: &IComment,
) -> Result<RenderComment, CustomError> {
Ok(RenderComment {})
}
}

View File

@@ -6,6 +6,7 @@ use crate::config::Config;
use crate::error::CustomError;
use crate::intermediate::IElement;
use super::comment::RenderComment;
use super::keyword::RenderKeyword;
use super::paragraph::RenderParagraph;
@@ -14,6 +15,7 @@ use super::paragraph::RenderParagraph;
pub(crate) enum RenderElement {
Paragraph(RenderParagraph),
Keyword(RenderKeyword),
Comment(RenderComment),
}
impl RenderElement {
@@ -36,6 +38,12 @@ impl RenderElement {
output_file,
inner,
)?)),
IElement::Comment(inner) => Ok(RenderElement::Comment(RenderComment::new(
config,
output_directory,
output_file,
inner,
)?)),
}
}
}

View File

@@ -1,4 +1,5 @@
mod blog_post_page;
mod comment;
mod document_element;
mod element;
mod global_settings;