Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write output to stdout #683

Open
nichtich opened this issue Apr 18, 2024 · 0 comments
Open

Write output to stdout #683

nichtich opened this issue Apr 18, 2024 · 0 comments

Comments

@nichtich
Copy link

Is your feature request related to a problem? Please describe.

SVG output should be pipe-able.

Describe the solution you'd like

mmdc -i input.mmd -o - # emit SVG by default
mmdc -i input.mmd -e pdf -o - # emit PDF (if possible, I only need SVG)

Describe alternatives you've considered

I tried process substitution:

mmdc -i input.mmd -o >( tee output.svg )

but mmdc complains because the temporary output file in /dev/fd lacks file extension.

Manually creating a named pipe with mkfifo works, but this requires a more complex bash script:

mkfifo tmp.svg
cat tmp.svg | tee output.svg
mmdc -i input.mmd -o tmp.svg
rm tmp.svg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant