Implement footnote definition.

This commit is contained in:
Tom Alexander 2023-12-30 16:13:54 -05:00
parent e0c0070a13
commit 8eba0c4923
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -2,17 +2,22 @@ use serde::Deserialize;
use serde::Serialize;
use super::ast_node::WasmAstNode;
use super::headline::Noop;
use super::macros::to_wasm;
use super::to_wasm::ToWasm;
use super::AdditionalProperties;
use crate::compare::ElispFact;
use crate::types::FootnoteDefinition;
use crate::types::GetAffiliatedKeywords;
use crate::wasm::to_wasm::ToWasmStandardProperties;
#[derive(Debug, Serialize, Deserialize)]
pub struct WasmFootnoteDefinition {
#[serde(flatten)]
pub(crate) additional_properties: AdditionalProperties,
pub(crate) label: String,
#[serde(rename = "pre-blank")]
pub(crate) pre_blank: Noop,
}
to_wasm!(
@ -21,8 +26,12 @@ to_wasm!(
original,
wasm_context,
{ WasmAstNode::FootnoteDefinition(original) },
{ "TODO".into() },
{ "footnote-definition".into() },
{
let additional_properties = original
.get_affiliated_keywords()
.to_wasm(wasm_context.clone())?;
let children = original
.children
.iter()
@ -36,7 +45,9 @@ to_wasm!(
Ok((
children,
WasmFootnoteDefinition {
additional_properties: AdditionalProperties::default(),
additional_properties,
label: original.label.to_owned(),
pre_blank: Noop {},
},
))
}