If my app has a string that's in markdown, '## Hello'
, can I use pandoc to convert it to HTML directly? I don't want to write it to a file first, but all of the documentation and examples I can find shows files.
I want to do something like this: pandoc -f markdown -t html '## Hello'
.
Is this possible?
Note: I'm using a pandoc-bin which is a node wrapper. I don't think this effects my question as the library seems to wrap the original syntax.
In Posix-Shell (using Here String):
$ pandoc -f markdown -t html <<< "# Hello"
<h1 id="hello">Hello</h1>
In Bash (using Process Substitution):
$ pandoc -f markdown -t html <(echo "# Hello")
<h1 id="hello">Hello</h1>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With