Panpipe.Pandoc.call
You're seeing just the function
call
, go back to Panpipe.Pandoc module for more information.
Calls the pandoc
command.
For a description of the arguments refer to the Pandoc User’s Guide.
You can provide any of Pandoc's supported options in their long form without the leading double dashes and all other dashes replaced by underscores.
Other than that, the only difference are a couple of default values:
- Input is provided either directly as a string of content as the first argument
or via the
input
option when it is a path to a file - Extensions for the input and output format can be specified by providing a
tuple with the format and either a list of extensions to be enabled or a map
with the keys
enable
anddisable
. - Flag options must provide a
true
value, eg. thestandalone
option can be set with the optionstandalone: true
Examples
iex> "# A Markdown Document\nLorem ipsum" |> Panpipe.Pandoc.call()
{:ok, ~s[<h1 id="a-markdown-document">A Markdown Document</h1>\n<p>Lorem ipsum</p>\n]}
iex> "# A Markdown Document\n..." |> Panpipe.Pandoc.call(output: "test/output/example.html")
{:ok, nil}
iex> Panpipe.Pandoc.call(input: "test/fixtures/example.md")
{:ok, ~s[<h1 id="a-markdown-document">A Markdown Document</h1>\n<p>Lorem ipsum</p>\n]}
iex> Panpipe.Pandoc.call(input: "test/fixtures/example.md", output: "test/output/example.html")
{:ok, nil}