diff --git a/Makefile b/Makefile index ffd67e9d..532d848e 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ wasm: .PHONY: run_wasm run_wasm: -> cat /tmp/test.org | cargo run --profile wasm --bin wasm_test --features wasm_test | jq +> cat /tmp/test.org | cargo run --profile wasm --bin wasm_test --features wasm_test .PHONY: clean clean: diff --git a/src/wasm/document.rs b/src/wasm/document.rs index eac8ba4c..d4b1a9b7 100644 --- a/src/wasm/document.rs +++ b/src/wasm/document.rs @@ -1,3 +1,5 @@ +use std::path::PathBuf; + use serde::Serialize; use super::ast_node::WasmAstNode; @@ -14,6 +16,8 @@ pub struct WasmDocument<'s> { standard_properties: WasmStandardProperties, additional_properties: Vec<(String, &'s str)>, children: Vec>, + category: Option, + path: Option, } to_wasm!( @@ -23,6 +27,9 @@ to_wasm!( wasm_context, standard_properties, { + let category = original.category.clone(); + let path = original.path.clone(); + let additional_properties: Vec<(String, &str)> = original .get_additional_properties() .map(|node_property| { @@ -47,20 +54,13 @@ to_wasm!( .map(Into::>::into) })) .collect::, _>>()?; - // let children = original - // .children - // .iter() - // .map(|child| { - // child - // .to_wasm(wasm_context.clone()) - // .map(Into::>::into) - // }) - // .collect::, _>>()?; Ok(WasmDocument { standard_properties, additional_properties, children, + category, + path, }) } );