← Back to team overview

maria-docs team mailing list archive

Re: KB Macro Proposal


Hi, Daniel!

On Dec 07, Daniel Bartholomew wrote:
> All,
> Based on an IRC discussion from yesterday, I whipped up a prototype of
> a couple of macros for use in code examples.
> The macros would be <<input>> and <<output>> and would be used almost
> the same way as the <<code>> macro (the main difference being that
> they cannot be used "inline"). For example:
> <<input lang=sql>>
> SELECT * FROM t1 WHERE d LIKE "%es%";
> <</input>>
> <<output>>
> +-----------+
> | d         |
> +-----------+
> | Tuesday   |
> | Wednesday |
> +-----------+
> <</output>>

I wanted to reply that one rarely needs separate input and output
blocks, and much more often something like a <<tty>> block (or
whatever), that includes both input and the output as typed on the

But then, I looked at your screenshots - and indeed, they perfectly
supported what I said - in your screenshots you use <<output>> both for
input and the output "as typed on the terminal", and <<input>> basically
the same as <<sql>>. I mean, that's how you used them, not how they

So, at the moment I'm not convinced we need input/output macros (and
your screenshots only confirmed that). I'd rather see <<tty>> macro -
but with explicit highlighting of what is the input.
They can even be called <<input>> and <<output>>:

MariaDB [test] <<input>> SELECT * FROM t1 WHERE d LIKE "%es%";<</input>>
| d         |
| Tuesday   |
| Wednesday |
2 rows in set (0.00 sec)


Follow ups