Add post_blank to the rust types.

This commit is contained in:
Tom Alexander
2023-12-21 14:56:58 -05:00
parent 8b85c02ef1
commit 72952adb6b
108 changed files with 318 additions and 109 deletions

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "angle_link")]
pub(crate) struct RenderAngleLink {}
pub(crate) struct RenderAngleLink {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderAngleLink, IAngleLink);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "babel_call")]
pub(crate) struct RenderBabelCall {}
pub(crate) struct RenderBabelCall {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderBabelCall, IBabelCall);

View File

@@ -12,6 +12,7 @@ use super::RenderObject;
#[serde(rename = "bold")]
pub(crate) struct RenderBold {
children: Vec<RenderObject>,
post_blank: organic::types::PostBlank,
}
render!(RenderBold, IBold, original, render_context, {
@@ -23,5 +24,8 @@ render!(RenderBold, IBold, original, render_context, {
ret
};
Ok(RenderBold { children })
Ok(RenderBold {
children,
post_blank: original.post_blank,
})
});

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "center_block")]
pub(crate) struct RenderCenterBlock {}
pub(crate) struct RenderCenterBlock {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderCenterBlock, ICenterBlock);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "citation")]
pub(crate) struct RenderCitation {}
pub(crate) struct RenderCitation {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderCitation, ICitation);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "citation_reference")]
pub(crate) struct RenderCitationReference {}
pub(crate) struct RenderCitationReference {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderCitationReference, ICitationReference);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "clock")]
pub(crate) struct RenderClock {}
pub(crate) struct RenderClock {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderClock, IClock);

View File

@@ -11,10 +11,12 @@ use super::macros::render;
#[serde(rename = "code")]
pub(crate) struct RenderCode {
contents: String,
post_blank: organic::types::PostBlank,
}
render!(RenderCode, ICode, original, _render_context, {
Ok(RenderCode {
contents: original.contents.clone(),
post_blank: original.post_blank,
})
});

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "comment")]
pub(crate) struct RenderComment {}
pub(crate) struct RenderComment {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderComment, IComment);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "comment_block")]
pub(crate) struct RenderCommentBlock {}
pub(crate) struct RenderCommentBlock {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderCommentBlock, ICommentBlock);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "diary_sexp")]
pub(crate) struct RenderDiarySexp {}
pub(crate) struct RenderDiarySexp {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderDiarySexp, IDiarySexp);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "drawer")]
pub(crate) struct RenderDrawer {}
pub(crate) struct RenderDrawer {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderDrawer, IDrawer);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "dynamic_block")]
pub(crate) struct RenderDynamicBlock {}
pub(crate) struct RenderDynamicBlock {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderDynamicBlock, IDynamicBlock);

View File

@@ -11,10 +11,12 @@ use super::macros::render;
#[serde(rename = "entity")]
pub(crate) struct RenderEntity {
html: String,
post_blank: organic::types::PostBlank,
}
render!(RenderEntity, IEntity, original, _render_context, {
Ok(RenderEntity {
html: original.html.clone(),
post_blank: original.post_blank,
})
});

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "example_block")]
pub(crate) struct RenderExampleBlock {}
pub(crate) struct RenderExampleBlock {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderExampleBlock, IExampleBlock);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "export_block")]
pub(crate) struct RenderExportBlock {}
pub(crate) struct RenderExportBlock {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderExportBlock, IExportBlock);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "export_snippet")]
pub(crate) struct RenderExportSnippet {}
pub(crate) struct RenderExportSnippet {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderExportSnippet, IExportSnippet);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "fixed_width_area")]
pub(crate) struct RenderFixedWidthArea {}
pub(crate) struct RenderFixedWidthArea {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderFixedWidthArea, IFixedWidthArea);

View File

@@ -13,18 +13,21 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "footnote_definition")]
pub(crate) struct RenderFootnoteDefinition {}
pub(crate) struct RenderFootnoteDefinition {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderFootnoteDefinition, IFootnoteDefinition);
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "footnote_reference")]
#[serde(rename = "real_footnote_definition")]
pub(crate) struct RenderRealFootnoteDefinition {
definition_id: String,
reference_link: String,
label: String,
contents: Vec<RenderAstNode>,
// TODO: Do I need post_blank for real footnote definitions?
}
render!(

View File

@@ -13,6 +13,7 @@ pub(crate) struct RenderFootnoteReference {
reference_id: String,
definition_link: String,
label: String,
post_blank: organic::types::PostBlank,
}
render!(
@@ -28,6 +29,7 @@ render!(
original.get_definition_id(render_context.id_addition)
),
label: original.get_display_label(),
post_blank: original.post_blank,
})
}
);

View File

@@ -15,6 +15,7 @@ pub(crate) struct RenderHeading {
level: organic::types::HeadlineLevel,
title: Vec<RenderObject>,
children: Vec<RenderDocumentElement>,
post_blank: organic::types::PostBlank,
}
render!(RenderHeading, IHeading, original, render_context, {
@@ -38,5 +39,6 @@ render!(RenderHeading, IHeading, original, render_context, {
level: original.level + 1, // Adding 1 because the page title is going to be h1.
title,
children,
post_blank: original.post_blank,
})
});

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "horizontal_rule")]
pub(crate) struct RenderHorizontalRule {}
pub(crate) struct RenderHorizontalRule {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderHorizontalRule, IHorizontalRule);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "inline_babel_call")]
pub(crate) struct RenderInlineBabelCall {}
pub(crate) struct RenderInlineBabelCall {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderInlineBabelCall, IInlineBabelCall);

View File

@@ -11,6 +11,7 @@ use super::macros::render;
#[serde(rename = "inline_source_block")]
pub(crate) struct RenderInlineSourceBlock {
value: String,
post_blank: organic::types::PostBlank,
}
render!(
@@ -21,6 +22,7 @@ render!(
{
Ok(RenderInlineSourceBlock {
value: original.value.clone(),
post_blank: original.post_blank,
})
}
);

View File

@@ -12,6 +12,7 @@ use super::RenderObject;
#[serde(rename = "italic")]
pub(crate) struct RenderItalic {
children: Vec<RenderObject>,
post_blank: organic::types::PostBlank,
}
render!(RenderItalic, IItalic, original, render_context, {
@@ -23,5 +24,8 @@ render!(RenderItalic, IItalic, original, render_context, {
ret
};
Ok(RenderItalic { children })
Ok(RenderItalic {
children,
post_blank: original.post_blank,
})
});

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "keyword")]
pub(crate) struct RenderKeyword {}
pub(crate) struct RenderKeyword {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderKeyword, IKeyword);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "latex_environment")]
pub(crate) struct RenderLatexEnvironment {}
pub(crate) struct RenderLatexEnvironment {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderLatexEnvironment, ILatexEnvironment);

View File

@@ -11,6 +11,7 @@ use super::macros::render;
#[serde(rename = "latex_fragment")]
pub(crate) struct RenderLatexFragment {
value: String,
post_blank: organic::types::PostBlank,
}
render!(
@@ -21,6 +22,7 @@ render!(
{
Ok(RenderLatexFragment {
value: original.value.clone(),
post_blank: original.post_blank,
})
}
);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "line_break")]
pub(crate) struct RenderLineBreak {}
pub(crate) struct RenderLineBreak {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderLineBreak, ILineBreak);

View File

@@ -24,9 +24,11 @@ macro_rules! rnoop {
impl $rstruct {
pub(crate) fn new(
_render_context: RenderContext<'_>,
_original: &$istruct,
original: &$istruct,
) -> Result<$rstruct, CustomError> {
Ok($rstruct {})
Ok($rstruct {
post_blank: original.post_blank,
})
}
}
};

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "org_macro")]
pub(crate) struct RenderOrgMacro {}
pub(crate) struct RenderOrgMacro {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderOrgMacro, IOrgMacro);

View File

@@ -12,6 +12,7 @@ use super::RenderObject;
#[serde(rename = "paragraph")]
pub(crate) struct RenderParagraph {
children: Vec<RenderObject>,
post_blank: organic::types::PostBlank,
}
render!(RenderParagraph, IParagraph, original, render_context, {
@@ -23,5 +24,8 @@ render!(RenderParagraph, IParagraph, original, render_context, {
ret
};
Ok(RenderParagraph { children })
Ok(RenderParagraph {
children,
post_blank: original.post_blank,
})
});

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "plain_link")]
pub(crate) struct RenderPlainLink {}
pub(crate) struct RenderPlainLink {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderPlainLink, IPlainLink);

View File

@@ -13,6 +13,7 @@ use super::plain_list_item::RenderPlainListItem;
pub(crate) struct RenderPlainList {
list_type: String,
children: Vec<RenderPlainListItem>,
post_blank: organic::types::PostBlank,
}
render!(RenderPlainList, IPlainList, original, render_context, {
@@ -32,5 +33,6 @@ render!(RenderPlainList, IPlainList, original, render_context, {
Ok(RenderPlainList {
list_type,
children,
post_blank: original.post_blank,
})
});

View File

@@ -11,10 +11,12 @@ use super::macros::render;
#[serde(rename = "plain_text")]
pub(crate) struct RenderPlainText {
source: String,
post_blank: organic::types::PostBlank,
}
render!(RenderPlainText, IPlainText, original, _render_context, {
Ok(RenderPlainText {
source: original.source.clone(),
post_blank: original.post_blank,
})
});

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "planning")]
pub(crate) struct RenderPlanning {}
pub(crate) struct RenderPlanning {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderPlanning, IPlanning);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "property_drawer")]
pub(crate) struct RenderPropertyDrawer {}
pub(crate) struct RenderPropertyDrawer {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderPropertyDrawer, IPropertyDrawer);

View File

@@ -12,6 +12,7 @@ use super::RenderElement;
#[serde(rename = "quote_block")]
pub(crate) struct RenderQuoteBlock {
children: Vec<RenderElement>,
post_blank: organic::types::PostBlank,
}
render!(RenderQuoteBlock, IQuoteBlock, original, render_context, {
@@ -23,5 +24,8 @@ render!(RenderQuoteBlock, IQuoteBlock, original, render_context, {
ret
};
Ok(RenderQuoteBlock { children })
Ok(RenderQuoteBlock {
children,
post_blank: original.post_blank,
})
});

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "radio_link")]
pub(crate) struct RenderRadioLink {}
pub(crate) struct RenderRadioLink {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderRadioLink, IRadioLink);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "radio_target")]
pub(crate) struct RenderRadioTarget {}
pub(crate) struct RenderRadioTarget {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderRadioTarget, IRadioTarget);

View File

@@ -13,6 +13,7 @@ use super::RenderObject;
pub(crate) struct RenderRegularLink {
raw_link: String,
children: Vec<RenderObject>,
post_blank: organic::types::PostBlank,
}
render!(RenderRegularLink, IRegularLink, original, render_context, {
@@ -27,5 +28,6 @@ render!(RenderRegularLink, IRegularLink, original, render_context, {
Ok(RenderRegularLink {
raw_link: original.raw_link.clone(),
children,
post_blank: original.post_blank,
})
});

View File

@@ -12,6 +12,7 @@ use super::RenderElement;
#[serde(rename = "section")]
pub(crate) struct RenderSection {
children: Vec<RenderElement>,
post_blank: organic::types::PostBlank,
}
render!(RenderSection, ISection, original, render_context, {
@@ -23,5 +24,8 @@ render!(RenderSection, ISection, original, render_context, {
ret
};
Ok(RenderSection { children })
Ok(RenderSection {
children,
post_blank: original.post_blank,
})
});

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "special_block")]
pub(crate) struct RenderSpecialBlock {}
pub(crate) struct RenderSpecialBlock {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderSpecialBlock, ISpecialBlock);

View File

@@ -12,11 +12,13 @@ use super::macros::render;
pub(crate) struct RenderSrcBlock {
lines: Vec<String>,
language: Option<String>,
post_blank: organic::types::PostBlank,
}
render!(RenderSrcBlock, ISrcBlock, original, _render_context, {
Ok(RenderSrcBlock {
lines: original.lines.clone(),
language: original.language.clone(),
post_blank: original.post_blank,
})
});

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "statistics_cookie")]
pub(crate) struct RenderStatisticsCookie {}
pub(crate) struct RenderStatisticsCookie {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderStatisticsCookie, IStatisticsCookie);

View File

@@ -12,6 +12,7 @@ use super::RenderObject;
#[serde(rename = "strike_through")]
pub(crate) struct RenderStrikeThrough {
children: Vec<RenderObject>,
post_blank: organic::types::PostBlank,
}
render!(
@@ -28,6 +29,9 @@ render!(
ret
};
Ok(RenderStrikeThrough { children })
Ok(RenderStrikeThrough {
children,
post_blank: original.post_blank,
})
}
);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "subscript")]
pub(crate) struct RenderSubscript {}
pub(crate) struct RenderSubscript {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderSubscript, ISubscript);

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "superscript")]
pub(crate) struct RenderSuperscript {}
pub(crate) struct RenderSuperscript {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderSuperscript, ISuperscript);

View File

@@ -12,6 +12,7 @@ use super::table_row::RenderTableRow;
#[serde(rename = "table")]
pub(crate) struct RenderTable {
children: Vec<RenderTableRow>,
post_blank: organic::types::PostBlank,
}
render!(RenderTable, ITable, original, render_context, {
@@ -23,5 +24,8 @@ render!(RenderTable, ITable, original, render_context, {
ret
};
Ok(RenderTable { children })
Ok(RenderTable {
children,
post_blank: original.post_blank,
})
});

View File

@@ -11,10 +11,12 @@ use super::macros::render;
#[serde(rename = "target")]
pub(crate) struct RenderTarget {
id: String,
post_blank: organic::types::PostBlank,
}
render!(RenderTarget, ITarget, original, _render_context, {
Ok(RenderTarget {
id: original.id.clone(),
post_blank: original.post_blank,
})
});

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "timestamp")]
pub(crate) struct RenderTimestamp {}
pub(crate) struct RenderTimestamp {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderTimestamp, ITimestamp);

View File

@@ -12,6 +12,7 @@ use super::RenderObject;
#[serde(rename = "underline")]
pub(crate) struct RenderUnderline {
children: Vec<RenderObject>,
post_blank: organic::types::PostBlank,
}
render!(RenderUnderline, IUnderline, original, render_context, {
@@ -23,5 +24,8 @@ render!(RenderUnderline, IUnderline, original, render_context, {
ret
};
Ok(RenderUnderline { children })
Ok(RenderUnderline {
children,
post_blank: original.post_blank,
})
});

View File

@@ -11,10 +11,12 @@ use super::macros::render;
#[serde(rename = "verbatim")]
pub(crate) struct RenderVerbatim {
contents: String,
post_blank: organic::types::PostBlank,
}
render!(RenderVerbatim, IVerbatim, original, _render_context, {
Ok(RenderVerbatim {
contents: original.contents.clone(),
post_blank: original.post_blank,
})
});

View File

@@ -9,6 +9,8 @@ use super::macros::rnoop;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "verse_block")]
pub(crate) struct RenderVerseBlock {}
pub(crate) struct RenderVerseBlock {
post_blank: organic::types::PostBlank,
}
rnoop!(RenderVerseBlock, IVerseBlock);