Use macros for the intermediate to render step.
This is largely to make changing the type signature of these functions easier by significantly reducing the amount of places that duplicates the signature.
This commit is contained in:
parent
5e476e189a
commit
ae933b491e
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IAngleLink;
|
use crate::intermediate::IAngleLink;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "angle_link")]
|
#[serde(rename = "angle_link")]
|
||||||
pub(crate) struct RenderAngleLink {}
|
pub(crate) struct RenderAngleLink {}
|
||||||
|
|
||||||
impl RenderAngleLink {
|
rnoop!(RenderAngleLink, IAngleLink);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IAngleLink,
|
|
||||||
) -> Result<RenderAngleLink, CustomError> {
|
|
||||||
Ok(RenderAngleLink {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IBabelCall;
|
use crate::intermediate::IBabelCall;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "babel_call")]
|
#[serde(rename = "babel_call")]
|
||||||
pub(crate) struct RenderBabelCall {}
|
pub(crate) struct RenderBabelCall {}
|
||||||
|
|
||||||
impl RenderBabelCall {
|
rnoop!(RenderBabelCall, IBabelCall);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IBabelCall,
|
|
||||||
) -> Result<RenderBabelCall, CustomError> {
|
|
||||||
Ok(RenderBabelCall {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -21,6 +21,7 @@ pub(crate) struct RenderBlogPostPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl RenderBlogPostPage {
|
impl RenderBlogPostPage {
|
||||||
|
// TODO: Maybe these settings should be moved into a common struct so this can have the same type signature as the others.
|
||||||
pub(crate) fn new(
|
pub(crate) fn new(
|
||||||
global_settings: GlobalSettings,
|
global_settings: GlobalSettings,
|
||||||
title: Option<String>,
|
title: Option<String>,
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IBold;
|
use crate::intermediate::IBold;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "bold")]
|
#[serde(rename = "bold")]
|
||||||
pub(crate) struct RenderBold {}
|
pub(crate) struct RenderBold {}
|
||||||
|
|
||||||
impl RenderBold {
|
rnoop!(RenderBold, IBold);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IBold,
|
|
||||||
) -> Result<RenderBold, CustomError> {
|
|
||||||
Ok(RenderBold {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ICenterBlock;
|
use crate::intermediate::ICenterBlock;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "center_block")]
|
#[serde(rename = "center_block")]
|
||||||
pub(crate) struct RenderCenterBlock {}
|
pub(crate) struct RenderCenterBlock {}
|
||||||
|
|
||||||
impl RenderCenterBlock {
|
rnoop!(RenderCenterBlock, ICenterBlock);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &ICenterBlock,
|
|
||||||
) -> Result<RenderCenterBlock, CustomError> {
|
|
||||||
Ok(RenderCenterBlock {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ICitation;
|
use crate::intermediate::ICitation;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "citation")]
|
#[serde(rename = "citation")]
|
||||||
pub(crate) struct RenderCitation {}
|
pub(crate) struct RenderCitation {}
|
||||||
|
|
||||||
impl RenderCitation {
|
rnoop!(RenderCitation, ICitation);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &ICitation,
|
|
||||||
) -> Result<RenderCitation, CustomError> {
|
|
||||||
Ok(RenderCitation {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ICitationReference;
|
use crate::intermediate::ICitationReference;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "citation_reference")]
|
#[serde(rename = "citation_reference")]
|
||||||
pub(crate) struct RenderCitationReference {}
|
pub(crate) struct RenderCitationReference {}
|
||||||
|
|
||||||
impl RenderCitationReference {
|
rnoop!(RenderCitationReference, ICitationReference);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &ICitationReference,
|
|
||||||
) -> Result<RenderCitationReference, CustomError> {
|
|
||||||
Ok(RenderCitationReference {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IClock;
|
use crate::intermediate::IClock;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "clock")]
|
#[serde(rename = "clock")]
|
||||||
pub(crate) struct RenderClock {}
|
pub(crate) struct RenderClock {}
|
||||||
|
|
||||||
impl RenderClock {
|
rnoop!(RenderClock, IClock);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IClock,
|
|
||||||
) -> Result<RenderClock, CustomError> {
|
|
||||||
Ok(RenderClock {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ICode;
|
use crate::intermediate::ICode;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "code")]
|
#[serde(rename = "code")]
|
||||||
pub(crate) struct RenderCode {}
|
pub(crate) struct RenderCode {}
|
||||||
|
|
||||||
impl RenderCode {
|
rnoop!(RenderCode, ICode);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &ICode,
|
|
||||||
) -> Result<RenderCode, CustomError> {
|
|
||||||
Ok(RenderCode {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ICommentBlock;
|
use crate::intermediate::ICommentBlock;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "comment_block")]
|
#[serde(rename = "comment_block")]
|
||||||
pub(crate) struct RenderCommentBlock {}
|
pub(crate) struct RenderCommentBlock {}
|
||||||
|
|
||||||
impl RenderCommentBlock {
|
rnoop!(RenderCommentBlock, ICommentBlock);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &ICommentBlock,
|
|
||||||
) -> Result<RenderCommentBlock, CustomError> {
|
|
||||||
Ok(RenderCommentBlock {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IDiarySexp;
|
use crate::intermediate::IDiarySexp;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "diary_sexp")]
|
#[serde(rename = "diary_sexp")]
|
||||||
pub(crate) struct RenderDiarySexp {}
|
pub(crate) struct RenderDiarySexp {}
|
||||||
|
|
||||||
impl RenderDiarySexp {
|
rnoop!(RenderDiarySexp, IDiarySexp);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IDiarySexp,
|
|
||||||
) -> Result<RenderDiarySexp, CustomError> {
|
|
||||||
Ok(RenderDiarySexp {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,6 +6,7 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IDocumentElement;
|
use crate::intermediate::IDocumentElement;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
use super::RenderHeading;
|
use super::RenderHeading;
|
||||||
use super::RenderSection;
|
use super::RenderSection;
|
||||||
|
|
||||||
@ -16,13 +17,14 @@ pub(crate) enum RenderDocumentElement {
|
|||||||
Section(RenderSection),
|
Section(RenderSection),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderDocumentElement {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderDocumentElement,
|
||||||
config: &Config,
|
IDocumentElement,
|
||||||
output_directory: &Path,
|
original,
|
||||||
output_file: &Path,
|
config,
|
||||||
original: &IDocumentElement,
|
output_directory,
|
||||||
) -> Result<RenderDocumentElement, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
match original {
|
match original {
|
||||||
IDocumentElement::Heading(inner) => Ok(RenderDocumentElement::Heading(
|
IDocumentElement::Heading(inner) => Ok(RenderDocumentElement::Heading(
|
||||||
RenderHeading::new(config, output_directory, output_file, inner)?,
|
RenderHeading::new(config, output_directory, output_file, inner)?,
|
||||||
@ -32,4 +34,4 @@ impl RenderDocumentElement {
|
|||||||
)),
|
)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IDrawer;
|
use crate::intermediate::IDrawer;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "drawer")]
|
#[serde(rename = "drawer")]
|
||||||
pub(crate) struct RenderDrawer {}
|
pub(crate) struct RenderDrawer {}
|
||||||
|
|
||||||
impl RenderDrawer {
|
rnoop!(RenderDrawer, IDrawer);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IDrawer,
|
|
||||||
) -> Result<RenderDrawer, CustomError> {
|
|
||||||
Ok(RenderDrawer {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IDynamicBlock;
|
use crate::intermediate::IDynamicBlock;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "dynamic_block")]
|
#[serde(rename = "dynamic_block")]
|
||||||
pub(crate) struct RenderDynamicBlock {}
|
pub(crate) struct RenderDynamicBlock {}
|
||||||
|
|
||||||
impl RenderDynamicBlock {
|
rnoop!(RenderDynamicBlock, IDynamicBlock);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IDynamicBlock,
|
|
||||||
) -> Result<RenderDynamicBlock, CustomError> {
|
|
||||||
Ok(RenderDynamicBlock {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -21,6 +21,7 @@ use super::footnote_definition::RenderFootnoteDefinition;
|
|||||||
use super::horizontal_rule::RenderHorizontalRule;
|
use super::horizontal_rule::RenderHorizontalRule;
|
||||||
use super::keyword::RenderKeyword;
|
use super::keyword::RenderKeyword;
|
||||||
use super::latex_environment::RenderLatexEnvironment;
|
use super::latex_environment::RenderLatexEnvironment;
|
||||||
|
use super::macros::render;
|
||||||
use super::paragraph::RenderParagraph;
|
use super::paragraph::RenderParagraph;
|
||||||
use super::plain_list::RenderPlainList;
|
use super::plain_list::RenderPlainList;
|
||||||
use super::planning::RenderPlanning;
|
use super::planning::RenderPlanning;
|
||||||
@ -60,14 +61,15 @@ pub(crate) enum RenderElement {
|
|||||||
LatexEnvironment(RenderLatexEnvironment),
|
LatexEnvironment(RenderLatexEnvironment),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderElement {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderElement,
|
||||||
config: &Config,
|
IElement,
|
||||||
output_directory: &Path,
|
original,
|
||||||
output_file: &Path,
|
config,
|
||||||
element: &IElement,
|
output_directory,
|
||||||
) -> Result<RenderElement, CustomError> {
|
output_file,
|
||||||
match element {
|
{
|
||||||
|
match original {
|
||||||
IElement::Paragraph(inner) => Ok(RenderElement::Paragraph(RenderParagraph::new(
|
IElement::Paragraph(inner) => Ok(RenderElement::Paragraph(RenderParagraph::new(
|
||||||
config,
|
config,
|
||||||
output_directory,
|
output_directory,
|
||||||
@ -187,4 +189,4 @@ impl RenderElement {
|
|||||||
)),
|
)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,6 +6,8 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IEntity;
|
use crate::intermediate::IEntity;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "entity")]
|
#[serde(rename = "entity")]
|
||||||
@ -13,15 +15,16 @@ pub(crate) struct RenderEntity {
|
|||||||
html: String,
|
html: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderEntity {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderEntity,
|
||||||
_config: &Config,
|
IEntity,
|
||||||
_output_directory: &Path,
|
original,
|
||||||
_output_file: &Path,
|
config,
|
||||||
entity: &IEntity,
|
output_directory,
|
||||||
) -> Result<RenderEntity, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
Ok(RenderEntity {
|
Ok(RenderEntity {
|
||||||
html: entity.html.clone(),
|
html: original.html.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IExampleBlock;
|
use crate::intermediate::IExampleBlock;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "example_block")]
|
#[serde(rename = "example_block")]
|
||||||
pub(crate) struct RenderExampleBlock {}
|
pub(crate) struct RenderExampleBlock {}
|
||||||
|
|
||||||
impl RenderExampleBlock {
|
rnoop!(RenderExampleBlock, IExampleBlock);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IExampleBlock,
|
|
||||||
) -> Result<RenderExampleBlock, CustomError> {
|
|
||||||
Ok(RenderExampleBlock {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IExportBlock;
|
use crate::intermediate::IExportBlock;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "export_block")]
|
#[serde(rename = "export_block")]
|
||||||
pub(crate) struct RenderExportBlock {}
|
pub(crate) struct RenderExportBlock {}
|
||||||
|
|
||||||
impl RenderExportBlock {
|
rnoop!(RenderExportBlock, IExportBlock);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IExportBlock,
|
|
||||||
) -> Result<RenderExportBlock, CustomError> {
|
|
||||||
Ok(RenderExportBlock {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IExportSnippet;
|
use crate::intermediate::IExportSnippet;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "export_snippet")]
|
#[serde(rename = "export_snippet")]
|
||||||
pub(crate) struct RenderExportSnippet {}
|
pub(crate) struct RenderExportSnippet {}
|
||||||
|
|
||||||
impl RenderExportSnippet {
|
rnoop!(RenderExportSnippet, IExportSnippet);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IExportSnippet,
|
|
||||||
) -> Result<RenderExportSnippet, CustomError> {
|
|
||||||
Ok(RenderExportSnippet {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IFixedWidthArea;
|
use crate::intermediate::IFixedWidthArea;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "fixed_width_area")]
|
#[serde(rename = "fixed_width_area")]
|
||||||
pub(crate) struct RenderFixedWidthArea {}
|
pub(crate) struct RenderFixedWidthArea {}
|
||||||
|
|
||||||
impl RenderFixedWidthArea {
|
rnoop!(RenderFixedWidthArea, IFixedWidthArea);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IFixedWidthArea,
|
|
||||||
) -> Result<RenderFixedWidthArea, CustomError> {
|
|
||||||
Ok(RenderFixedWidthArea {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -9,22 +9,15 @@ use crate::intermediate::IRealFootnoteDefinition;
|
|||||||
|
|
||||||
use super::ast_node::IntoRenderAstNode;
|
use super::ast_node::IntoRenderAstNode;
|
||||||
use super::ast_node::RenderAstNode;
|
use super::ast_node::RenderAstNode;
|
||||||
|
use super::macros::render;
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "footnote_definition")]
|
#[serde(rename = "footnote_definition")]
|
||||||
pub(crate) struct RenderFootnoteDefinition {}
|
pub(crate) struct RenderFootnoteDefinition {}
|
||||||
|
|
||||||
impl RenderFootnoteDefinition {
|
rnoop!(RenderFootnoteDefinition, IFootnoteDefinition);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IFootnoteDefinition,
|
|
||||||
) -> Result<RenderFootnoteDefinition, CustomError> {
|
|
||||||
Ok(RenderFootnoteDefinition {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
@ -36,13 +29,14 @@ pub(crate) struct RenderRealFootnoteDefinition {
|
|||||||
contents: Vec<RenderAstNode>,
|
contents: Vec<RenderAstNode>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderRealFootnoteDefinition {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderRealFootnoteDefinition,
|
||||||
config: &Config,
|
IRealFootnoteDefinition,
|
||||||
output_directory: &Path,
|
original,
|
||||||
output_file: &Path,
|
config,
|
||||||
original: &IRealFootnoteDefinition,
|
output_directory,
|
||||||
) -> Result<RenderRealFootnoteDefinition, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
let contents = {
|
let contents = {
|
||||||
let mut ret = Vec::new();
|
let mut ret = Vec::new();
|
||||||
for obj in original.contents.iter() {
|
for obj in original.contents.iter() {
|
||||||
@ -58,4 +52,4 @@ impl RenderRealFootnoteDefinition {
|
|||||||
contents,
|
contents,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,6 +6,8 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IFootnoteReference;
|
use crate::intermediate::IFootnoteReference;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "footnote_reference")]
|
#[serde(rename = "footnote_reference")]
|
||||||
@ -15,17 +17,18 @@ pub(crate) struct RenderFootnoteReference {
|
|||||||
label: String,
|
label: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderFootnoteReference {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderFootnoteReference,
|
||||||
_config: &Config,
|
IFootnoteReference,
|
||||||
_output_directory: &Path,
|
original,
|
||||||
_output_file: &Path,
|
config,
|
||||||
original: &IFootnoteReference,
|
output_directory,
|
||||||
) -> Result<RenderFootnoteReference, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
Ok(RenderFootnoteReference {
|
Ok(RenderFootnoteReference {
|
||||||
reference_id: original.get_reference_id(),
|
reference_id: original.get_reference_id(),
|
||||||
definition_link: format!("#{}", original.get_definition_id()),
|
definition_link: format!("#{}", original.get_definition_id()),
|
||||||
label: original.get_display_label(),
|
label: original.get_display_label(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,6 +6,7 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IHeading;
|
use crate::intermediate::IHeading;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
use super::RenderDocumentElement;
|
use super::RenderDocumentElement;
|
||||||
use super::RenderObject;
|
use super::RenderObject;
|
||||||
|
|
||||||
@ -18,16 +19,17 @@ pub(crate) struct RenderHeading {
|
|||||||
children: Vec<RenderDocumentElement>,
|
children: Vec<RenderDocumentElement>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderHeading {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderHeading,
|
||||||
config: &Config,
|
IHeading,
|
||||||
output_directory: &Path,
|
original,
|
||||||
output_file: &Path,
|
config,
|
||||||
heading: &IHeading,
|
output_directory,
|
||||||
) -> Result<RenderHeading, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
let title = {
|
let title = {
|
||||||
let mut ret = Vec::new();
|
let mut ret = Vec::new();
|
||||||
for obj in heading.title.iter() {
|
for obj in original.title.iter() {
|
||||||
ret.push(RenderObject::new(
|
ret.push(RenderObject::new(
|
||||||
config,
|
config,
|
||||||
output_directory,
|
output_directory,
|
||||||
@ -40,7 +42,7 @@ impl RenderHeading {
|
|||||||
|
|
||||||
let children = {
|
let children = {
|
||||||
let mut ret = Vec::new();
|
let mut ret = Vec::new();
|
||||||
for obj in heading.children.iter() {
|
for obj in original.children.iter() {
|
||||||
ret.push(RenderDocumentElement::new(
|
ret.push(RenderDocumentElement::new(
|
||||||
config,
|
config,
|
||||||
output_directory,
|
output_directory,
|
||||||
@ -52,9 +54,9 @@ impl RenderHeading {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Ok(RenderHeading {
|
Ok(RenderHeading {
|
||||||
level: heading.level + 1, // Adding 1 because the page title is going to be h1.
|
level: original.level + 1, // Adding 1 because the page title is going to be h1.
|
||||||
title,
|
title,
|
||||||
children,
|
children,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IHorizontalRule;
|
use crate::intermediate::IHorizontalRule;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "horizontal_rule")]
|
#[serde(rename = "horizontal_rule")]
|
||||||
pub(crate) struct RenderHorizontalRule {}
|
pub(crate) struct RenderHorizontalRule {}
|
||||||
|
|
||||||
impl RenderHorizontalRule {
|
rnoop!(RenderHorizontalRule, IHorizontalRule);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IHorizontalRule,
|
|
||||||
) -> Result<RenderHorizontalRule, CustomError> {
|
|
||||||
Ok(RenderHorizontalRule {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IInlineBabelCall;
|
use crate::intermediate::IInlineBabelCall;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "inline_babel_call")]
|
#[serde(rename = "inline_babel_call")]
|
||||||
pub(crate) struct RenderInlineBabelCall {}
|
pub(crate) struct RenderInlineBabelCall {}
|
||||||
|
|
||||||
impl RenderInlineBabelCall {
|
rnoop!(RenderInlineBabelCall, IInlineBabelCall);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IInlineBabelCall,
|
|
||||||
) -> Result<RenderInlineBabelCall, CustomError> {
|
|
||||||
Ok(RenderInlineBabelCall {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,6 +6,8 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IInlineSourceBlock;
|
use crate::intermediate::IInlineSourceBlock;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "inline_source_block")]
|
#[serde(rename = "inline_source_block")]
|
||||||
@ -13,15 +15,16 @@ pub(crate) struct RenderInlineSourceBlock {
|
|||||||
value: String,
|
value: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderInlineSourceBlock {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderInlineSourceBlock,
|
||||||
_config: &Config,
|
IInlineSourceBlock,
|
||||||
_output_directory: &Path,
|
original,
|
||||||
_output_file: &Path,
|
config,
|
||||||
original: &IInlineSourceBlock,
|
output_directory,
|
||||||
) -> Result<RenderInlineSourceBlock, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
Ok(RenderInlineSourceBlock {
|
Ok(RenderInlineSourceBlock {
|
||||||
value: original.value.clone(),
|
value: original.value.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IItalic;
|
use crate::intermediate::IItalic;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "italic")]
|
#[serde(rename = "italic")]
|
||||||
pub(crate) struct RenderItalic {}
|
pub(crate) struct RenderItalic {}
|
||||||
|
|
||||||
impl RenderItalic {
|
rnoop!(RenderItalic, IItalic);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IItalic,
|
|
||||||
) -> Result<RenderItalic, CustomError> {
|
|
||||||
Ok(RenderItalic {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IKeyword;
|
use crate::intermediate::IKeyword;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "keyword")]
|
#[serde(rename = "keyword")]
|
||||||
pub(crate) struct RenderKeyword {}
|
pub(crate) struct RenderKeyword {}
|
||||||
|
|
||||||
impl RenderKeyword {
|
rnoop!(RenderKeyword, IKeyword);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_keyword: &IKeyword,
|
|
||||||
) -> Result<RenderKeyword, CustomError> {
|
|
||||||
Ok(RenderKeyword {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ILatexEnvironment;
|
use crate::intermediate::ILatexEnvironment;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "latex_environment")]
|
#[serde(rename = "latex_environment")]
|
||||||
pub(crate) struct RenderLatexEnvironment {}
|
pub(crate) struct RenderLatexEnvironment {}
|
||||||
|
|
||||||
impl RenderLatexEnvironment {
|
rnoop!(RenderLatexEnvironment, ILatexEnvironment);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &ILatexEnvironment,
|
|
||||||
) -> Result<RenderLatexEnvironment, CustomError> {
|
|
||||||
Ok(RenderLatexEnvironment {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ILineBreak;
|
use crate::intermediate::ILineBreak;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "line_break")]
|
#[serde(rename = "line_break")]
|
||||||
pub(crate) struct RenderLineBreak {}
|
pub(crate) struct RenderLineBreak {}
|
||||||
|
|
||||||
impl RenderLineBreak {
|
rnoop!(RenderLineBreak, ILineBreak);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &ILineBreak,
|
|
||||||
) -> Result<RenderLineBreak, CustomError> {
|
|
||||||
Ok(RenderLineBreak {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -19,6 +19,7 @@ use super::inline_source_block::RenderInlineSourceBlock;
|
|||||||
use super::italic::RenderItalic;
|
use super::italic::RenderItalic;
|
||||||
use super::latex_fragment::RenderLatexFragment;
|
use super::latex_fragment::RenderLatexFragment;
|
||||||
use super::line_break::RenderLineBreak;
|
use super::line_break::RenderLineBreak;
|
||||||
|
use super::macros::render;
|
||||||
use super::org_macro::RenderOrgMacro;
|
use super::org_macro::RenderOrgMacro;
|
||||||
use super::plain_link::RenderPlainLink;
|
use super::plain_link::RenderPlainLink;
|
||||||
use super::plain_text::RenderPlainText;
|
use super::plain_text::RenderPlainText;
|
||||||
@ -66,14 +67,15 @@ pub(crate) enum RenderObject {
|
|||||||
Timestamp(RenderTimestamp),
|
Timestamp(RenderTimestamp),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderObject {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderObject,
|
||||||
config: &Config,
|
IObject,
|
||||||
output_directory: &Path,
|
original,
|
||||||
output_file: &Path,
|
config,
|
||||||
object: &IObject,
|
output_directory,
|
||||||
) -> Result<RenderObject, CustomError> {
|
output_file,
|
||||||
match object {
|
{
|
||||||
|
match original {
|
||||||
IObject::Bold(inner) => Ok(RenderObject::Bold(RenderBold::new(
|
IObject::Bold(inner) => Ok(RenderObject::Bold(RenderBold::new(
|
||||||
config,
|
config,
|
||||||
output_directory,
|
output_directory,
|
||||||
@ -214,4 +216,4 @@ impl RenderObject {
|
|||||||
)?)),
|
)?)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IOrgMacro;
|
use crate::intermediate::IOrgMacro;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "org_macro")]
|
#[serde(rename = "org_macro")]
|
||||||
pub(crate) struct RenderOrgMacro {}
|
pub(crate) struct RenderOrgMacro {}
|
||||||
|
|
||||||
impl RenderOrgMacro {
|
rnoop!(RenderOrgMacro, IOrgMacro);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IOrgMacro,
|
|
||||||
) -> Result<RenderOrgMacro, CustomError> {
|
|
||||||
Ok(RenderOrgMacro {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,6 +6,7 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IParagraph;
|
use crate::intermediate::IParagraph;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
use super::RenderObject;
|
use super::RenderObject;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
@ -15,16 +16,17 @@ pub(crate) struct RenderParagraph {
|
|||||||
children: Vec<RenderObject>,
|
children: Vec<RenderObject>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderParagraph {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderParagraph,
|
||||||
config: &Config,
|
IParagraph,
|
||||||
output_directory: &Path,
|
original,
|
||||||
output_file: &Path,
|
config,
|
||||||
paragraph: &IParagraph,
|
output_directory,
|
||||||
) -> Result<RenderParagraph, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
let children = {
|
let children = {
|
||||||
let mut ret = Vec::new();
|
let mut ret = Vec::new();
|
||||||
for obj in paragraph.children.iter() {
|
for obj in original.children.iter() {
|
||||||
ret.push(RenderObject::new(
|
ret.push(RenderObject::new(
|
||||||
config,
|
config,
|
||||||
output_directory,
|
output_directory,
|
||||||
@ -37,4 +39,4 @@ impl RenderParagraph {
|
|||||||
|
|
||||||
Ok(RenderParagraph { children })
|
Ok(RenderParagraph { children })
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IPlainLink;
|
use crate::intermediate::IPlainLink;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "plain_link")]
|
#[serde(rename = "plain_link")]
|
||||||
pub(crate) struct RenderPlainLink {}
|
pub(crate) struct RenderPlainLink {}
|
||||||
|
|
||||||
impl RenderPlainLink {
|
rnoop!(RenderPlainLink, IPlainLink);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IPlainLink,
|
|
||||||
) -> Result<RenderPlainLink, CustomError> {
|
|
||||||
Ok(RenderPlainLink {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,6 +6,7 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IPlainList;
|
use crate::intermediate::IPlainList;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
use super::plain_list_item::RenderPlainListItem;
|
use super::plain_list_item::RenderPlainListItem;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
@ -16,13 +17,14 @@ pub(crate) struct RenderPlainList {
|
|||||||
children: Vec<RenderPlainListItem>,
|
children: Vec<RenderPlainListItem>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderPlainList {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderPlainList,
|
||||||
config: &Config,
|
IPlainList,
|
||||||
output_directory: &Path,
|
original,
|
||||||
output_file: &Path,
|
config,
|
||||||
original: &IPlainList,
|
output_directory,
|
||||||
) -> Result<RenderPlainList, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
let list_type = match original.list_type {
|
let list_type = match original.list_type {
|
||||||
organic::types::PlainListType::Unordered => "unordered".to_owned(),
|
organic::types::PlainListType::Unordered => "unordered".to_owned(),
|
||||||
organic::types::PlainListType::Ordered => "ordered".to_owned(),
|
organic::types::PlainListType::Ordered => "ordered".to_owned(),
|
||||||
@ -46,4 +48,4 @@ impl RenderPlainList {
|
|||||||
children,
|
children,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,6 +6,7 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IPlainListItem;
|
use crate::intermediate::IPlainListItem;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
use super::RenderElement;
|
use super::RenderElement;
|
||||||
use super::RenderObject;
|
use super::RenderObject;
|
||||||
|
|
||||||
@ -17,13 +18,14 @@ pub(crate) struct RenderPlainListItem {
|
|||||||
children: Vec<RenderElement>,
|
children: Vec<RenderElement>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderPlainListItem {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderPlainListItem,
|
||||||
config: &Config,
|
IPlainListItem,
|
||||||
output_directory: &Path,
|
original,
|
||||||
output_file: &Path,
|
config,
|
||||||
original: &IPlainListItem,
|
output_directory,
|
||||||
) -> Result<RenderPlainListItem, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
let tag = {
|
let tag = {
|
||||||
let mut ret = Vec::new();
|
let mut ret = Vec::new();
|
||||||
for obj in original.tag.iter() {
|
for obj in original.tag.iter() {
|
||||||
@ -51,4 +53,4 @@ impl RenderPlainListItem {
|
|||||||
};
|
};
|
||||||
Ok(RenderPlainListItem { tag, children })
|
Ok(RenderPlainListItem { tag, children })
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,6 +6,8 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IPlainText;
|
use crate::intermediate::IPlainText;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "plain_text")]
|
#[serde(rename = "plain_text")]
|
||||||
@ -13,15 +15,16 @@ pub(crate) struct RenderPlainText {
|
|||||||
source: String,
|
source: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderPlainText {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderPlainText,
|
||||||
_config: &Config,
|
IPlainText,
|
||||||
_output_directory: &Path,
|
original,
|
||||||
_output_file: &Path,
|
config,
|
||||||
original: &IPlainText,
|
output_directory,
|
||||||
) -> Result<RenderPlainText, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
Ok(RenderPlainText {
|
Ok(RenderPlainText {
|
||||||
source: original.source.clone(),
|
source: original.source.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IPlanning;
|
use crate::intermediate::IPlanning;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "planning")]
|
#[serde(rename = "planning")]
|
||||||
pub(crate) struct RenderPlanning {}
|
pub(crate) struct RenderPlanning {}
|
||||||
|
|
||||||
impl RenderPlanning {
|
rnoop!(RenderPlanning, IPlanning);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IPlanning,
|
|
||||||
) -> Result<RenderPlanning, CustomError> {
|
|
||||||
Ok(RenderPlanning {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IPropertyDrawer;
|
use crate::intermediate::IPropertyDrawer;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "property_drawer")]
|
#[serde(rename = "property_drawer")]
|
||||||
pub(crate) struct RenderPropertyDrawer {}
|
pub(crate) struct RenderPropertyDrawer {}
|
||||||
|
|
||||||
impl RenderPropertyDrawer {
|
rnoop!(RenderPropertyDrawer, IPropertyDrawer);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IPropertyDrawer,
|
|
||||||
) -> Result<RenderPropertyDrawer, CustomError> {
|
|
||||||
Ok(RenderPropertyDrawer {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,6 +6,7 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IQuoteBlock;
|
use crate::intermediate::IQuoteBlock;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
use super::RenderElement;
|
use super::RenderElement;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
@ -15,13 +16,14 @@ pub(crate) struct RenderQuoteBlock {
|
|||||||
children: Vec<RenderElement>,
|
children: Vec<RenderElement>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderQuoteBlock {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderQuoteBlock,
|
||||||
config: &Config,
|
IQuoteBlock,
|
||||||
output_directory: &Path,
|
original,
|
||||||
output_file: &Path,
|
config,
|
||||||
original: &IQuoteBlock,
|
output_directory,
|
||||||
) -> Result<RenderQuoteBlock, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
let children = {
|
let children = {
|
||||||
let mut ret = Vec::new();
|
let mut ret = Vec::new();
|
||||||
for obj in original.children.iter() {
|
for obj in original.children.iter() {
|
||||||
@ -37,4 +39,4 @@ impl RenderQuoteBlock {
|
|||||||
|
|
||||||
Ok(RenderQuoteBlock { children })
|
Ok(RenderQuoteBlock { children })
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IRadioLink;
|
use crate::intermediate::IRadioLink;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "radio_link")]
|
#[serde(rename = "radio_link")]
|
||||||
pub(crate) struct RenderRadioLink {}
|
pub(crate) struct RenderRadioLink {}
|
||||||
|
|
||||||
impl RenderRadioLink {
|
rnoop!(RenderRadioLink, IRadioLink);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IRadioLink,
|
|
||||||
) -> Result<RenderRadioLink, CustomError> {
|
|
||||||
Ok(RenderRadioLink {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IRadioTarget;
|
use crate::intermediate::IRadioTarget;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "radio_target")]
|
#[serde(rename = "radio_target")]
|
||||||
pub(crate) struct RenderRadioTarget {}
|
pub(crate) struct RenderRadioTarget {}
|
||||||
|
|
||||||
impl RenderRadioTarget {
|
rnoop!(RenderRadioTarget, IRadioTarget);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IRadioTarget,
|
|
||||||
) -> Result<RenderRadioTarget, CustomError> {
|
|
||||||
Ok(RenderRadioTarget {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,6 +6,7 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IRegularLink;
|
use crate::intermediate::IRegularLink;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
use super::RenderObject;
|
use super::RenderObject;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
@ -16,16 +17,17 @@ pub(crate) struct RenderRegularLink {
|
|||||||
children: Vec<RenderObject>,
|
children: Vec<RenderObject>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderRegularLink {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderRegularLink,
|
||||||
config: &Config,
|
IRegularLink,
|
||||||
output_directory: &Path,
|
original,
|
||||||
output_file: &Path,
|
config,
|
||||||
regular_link: &IRegularLink,
|
output_directory,
|
||||||
) -> Result<RenderRegularLink, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
let children = {
|
let children = {
|
||||||
let mut ret = Vec::new();
|
let mut ret = Vec::new();
|
||||||
for obj in regular_link.children.iter() {
|
for obj in original.children.iter() {
|
||||||
ret.push(RenderObject::new(
|
ret.push(RenderObject::new(
|
||||||
config,
|
config,
|
||||||
output_directory,
|
output_directory,
|
||||||
@ -37,8 +39,8 @@ impl RenderRegularLink {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Ok(RenderRegularLink {
|
Ok(RenderRegularLink {
|
||||||
raw_link: regular_link.raw_link.clone(),
|
raw_link: original.raw_link.clone(),
|
||||||
children,
|
children,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,6 +6,7 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ISection;
|
use crate::intermediate::ISection;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
use super::RenderElement;
|
use super::RenderElement;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
@ -15,16 +16,17 @@ pub(crate) struct RenderSection {
|
|||||||
children: Vec<RenderElement>,
|
children: Vec<RenderElement>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderSection {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderSection,
|
||||||
config: &Config,
|
ISection,
|
||||||
output_directory: &Path,
|
original,
|
||||||
output_file: &Path,
|
config,
|
||||||
section: &ISection,
|
output_directory,
|
||||||
) -> Result<RenderSection, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
let children = {
|
let children = {
|
||||||
let mut ret = Vec::new();
|
let mut ret = Vec::new();
|
||||||
for obj in section.children.iter() {
|
for obj in original.children.iter() {
|
||||||
ret.push(RenderElement::new(
|
ret.push(RenderElement::new(
|
||||||
config,
|
config,
|
||||||
output_directory,
|
output_directory,
|
||||||
@ -37,4 +39,4 @@ impl RenderSection {
|
|||||||
|
|
||||||
Ok(RenderSection { children })
|
Ok(RenderSection { children })
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ISpecialBlock;
|
use crate::intermediate::ISpecialBlock;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "special_block")]
|
#[serde(rename = "special_block")]
|
||||||
pub(crate) struct RenderSpecialBlock {}
|
pub(crate) struct RenderSpecialBlock {}
|
||||||
|
|
||||||
impl RenderSpecialBlock {
|
rnoop!(RenderSpecialBlock, ISpecialBlock);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &ISpecialBlock,
|
|
||||||
) -> Result<RenderSpecialBlock, CustomError> {
|
|
||||||
Ok(RenderSpecialBlock {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,6 +6,8 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ISrcBlock;
|
use crate::intermediate::ISrcBlock;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "src_block")]
|
#[serde(rename = "src_block")]
|
||||||
@ -13,15 +15,16 @@ pub(crate) struct RenderSrcBlock {
|
|||||||
lines: Vec<String>,
|
lines: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderSrcBlock {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderSrcBlock,
|
||||||
_config: &Config,
|
ISrcBlock,
|
||||||
_output_directory: &Path,
|
original,
|
||||||
_output_file: &Path,
|
config,
|
||||||
original: &ISrcBlock,
|
output_directory,
|
||||||
) -> Result<RenderSrcBlock, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
Ok(RenderSrcBlock {
|
Ok(RenderSrcBlock {
|
||||||
lines: original.lines.clone(),
|
lines: original.lines.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IStatisticsCookie;
|
use crate::intermediate::IStatisticsCookie;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "statistics_cookie")]
|
#[serde(rename = "statistics_cookie")]
|
||||||
pub(crate) struct RenderStatisticsCookie {}
|
pub(crate) struct RenderStatisticsCookie {}
|
||||||
|
|
||||||
impl RenderStatisticsCookie {
|
rnoop!(RenderStatisticsCookie, IStatisticsCookie);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IStatisticsCookie,
|
|
||||||
) -> Result<RenderStatisticsCookie, CustomError> {
|
|
||||||
Ok(RenderStatisticsCookie {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IStrikeThrough;
|
use crate::intermediate::IStrikeThrough;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "strike_through")]
|
#[serde(rename = "strike_through")]
|
||||||
pub(crate) struct RenderStrikeThrough {}
|
pub(crate) struct RenderStrikeThrough {}
|
||||||
|
|
||||||
impl RenderStrikeThrough {
|
rnoop!(RenderStrikeThrough, IStrikeThrough);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IStrikeThrough,
|
|
||||||
) -> Result<RenderStrikeThrough, CustomError> {
|
|
||||||
Ok(RenderStrikeThrough {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ISubscript;
|
use crate::intermediate::ISubscript;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "subscript")]
|
#[serde(rename = "subscript")]
|
||||||
pub(crate) struct RenderSubscript {}
|
pub(crate) struct RenderSubscript {}
|
||||||
|
|
||||||
impl RenderSubscript {
|
rnoop!(RenderSubscript, ISubscript);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &ISubscript,
|
|
||||||
) -> Result<RenderSubscript, CustomError> {
|
|
||||||
Ok(RenderSubscript {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ISuperscript;
|
use crate::intermediate::ISuperscript;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "superscript")]
|
#[serde(rename = "superscript")]
|
||||||
pub(crate) struct RenderSuperscript {}
|
pub(crate) struct RenderSuperscript {}
|
||||||
|
|
||||||
impl RenderSuperscript {
|
rnoop!(RenderSuperscript, ISuperscript);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &ISuperscript,
|
|
||||||
) -> Result<RenderSuperscript, CustomError> {
|
|
||||||
Ok(RenderSuperscript {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ITable;
|
use crate::intermediate::ITable;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "table")]
|
#[serde(rename = "table")]
|
||||||
pub(crate) struct RenderTable {}
|
pub(crate) struct RenderTable {}
|
||||||
|
|
||||||
impl RenderTable {
|
rnoop!(RenderTable, ITable);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &ITable,
|
|
||||||
) -> Result<RenderTable, CustomError> {
|
|
||||||
Ok(RenderTable {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,6 +6,8 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ITarget;
|
use crate::intermediate::ITarget;
|
||||||
|
|
||||||
|
use super::macros::render;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "target")]
|
#[serde(rename = "target")]
|
||||||
@ -13,15 +15,16 @@ pub(crate) struct RenderTarget {
|
|||||||
id: String,
|
id: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderTarget {
|
render!(
|
||||||
pub(crate) fn new(
|
RenderTarget,
|
||||||
_config: &Config,
|
ITarget,
|
||||||
_output_directory: &Path,
|
original,
|
||||||
_output_file: &Path,
|
config,
|
||||||
target: &ITarget,
|
output_directory,
|
||||||
) -> Result<RenderTarget, CustomError> {
|
output_file,
|
||||||
|
{
|
||||||
Ok(RenderTarget {
|
Ok(RenderTarget {
|
||||||
id: target.id.clone(),
|
id: original.id.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::ITimestamp;
|
use crate::intermediate::ITimestamp;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "timestamp")]
|
#[serde(rename = "timestamp")]
|
||||||
pub(crate) struct RenderTimestamp {}
|
pub(crate) struct RenderTimestamp {}
|
||||||
|
|
||||||
impl RenderTimestamp {
|
rnoop!(RenderTimestamp, ITimestamp);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &ITimestamp,
|
|
||||||
) -> Result<RenderTimestamp, CustomError> {
|
|
||||||
Ok(RenderTimestamp {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IUnderline;
|
use crate::intermediate::IUnderline;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "underline")]
|
#[serde(rename = "underline")]
|
||||||
pub(crate) struct RenderUnderline {}
|
pub(crate) struct RenderUnderline {}
|
||||||
|
|
||||||
impl RenderUnderline {
|
rnoop!(RenderUnderline, IUnderline);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IUnderline,
|
|
||||||
) -> Result<RenderUnderline, CustomError> {
|
|
||||||
Ok(RenderUnderline {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IVerbatim;
|
use crate::intermediate::IVerbatim;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "verbatim")]
|
#[serde(rename = "verbatim")]
|
||||||
pub(crate) struct RenderVerbatim {}
|
pub(crate) struct RenderVerbatim {}
|
||||||
|
|
||||||
impl RenderVerbatim {
|
rnoop!(RenderVerbatim, IVerbatim);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_comment: &IVerbatim,
|
|
||||||
) -> Result<RenderVerbatim, CustomError> {
|
|
||||||
Ok(RenderVerbatim {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -6,18 +6,11 @@ use crate::config::Config;
|
|||||||
use crate::error::CustomError;
|
use crate::error::CustomError;
|
||||||
use crate::intermediate::IVerseBlock;
|
use crate::intermediate::IVerseBlock;
|
||||||
|
|
||||||
|
use super::macros::rnoop;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
#[serde(rename = "verse_block")]
|
#[serde(rename = "verse_block")]
|
||||||
pub(crate) struct RenderVerseBlock {}
|
pub(crate) struct RenderVerseBlock {}
|
||||||
|
|
||||||
impl RenderVerseBlock {
|
rnoop!(RenderVerseBlock, IVerseBlock);
|
||||||
pub(crate) fn new(
|
|
||||||
_config: &Config,
|
|
||||||
_output_directory: &Path,
|
|
||||||
_output_file: &Path,
|
|
||||||
_original: &IVerseBlock,
|
|
||||||
) -> Result<RenderVerseBlock, CustomError> {
|
|
||||||
Ok(RenderVerseBlock {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user