Pandoc::Release - get pandoc releases from GitHub
From command line:
# print latest release name perl -MPandoc::Release -E 'say latest->{name}' # download latest release unless already in ~/.pandoc/bin perl -MPandoc::Release -E 'latest->download'
In Perl code:
use Pandoc::Release; my $release = get('2.1.3'); # get a specific release my $latest = latest; # get a latest release # get multiple releases my @releases = list( since => '2.0', verbose => 1 ); foreach my $release (@releases) { # print version number say $release->{tag_name}; # download Debian package and executable $release->download( dir => './deb', bin => './bin' ); } # download executable and use as temporary Pandoc object: my $pandoc = get('2.1.3)->download( bin => './bin' );
This utility module fetches information about pandoc releases via GitHub API. It requires at least Perl 5.14 or HTTP::Tiny and JSON::PP installed.
All functions are exported by default.
Get a specific release by its version or die if the given version does not exist. Returns data as returned by GitHub releases API: https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name.
Get a list of all pandoc releases, optionally since some version or within a version range such as !=1.16, <=1.17 or ==2.1.2. See "Version Ranges" in CPAN::Meta::Spec for possible values. Option verbose will print URLs before each request. Option limit limits the maximum number of releases to be returned.
since
range
!=1.16, <=1.17
==2.1.2
verbose
limit
Get the latest release, optionally since some version or within a version range. Equivalent to method list with option limit => 1.
list
limit => 1
Download the Debian release file for some architecture (e.g. amd64) to directory dir, unless already there. By default architecture is determined via calling dpkg and download directory is a newly created temporary directory. Pandoc executables is then extracted to directory bin named by pandoc version number (e.g. pandoc-2.1.2). The default bin directory is ~/.pandoc/bin on Unix (see Pandoc function pandoc_data_dir):
amd64
dir
dpkg
bin
pandoc-2.1.2
~/.pandoc/bin
pandoc_data_dir
$release->download( bin => pandoc_data_dir('bin') ); $release->download; # equivalent
Extraction of executables can be disabled by setting bin to a false value. Returns a Pandoc instance if bin is not false or Pandoc::Version otherwise.
https://developer.github.com/v3/repos/releases/
To install Pandoc, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pandoc
CPAN shell
perl -MCPAN -e shell install Pandoc
For more information on module installation, please visit the detailed CPAN module installation guide.