Compare commits

...

3 Commits

Author SHA1 Message Date
Tom Alexander
f164838953
Add a space after objects. 2023-10-27 20:54:24 -04:00
Tom Alexander
fe3f2642fe
Add a marker to make incomplete templates more obvious in the rendered html. 2023-10-27 20:51:27 -04:00
Tom Alexander
3d89492518
Add regular link. 2023-10-27 20:43:57 -04:00
39 changed files with 78 additions and 42 deletions

View File

@ -1 +1 @@
angle_link !!!!!!!! angle_link

View File

@ -1 +1 @@
babel_call !!!!!!!! babel_call

View File

@ -1 +1 @@
center_block !!!!!!!! center_block

View File

@ -1 +1 @@
citation !!!!!!!! citation

View File

@ -1 +1 @@
citation_reference !!!!!!!! citation_reference

View File

@ -1 +1 @@
clock !!!!!!!! clock

View File

@ -1 +1 @@
diary_sexp !!!!!!!! diary_sexp

View File

@ -1 +1 @@
drawer !!!!!!!! drawer

View File

@ -1 +1 @@
dynamic_block !!!!!!!! dynamic_block

View File

@ -1 +1 @@
example_block !!!!!!!! example_block

View File

@ -1 +1 @@
export_block !!!!!!!! export_block

View File

@ -1 +1 @@
export_snippet !!!!!!!! export_snippet

View File

@ -1 +1 @@
fixed_width_area !!!!!!!! fixed_width_area

View File

@ -1 +1 @@
footnote_definition !!!!!!!! footnote_definition

View File

@ -1 +1 @@
footnote_reference !!!!!!!! footnote_reference

View File

@ -1 +1 @@
global_settings !!!!!!!! global_settings

View File

@ -1 +1 @@
horizontal_rule !!!!!!!! horizontal_rule

View File

@ -1 +1 @@
inline_babel_call !!!!!!!! inline_babel_call

View File

@ -1 +1 @@
inline_source_block !!!!!!!! inline_source_block

View File

@ -1 +1 @@
latex_environment !!!!!!!! latex_environment

View File

@ -1 +1 @@
latex_fragment !!!!!!!! latex_fragment

View File

@ -27,4 +27,5 @@
{@eq value="superscript"}{>superscript/}{/eq} {@eq value="superscript"}{>superscript/}{/eq}
{@eq value="timestamp"}{>timestamp/}{/eq} {@eq value="timestamp"}{>timestamp/}{/eq}
{@none}{!TODO: make this panic!}ERROR: Unrecognized type {.type}.{/none} {@none}{!TODO: make this panic!}ERROR: Unrecognized type {.type}.{/none}
{/select} {/select}{~s}
{! TODO: Maybe the final space should be conditional on end blank in the org source !}

View File

@ -1 +1 @@
org_macro !!!!!!!! org_macro

View File

@ -1 +1 @@
plain_link !!!!!!!! plain_link

View File

@ -1 +1 @@
planning !!!!!!!! planning

View File

@ -1 +1 @@
property_drawer !!!!!!!! property_drawer

View File

@ -1 +1 @@
radio_link !!!!!!!! radio_link

View File

@ -1 +1 @@
radio_target !!!!!!!! radio_target

View File

@ -1 +1 @@
regular_link <a href="{path}">{#.children}{>object/}{/.children}</a>

View File

@ -1 +1 @@
special_block !!!!!!!! special_block

View File

@ -1 +1 @@
src_block !!!!!!!! src_block

View File

@ -1 +1 @@
statistics_cookie !!!!!!!! statistics_cookie

View File

@ -1 +1 @@
subscript !!!!!!!! subscript

View File

@ -1 +1 @@
superscript !!!!!!!! superscript

View File

@ -1 +1 @@
table !!!!!!!! table

View File

@ -1 +1 @@
timestamp !!!!!!!! timestamp

View File

@ -1 +1 @@
verse_block !!!!!!!! verse_block

View File

@ -6,18 +6,39 @@ use crate::config::Config;
use crate::error::CustomError; use crate::error::CustomError;
use crate::intermediate::IRegularLink; use crate::intermediate::IRegularLink;
use super::RenderObject;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
#[serde(tag = "type")] #[serde(tag = "type")]
#[serde(rename = "regular_link")] #[serde(rename = "regular_link")]
pub(crate) struct RenderRegularLink {} pub(crate) struct RenderRegularLink {
path: String,
children: Vec<RenderObject>,
}
impl RenderRegularLink { impl RenderRegularLink {
pub(crate) fn new( pub(crate) fn new(
config: &Config, config: &Config,
output_directory: &Path, output_directory: &Path,
output_file: &Path, output_file: &Path,
comment: &IRegularLink, regular_link: &IRegularLink,
) -> Result<RenderRegularLink, CustomError> { ) -> Result<RenderRegularLink, CustomError> {
Ok(RenderRegularLink {}) let children = {
let mut ret = Vec::new();
for obj in regular_link.children.iter() {
ret.push(RenderObject::new(
config,
&output_directory,
&output_file,
obj,
)?);
}
ret
};
Ok(RenderRegularLink {
path: regular_link.path.clone(),
children,
})
} }
} }

View File

@ -1,15 +1,29 @@
use crate::error::CustomError; use crate::error::CustomError;
use super::registry::Registry; use super::registry::Registry;
use super::IObject;
#[derive(Debug)] #[derive(Debug)]
pub(crate) struct IRegularLink {} pub(crate) struct IRegularLink {
pub(crate) path: String,
pub(crate) children: Vec<IObject>,
}
impl IRegularLink { impl IRegularLink {
pub(crate) async fn new<'parse>( pub(crate) async fn new<'parse>(
registry: &mut Registry<'parse>, registry: &mut Registry<'parse>,
original: &organic::types::RegularLink<'parse>, original: &organic::types::RegularLink<'parse>,
) -> Result<IRegularLink, CustomError> { ) -> Result<IRegularLink, CustomError> {
Ok(IRegularLink {}) let children = {
let mut ret = Vec::new();
for obj in original.children.iter() {
ret.push(IObject::new(registry, obj).await?);
}
ret
};
Ok(IRegularLink {
path: original.path.as_ref().to_owned(),
children,
})
} }
} }