pub fn execute_transform(
source: &str,
transform_name: &str,
extra_params: &HashMap<String, String>,
) -> Result<String, String>Expand description
Execute a named transform on a source file with optional extra parameters
§Arguments
source- The source text to transformtransform_name- The transform to apply (e.g., “ast-tag”, “token-core-json”)extra_params- Optional parameters for the transform
§Extra Parameters
ast-full: “true” - Show complete AST including all node properties
§Returns
The transformed output as a string, or an error message
§Examples
ⓘ
let source = "# Session\n\nContent";
let params = HashMap::new();
// Get tree visualization (default view)
let output = execute_transform(source, "ast-treeviz", ¶ms)?;
// Get complete AST with all properties
let mut full_params = HashMap::new();
full_params.insert("ast-full".to_string(), "true".to_string());
let output = execute_transform(source, "ast-tag", &full_params)?;