fractive
fractive copied to clipboard
Call functions with Bash-style arguments
I think there should be a little bit more flexibility in calling JavaScript functions from within Markdown. My proposal is a syntax like this: {#function arg1 arg2 ...} where functions can optionally be defined with a signature like this:
function mFunc(args)
where args will be an array of strings containing one token each.
Can the arguments be the output of other functions? expanded js variables?
{#function {$myVar}}
My thinking was that they shouldn't be. Josh has said in the past that a core design principle is keeping complicated logic outside of markdown files altogether, and adding recursion to this would definitely add the temptation to be doing crazier things with macros. I'm thinking the only arguments allowed should be string or number literals.