View Source Pandoc (pandoc v0.3.2)
Pandoc is an installer, runner and watcher for pandoc.
Profiles
You can define multiple pandoc profiles. By default, there is a profile
called :default
which you can configure its args, current directory and
environment. You can make the args dynamic by defining a function.
config :pandoc,
version: "3.6.1",
default: [
args: fn extra_args ->
{_, [input_file], _} = OptionParser.parse(extra_args, switches: [])
~w(--output=../priv/static/posts/#{Path.rootname(input_file)}.html)
end,
cd: Path.expand("../documents", __DIR__)
]
Pandoc configuration
There are four global configurations for the pandoc application:
:version
- the expected pandoc version:version_check
- whether to perform the version check or not. Useful when you manage the pandoc executable with an external tool:cacerts_path
- the directory to find certificates for https connections:path
- the path to find the pandoc executable at. By default, it is automatically downloaded and placed inside the_build
directory of your current app
Overriding the :path
is not recommended, as we will automatically download
and manage pandoc
for you. But in case you can't download it, you may want
to set the :path
to a configurable system location.
Summary
Functions
Returns the path to the executable.
Returns the version of the pandoc executable.
Returns the configuration for the given profile.
Returns the configured pandoc version.
The default URL to install Pandoc from.
Installs pandoc with configured_version/0
.
Installs, if not available, and then runs pandoc
.
Runs the given command with args
.
Starts a file system watcher that runs the given command with args
when a
file event is received for a file that matches the given pattern.
Functions
Returns the path to the executable.
The executable may not be available if it was not yet installed.
Returns the version of the pandoc executable.
Returns {:ok, version_string}
on success or :error
when the executable
is not available.
Returns the configuration for the given profile.
Returns nil if the profile does not exist.
Returns the configured pandoc version.
The default URL to install Pandoc from.
Installs pandoc with configured_version/0
.
If invoked concurrently, this task will perform concurrent installs.
Installs, if not available, and then runs pandoc
.
This task may be invoked concurrently and it will avoid concurrent installs.
Returns the same as run/2
.
Runs the given command with args
.
The given args will be appended to the configured args. The task output will be streamed directly to stdio. It returns the status of the underlying call.
Starts a file system watcher that runs the given command with args
when a
file event is received for a file that matches the given pattern.
The given args will be appended to the configured args. The task output will be streamed directly to stdio.