Add templates for text markup.

This commit is contained in:
Tom Alexander 2023-10-27 19:42:33 -04:00
parent 4c3bea06d1
commit f6c475c80c
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
9 changed files with 23 additions and 11 deletions

View File

@ -1 +1,3 @@
bold <b>{#.children}
{>object/}
{/.children}</b>

View File

@ -1 +1 @@
code <code>{.source}</code>

View File

@ -1 +1,3 @@
italic <i>{#.children}
{>object/}
{/.children}</i>

View File

@ -1 +1 @@
plain_text {.source}

View File

@ -1 +1,3 @@
strike_through <del>{#.children}
{>object/}
{/.children}</del>

View File

@ -1 +1,3 @@
underline <u>{#.children}
{>object/}
{/.children}</u>

View File

@ -1 +1 @@
verbatim <code>{.source}</code>

View File

@ -9,15 +9,19 @@ use crate::intermediate::IPlainText;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "type")] #[serde(tag = "type")]
#[serde(rename = "plain_text")] #[serde(rename = "plain_text")]
pub(crate) struct RenderPlainText {} pub(crate) struct RenderPlainText {
source: String,
}
impl RenderPlainText { impl RenderPlainText {
pub(crate) fn new( pub(crate) fn new(
config: &Config, config: &Config,
output_directory: &Path, output_directory: &Path,
output_file: &Path, output_file: &Path,
heading: &IPlainText, original: &IPlainText,
) -> Result<RenderPlainText, CustomError> { ) -> Result<RenderPlainText, CustomError> {
Ok(RenderPlainText {}) Ok(RenderPlainText {
source: original.source.clone(),
})
} }
} }

View File

@ -5,7 +5,7 @@ use super::registry::Registry;
#[derive(Debug)] #[derive(Debug)]
pub(crate) struct IPlainText { pub(crate) struct IPlainText {
source: String, pub(crate) source: String,
} }
impl IPlainText { impl IPlainText {