Quasi-quotations, again

In this other thread, @jan wrote:

One day we should add a nice quasi quotation rule for plain text.

How did you mean that? That you can just embed (unescaped?) variables in free text? As in,

{|plaintext(Name)||Hello, Name. How are you doing today?|}

Or do you think there would have to be some kind of escaping mechanism? How did you imagine it will work?

I am asking because I actually need a plain text quasi quotation rule and might as well make it, but obviously I don’t even know for sure what the interface should look like.

There are many ways to do it; for example Python has formatted string literals, or “f-strings” (one of maybe 5 ways to format strings in Python… “one obvious way” my a**). Those capture named variables from the surrounding scope (implicitly!), like this:

def say_hello(name):
    greeting = "Hello"
    return f"{greeting}, {name}!"

As you see, Python uses curly braces for the variable. Noweb uses double square brackets for something similar, so with quasi quotations it would be:

{|plaintext(Greeting, Name)||[[Greeting]], [[Name]]!|}

(ugh… on the other hand, you almost never have double square brackets in code, markdown, text…)

Or maybe someone has already done the work and wants to share?