markdown-pdf
markdown-pdf copied to clipboard
STDIN support in CLI interface
I think it would be a nice addition to support standard input in CLI as an easy way to automate PDF generation with shell scripts. Would it be easy to implement?
Should be, the markdown-pdf module is a through stream so you should be able to pipe in and out:
process.stdin.pipe(markdownpdf()).pipe(process.stdout)
I'd definitely accept a pull request to the CLI that implements this!
echo "# Some markdown\nYay" | markdown-pdf
Zshell workaround:
markdown-pdf -o output.pdf <(echo "# Some markdown\nYay")
It's not stdin, but it does stream and doesn't hit disk.