On Thu 30 Apr 2020 at 21:58:28 (+0200), Marcel Aartsen wrote:
> As the subject says, I would like to have Lilypond output svg to stdout.
> Can it be done? How do I do that?

I don't think you can use stdout itself, as LP already uses it.
However, you can use a pipe:

$ mkfifo foo.svg
$ lilypond -dbackend=svg -o foo music.ly 

which will block until you, say,

$ cat foo.svg | some-consumer-of-svg

I haven't tested whether LP *insists* on adding an .svg extension.

> Some background: I am developing an online course in Open edX [1], and
> for that course I am writing an XBlock [2]. This means that the user on
> the front end triggers a request that is processed by some server-side
> Python code that, in my case, in turn calls Lilypond. Lilypond's output
> is ultimately on the front end to be displayed in html, so I figured
> that svg output would be best. And I reckon that it will be
> unnecessarily cumbersome and slow to let Lilypond write to file and then
> let the Python code read that file back from disk.
> 
> Any ideas to output Lilypond's svg to stdout? Or better alternatives?

Cheers,
David.

Reply via email to