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:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {})
|
||||
}
|
||||
|
||||
@@ -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 {})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user