Compare commits
No commits in common. "3ec900c8df846114345331f1c80e5bfd947ef904" and "ebe12d96c166aa0c38136f49c9af765408438ae9" have entirely different histories.
3ec900c8df
...
ebe12d96c1
@ -4,13 +4,15 @@ use serde::Serialize;
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::compare::ElispFact;
|
||||
use crate::types::LatexFragment;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct WasmLatexFragment {
|
||||
pub(crate) value: String,
|
||||
#[serde(flatten)]
|
||||
pub(crate) additional_properties: AdditionalProperties,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
@ -19,12 +21,12 @@ to_wasm!(
|
||||
original,
|
||||
wasm_context,
|
||||
{ WasmAstNode::LatexFragment(original) },
|
||||
{ "latex-fragment".into() },
|
||||
{ "TODO".into() },
|
||||
{
|
||||
Ok((
|
||||
Vec::new(),
|
||||
WasmLatexFragment {
|
||||
value: original.value.to_owned(),
|
||||
additional_properties: AdditionalProperties::default(),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
@ -4,15 +4,15 @@ use serde::Serialize;
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::compare::ElispFact;
|
||||
use crate::types::OrgMacro;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct WasmOrgMacro {
|
||||
pub(crate) key: String,
|
||||
pub(crate) value: String,
|
||||
pub(crate) args: Vec<String>,
|
||||
#[serde(flatten)]
|
||||
pub(crate) additional_properties: AdditionalProperties,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
@ -21,14 +21,12 @@ to_wasm!(
|
||||
original,
|
||||
wasm_context,
|
||||
{ WasmAstNode::OrgMacro(original) },
|
||||
{ "macro".into() },
|
||||
{ "TODO".into() },
|
||||
{
|
||||
Ok((
|
||||
Vec::new(),
|
||||
WasmOrgMacro {
|
||||
key: original.key.to_lowercase(),
|
||||
value: original.value.to_owned(),
|
||||
args: original.get_args().map(|s| s.into_owned()).collect(),
|
||||
additional_properties: AdditionalProperties::default(),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
@ -4,23 +4,15 @@ use serde::Serialize;
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::compare::ElispFact;
|
||||
use crate::types::LinkType;
|
||||
use crate::types::PlainLink;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(tag = "format")]
|
||||
#[serde(rename = "plain")]
|
||||
pub struct WasmPlainLink {
|
||||
#[serde(rename = "type")]
|
||||
pub(crate) link_type: String,
|
||||
pub(crate) path: String,
|
||||
#[serde(rename = "raw-link")]
|
||||
pub(crate) raw_link: String,
|
||||
pub(crate) application: Option<String>,
|
||||
#[serde(rename = "search-option")]
|
||||
pub(crate) search_option: Option<String>,
|
||||
#[serde(flatten)]
|
||||
pub(crate) additional_properties: AdditionalProperties,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
@ -29,23 +21,12 @@ to_wasm!(
|
||||
original,
|
||||
wasm_context,
|
||||
{ WasmAstNode::PlainLink(original) },
|
||||
{ "link".into() },
|
||||
{ "TODO".into() },
|
||||
{
|
||||
Ok((
|
||||
Vec::new(),
|
||||
WasmPlainLink {
|
||||
link_type: match &original.link_type {
|
||||
LinkType::File => "file".to_owned(),
|
||||
LinkType::Protocol(protocol) => protocol.clone().into_owned(),
|
||||
LinkType::Id => "id".to_owned(),
|
||||
LinkType::CustomId => "custom-id".to_owned(),
|
||||
LinkType::CodeRef => "coderef".to_owned(),
|
||||
LinkType::Fuzzy => "fuzzy".to_owned(),
|
||||
},
|
||||
path: original.path.to_owned(),
|
||||
raw_link: original.raw_link.to_owned(),
|
||||
application: original.application.map(str::to_owned),
|
||||
search_option: original.search_option.map(str::to_owned),
|
||||
additional_properties: AdditionalProperties::default(),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
@ -4,22 +4,15 @@ use serde::Serialize;
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::compare::ElispFact;
|
||||
use crate::types::RadioLink;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(tag = "format")]
|
||||
#[serde(rename = "plain")]
|
||||
pub struct WasmRadioLink {
|
||||
#[serde(rename = "type")]
|
||||
pub(crate) link_type: String,
|
||||
pub(crate) path: String,
|
||||
#[serde(rename = "raw-link")]
|
||||
pub(crate) raw_link: String,
|
||||
pub(crate) application: Option<String>, // Always None
|
||||
#[serde(rename = "search-option")]
|
||||
pub(crate) search_option: Option<String>, // Always None
|
||||
#[serde(flatten)]
|
||||
pub(crate) additional_properties: AdditionalProperties,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
@ -28,7 +21,7 @@ to_wasm!(
|
||||
original,
|
||||
wasm_context,
|
||||
{ WasmAstNode::RadioLink(original) },
|
||||
{ "link".into() },
|
||||
{ "TODO".into() },
|
||||
{
|
||||
let children = original
|
||||
.children
|
||||
@ -43,11 +36,7 @@ to_wasm!(
|
||||
Ok((
|
||||
children,
|
||||
WasmRadioLink {
|
||||
link_type: "radio".to_owned(),
|
||||
path: original.path.to_owned(),
|
||||
raw_link: original.get_raw_link().to_owned(),
|
||||
application: None,
|
||||
search_option: None,
|
||||
additional_properties: AdditionalProperties::default(),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
@ -4,13 +4,15 @@ use serde::Serialize;
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::compare::ElispFact;
|
||||
use crate::types::RadioTarget;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct WasmRadioTarget {
|
||||
pub(crate) value: String,
|
||||
#[serde(flatten)]
|
||||
pub(crate) additional_properties: AdditionalProperties,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
@ -19,7 +21,7 @@ to_wasm!(
|
||||
original,
|
||||
wasm_context,
|
||||
{ WasmAstNode::RadioTarget(original) },
|
||||
{ "radio-target".into() },
|
||||
{ "TODO".into() },
|
||||
{
|
||||
let children = original
|
||||
.children
|
||||
@ -34,7 +36,7 @@ to_wasm!(
|
||||
Ok((
|
||||
children,
|
||||
WasmRadioTarget {
|
||||
value: original.value.to_owned(),
|
||||
additional_properties: AdditionalProperties::default(),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
@ -1,28 +1,18 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::compare::ElispFact;
|
||||
use crate::types::LinkType;
|
||||
use crate::types::RegularLink;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(tag = "format")]
|
||||
#[serde(rename = "bracket")]
|
||||
pub struct WasmRegularLink {
|
||||
#[serde(rename = "type")]
|
||||
pub(crate) link_type: String,
|
||||
pub(crate) path: String,
|
||||
#[serde(rename = "raw-link")]
|
||||
pub(crate) raw_link: String,
|
||||
pub(crate) application: Option<String>,
|
||||
#[serde(rename = "search-option")]
|
||||
pub(crate) search_option: Option<String>,
|
||||
#[serde(flatten)]
|
||||
pub(crate) additional_properties: AdditionalProperties,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
@ -31,7 +21,7 @@ to_wasm!(
|
||||
original,
|
||||
wasm_context,
|
||||
{ WasmAstNode::RegularLink(original) },
|
||||
{ "link".into() },
|
||||
{ "TODO".into() },
|
||||
{
|
||||
let children = original
|
||||
.children
|
||||
@ -46,21 +36,7 @@ to_wasm!(
|
||||
Ok((
|
||||
children,
|
||||
WasmRegularLink {
|
||||
link_type: match &original.link_type {
|
||||
LinkType::File => "file".to_owned(),
|
||||
LinkType::Protocol(protocol) => protocol.clone().into_owned(),
|
||||
LinkType::Id => "id".to_owned(),
|
||||
LinkType::CustomId => "custom-id".to_owned(),
|
||||
LinkType::CodeRef => "coderef".to_owned(),
|
||||
LinkType::Fuzzy => "fuzzy".to_owned(),
|
||||
},
|
||||
path: original.get_path().into_owned(),
|
||||
raw_link: original.get_raw_link().into_owned(),
|
||||
application: original
|
||||
.application
|
||||
.as_ref()
|
||||
.map(|c| c.clone().into_owned()),
|
||||
search_option: original.get_search_option().map(Cow::into_owned),
|
||||
additional_properties: AdditionalProperties::default(),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
@ -4,13 +4,15 @@ use serde::Serialize;
|
||||
use super::ast_node::WasmAstNode;
|
||||
use super::macros::to_wasm;
|
||||
use super::to_wasm::ToWasm;
|
||||
use super::AdditionalProperties;
|
||||
use crate::compare::ElispFact;
|
||||
use crate::types::Target;
|
||||
use crate::wasm::to_wasm::ToWasmStandardProperties;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct WasmTarget {
|
||||
pub(crate) value: String,
|
||||
#[serde(flatten)]
|
||||
pub(crate) additional_properties: AdditionalProperties,
|
||||
}
|
||||
|
||||
to_wasm!(
|
||||
@ -19,12 +21,12 @@ to_wasm!(
|
||||
original,
|
||||
wasm_context,
|
||||
{ WasmAstNode::Target(original) },
|
||||
{ "target".into() },
|
||||
{ "TODO".into() },
|
||||
{
|
||||
Ok((
|
||||
Vec::new(),
|
||||
WasmTarget {
|
||||
value: original.value.to_owned(),
|
||||
additional_properties: AdditionalProperties::default(),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user