Rename blog_post module to intermediate.

This module is mostly the intermediate representation of the AST, so the renaming is to make that more clear. The three forms are parsed => intermediate => render.

Parsed comes from Organic and is a direct translation of the org-mode text.

Intermediate converts the parsed data into owned values and does any calculations that are needed on the data (for example: assigning numbers to footnotes.)

Render takes intermediate and translates it into the format expected by the dust templates. The processing in this step should be minimal since all the logic should be in the intermediate step.
This commit is contained in:
Tom Alexander
2023-10-27 13:05:34 -04:00
parent 1ac39c2a6f
commit e3b5f7f74f
20 changed files with 64 additions and 64 deletions

View File

@@ -2,9 +2,9 @@ use std::path::Path;
use serde::Serialize;
use crate::blog_post::Heading;
use crate::config::Config;
use crate::error::CustomError;
use crate::intermediate::IHeading;
use super::RenderObject;
@@ -21,7 +21,7 @@ impl RenderHeading {
config: &Config,
output_directory: D,
output_file: F,
heading: &Heading,
heading: &IHeading,
) -> Result<RenderHeading, CustomError> {
let title = heading
.title

View File

@@ -2,9 +2,9 @@ use std::path::Path;
use serde::Serialize;
use crate::blog_post::Object;
use crate::config::Config;
use crate::error::CustomError;
use crate::intermediate::IObject;
use super::plain_text::RenderPlainText;
@@ -19,10 +19,10 @@ impl RenderObject {
config: &Config,
output_directory: D,
output_file: F,
object: &Object,
object: &IObject,
) -> Result<RenderObject, CustomError> {
match object {
Object::PlainText(inner) => Ok(RenderObject::PlainText(RenderPlainText::new(
IObject::PlainText(inner) => Ok(RenderObject::PlainText(RenderPlainText::new(
config,
output_directory,
output_file,

View File

@@ -2,9 +2,9 @@ use std::path::Path;
use serde::Serialize;
use crate::blog_post::PlainText;
use crate::config::Config;
use crate::error::CustomError;
use crate::intermediate::IPlainText;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
@@ -16,7 +16,7 @@ impl RenderPlainText {
config: &Config,
output_directory: D,
output_file: F,
heading: &PlainText,
heading: &IPlainText,
) -> Result<RenderPlainText, CustomError> {
Ok(RenderPlainText {})
}

View File

@@ -2,9 +2,9 @@ use std::path::Path;
use serde::Serialize;
use crate::blog_post::Section;
use crate::config::Config;
use crate::error::CustomError;
use crate::intermediate::ISection;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
@@ -16,7 +16,7 @@ impl RenderSection {
config: &Config,
output_directory: D,
output_file: F,
section: &Section,
section: &ISection,
) -> Result<RenderSection, CustomError> {
Ok(RenderSection {})
}