Closed choldgraf closed 3 days ago
@choldgraf is there anything wrong with just
const myDirective = {
name: "sandbox-demo",
doc: "Demo of using the MyST sandbox to generate MyST AST.",
run(data, vfile, ctx) {
const ast = ctx.parseMyst(`
:::{card} ${data.arg}
${data.body}
:::
`);
return ast.children[0];
},
};
Nothing wrong with it, it's just not the first thing most users would try, and it makes the code look kind of ugly. But yep that works for now
I'm going to close this for now. My rationale is that I don't think this would make reading simpler for the users that already lack the experience to manually dedent text strings, and I'm keen to keep the issue tracker down in anticipation of growth!
Sounds good - but let's mark it as wontfix rather than completed
The MyST sandbox is also a useful way to generate MyST AST for your plugins. For example, with code like the following: