fractive icon indicating copy to clipboard operation
fractive copied to clipboard

Call functions with Bash-style arguments

Open NQNStudios opened this issue 6 years ago • 2 comments

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.

NQNStudios avatar Apr 02 '18 21:04 NQNStudios

Can the arguments be the output of other functions? expanded js variables?

{#function {$myVar}}

hyakugei avatar Apr 13 '18 15:04 hyakugei

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.

NQNStudios avatar Apr 13 '18 15:04 NQNStudios