Panpipe.Pandoc (Panpipe v0.3.0) View Source
Wrapper around the pandoc
CLI.
See the Pandoc Manual.
Link to this section Summary
Functions
The Pandoc API version against which Panpipe operates.
Returns the Pandoc AST of the input.
Calls ast/2
and delivers the result directly in success case, otherwise raises an error.
Calls the pandoc
command.
Calls call/2
and delivers the result directly in success case, otherwise raises an error.
The data directory of the Pandoc runtime Panpipe is using.
The list of available Pandoc extension.
The list of languages for which Pandoc supports syntax highlighting in code blocks.
The list of highlighting styles supported by Pandoc.
The list of input formats supported by Pandoc.
The list of output formats supported by Pandoc.
The version of the Pandoc runtime Panpipe is using.
Link to this section Functions
The Pandoc API version against which Panpipe operates.
This version will be used in the generated Pandoc documents.
Returns the Pandoc AST of the input.
Calls ast/2
and delivers the result directly in success case, otherwise raises an error.
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}
Calls call/2
and delivers the result directly in success case, otherwise raises an error.
The data directory of the Pandoc runtime Panpipe is using.
The list of available Pandoc extension.
The list of languages for which Pandoc supports syntax highlighting in code blocks.
The list of highlighting styles supported by Pandoc.
The list of input formats supported by Pandoc.
The list of output formats supported by Pandoc.
The version of the Pandoc runtime Panpipe is using.