Also note that your function, if called with \strut-line { hello world
}, actually adds your invisible strut to every word of the line. (Just
remove the make-transparent-markup in your function to see this, or,
more easuily, remove the #:transparent in my version). Compare:
\markup \strut-line { hello world }
\markup \strut-line \line { hello world }
This difference (I think) originates in the way LilyPond applies
markup functions to explicit markups of the form { some word and some
other }, or put differently: Where the implicit \line is put, and how
a function expecting a single markup is applied to a list of markups.
But note what changes if you replace the markup? predicate in your
function definition by markup-list?.
I think that was a bit cryptic :-).
Here's a (hopefully) clearer example:
\version "2.22"
#(define-markup-command (demo-eating-markup layout props stuff) (markup?)
(format #t "Processing single markup: \"~a\"\n" (markup->string stuff))
(interpret-markup layout props stuff))
#(define-markup-command (demo-eating-markup-list layout props stuff)
(markup-list?)
(format #t "Processing markup list: ~a\n" stuff)
(interpret-markup layout props (make-column-markup stuff)))
\markup \demo-eating-markup { one two }
\markup \demo-eating-markup \line { eins zwei }
\markup \demo-eating-markup-list { oans zwoa }
\markup \demo-eating-markup-list { \line { un deux } }
The standard use case for make-XXX-markup is explained in:
http://lilypond.org/doc/v2.23/Documentation/extending/markup-construction-in-scheme.html
under "Known issues and warnings".
I would agree that the explanations regarding markups vs. markup lists,
markup vs. stencils, markup in scheme etc. in the Documentation might be
improved. We always welcome contributions! (And, your probably noticed
this: The German documentation is in an effectively unmaintained state
at the moment. But it seems there's hope this might change soonish.
Lukas