Elixir has some markdown libraries. I believe ex_doc (which is currently used for building OTP documentation) uses this library GitHub - pragdave/earmark: Markdown parser for Elixir
Calling Elixir from Erlang is not super trivial and Elixir, from what I know, heavily relies on its own build system. So while it’s technically possible to run this library in the same BEAM VM with your other code, and maybe even include it in the common release, I’m not sure it will be easier than os:cmd("pandoc ...").