2007-07-16 18:30:04 +02:00
|
|
|
% Installing pandoc
|
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
Installing pandoc from Source
|
|
|
|
=============================
|
2006-10-29 20:58:20 +01:00
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
This method will work on all architectures for which the GHC compiler
|
|
|
|
is available.
|
2007-08-26 17:34:56 +02:00
|
|
|
|
|
|
|
Installing GHC
|
|
|
|
--------------
|
2006-10-29 20:58:20 +01:00
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
To compile Pandoc, you'll need [GHC] version 6.8 or greater. If you
|
|
|
|
don't have GHC already, you can get it from the [GHC Download] page.
|
|
|
|
If you're compiling GHC from source, be sure to get the `extralibs`
|
|
|
|
in addition to the base tarball. Pandoc requires Cabal version 1.2 or
|
|
|
|
greater. If your GHC comes with an older version of Cabal, you'll need
|
|
|
|
to to [install Cabal] separately. You can check your Cabal version using
|
|
|
|
`ghc-pkg list`.
|
2006-10-29 20:58:20 +01:00
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
If you're running MacOS X, you can also install GHC using [MacPorts] or [Fink].
|
2008-01-16 19:22:18 +01:00
|
|
|
|
|
|
|
If you're on a [debian]-based linux system (such as [Ubuntu]), you can get
|
2008-09-06 20:33:39 +02:00
|
|
|
GHC and some required libraries using `apt-get`:
|
2008-01-16 19:22:18 +01:00
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
sudo apt-get install ghc6 libghc6-xhtml-dev libghc6-mtl-dev libghc6-network-dev
|
2008-01-16 19:22:18 +01:00
|
|
|
|
2006-10-29 20:58:20 +01:00
|
|
|
[GHC]: http://www.haskell.org/ghc/
|
|
|
|
[GHC Download]: http://www.haskell.org/ghc/download.html
|
2008-07-11 01:26:18 +02:00
|
|
|
[Cabal]: http://www.haskell.org/cabal/
|
|
|
|
[install Cabal]: http://www.haskell.org/cabal/download.html
|
2007-07-16 18:30:04 +02:00
|
|
|
[MacPorts]: http://macports.org
|
|
|
|
[Fink]: http://finkproject.org
|
2008-01-16 19:22:18 +01:00
|
|
|
[Ubuntu]: http://www.ubuntu.com
|
|
|
|
[debian]: http://www.debian.org/
|
2006-10-29 20:58:20 +01:00
|
|
|
|
2008-09-06 20:33:39 +02:00
|
|
|
Installing prerequisites
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
Pandoc needs the `utf8-string` and `zip-archive` to compile.
|
|
|
|
Check your packaging system to see if they are included.
|
|
|
|
If not, you will need to compile them from source.
|
|
|
|
|
|
|
|
On \*nix systems, the easiest way to do this is to install
|
|
|
|
the [cabal-install] tool. See the section [Quick Installation
|
2008-09-12 02:05:37 +02:00
|
|
|
on Unix] for instructions. If you use [MacPorts], you can
|
|
|
|
just install the `hs-cabal` port.
|
2008-09-06 20:33:39 +02:00
|
|
|
|
|
|
|
[cabal-install]: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall
|
|
|
|
[Quick Installation on Unix]: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall#QuickInstallationonUnix
|
|
|
|
|
|
|
|
Once you've got `cabal-install` installed, you can install the
|
|
|
|
needed libraries by doing
|
|
|
|
|
|
|
|
cabal install utf8-string
|
|
|
|
cabal install zip-archive
|
|
|
|
|
|
|
|
Alternatively, you can install these libraries using the [standard
|
|
|
|
Cabal method], but you will have to install their dependencies manually.
|
|
|
|
|
|
|
|
[standard Cabal method]: http://haskell.org/haskellwiki/Cabal/How_to_install_a_Cabal_package
|
|
|
|
|
2007-08-26 17:34:56 +02:00
|
|
|
Getting the source
|
|
|
|
------------------
|
2006-10-29 20:58:20 +01:00
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
Download the source tarball from [pandoc's google code site].
|
2007-08-26 17:34:56 +02:00
|
|
|
Extract the contents into a subdirectory:
|
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
tar xvzf pandoc-x.y.tar.gz
|
2006-10-29 20:58:20 +01:00
|
|
|
|
2007-08-26 17:34:56 +02:00
|
|
|
[pandoc's google code site]: http://pandoc.googlecode.com
|
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
Now choose one of the following methods for compiling and installing
|
|
|
|
pandoc. If you are on a linux or unix-based system, you can [install
|
|
|
|
pandoc using Make]. If not, you should [install pandoc using Cabal].
|
|
|
|
|
|
|
|
[install pandoc using Make]: #installing-pandoc-using-make
|
|
|
|
[install pandoc using Cabal]: #installing-pandoc-using-cabal
|
|
|
|
[build options]: #build-options
|
|
|
|
|
|
|
|
Installing Pandoc using Make
|
|
|
|
----------------------------
|
2006-10-29 20:58:20 +01:00
|
|
|
|
|
|
|
1. Change to the directory containing the Pandoc distribution.
|
|
|
|
|
|
|
|
2. Compile:
|
|
|
|
|
|
|
|
make
|
|
|
|
|
2006-11-19 22:24:33 +01:00
|
|
|
If you get "Unknown modifier" errors, it is probably because `make`
|
|
|
|
on your system is not [GNU `make`]. Try using `gmake` instead.
|
|
|
|
|
2008-09-06 20:33:39 +02:00
|
|
|
If you get a message saying that the `zip-archive` or `utf8-string`
|
|
|
|
libraries cannot be found, and you have installed these using
|
|
|
|
`cabal-install`, it is probably because by default `cabal-install`
|
|
|
|
installs libraries to the user's directory rather than globally.
|
|
|
|
Try again with
|
|
|
|
|
|
|
|
CABALOPTS=--user make
|
|
|
|
|
2006-10-29 20:58:20 +01:00
|
|
|
3. See if it worked (optional, but recommended):
|
|
|
|
|
|
|
|
make test
|
|
|
|
|
|
|
|
4. Install:
|
|
|
|
|
2006-11-07 07:17:56 +01:00
|
|
|
sudo make install
|
2006-10-29 20:58:20 +01:00
|
|
|
|
|
|
|
Note: This installs `pandoc`, together with its wrappers and
|
2007-01-04 02:23:07 +01:00
|
|
|
documentation, into the `/usr/local` directory. If you'd rather
|
|
|
|
install `pandoc` somewhere else--say, in `/opt/local`--you can
|
|
|
|
set the `PREFIX` environment variable:
|
|
|
|
|
|
|
|
PREFIX=/opt/local sudo make install
|
|
|
|
|
|
|
|
If you don't have root privileges or would prefer to install
|
|
|
|
`pandoc` and the associated wrappers into your `~/bin` directory,
|
|
|
|
type this instead:
|
2006-10-29 20:58:20 +01:00
|
|
|
|
|
|
|
PREFIX=~ make install-exec
|
|
|
|
|
2006-11-07 07:17:56 +01:00
|
|
|
5. Build and install the Haskell libraries and library
|
2007-01-04 02:23:07 +01:00
|
|
|
documentation (optional--for Haskell programmers only):
|
2006-10-29 20:58:20 +01:00
|
|
|
|
2006-11-07 07:17:56 +01:00
|
|
|
make build-all
|
|
|
|
sudo make install-all
|
2006-10-29 20:58:20 +01:00
|
|
|
|
2007-07-16 18:30:04 +02:00
|
|
|
Note that building the library documentation requires [haddock].
|
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
6. If you decide you don't want pandoc on your system, each of the
|
|
|
|
installation steps described above can be reversed:
|
|
|
|
|
|
|
|
sudo make uninstall
|
|
|
|
|
|
|
|
PREFIX=~ make uninstall-exec
|
|
|
|
|
|
|
|
sudo make uninstall-all
|
|
|
|
|
2007-07-16 18:30:04 +02:00
|
|
|
[haddock]: http://www.haskell.org/haddock/
|
|
|
|
|
2008-02-09 04:21:44 +01:00
|
|
|
Installing pandoc using Cabal
|
|
|
|
-----------------------------
|
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
Change to the directory containing the pandoc source, and type:
|
2008-02-09 04:21:44 +01:00
|
|
|
|
2008-09-13 01:10:28 +02:00
|
|
|
runhaskell Setup configure # add --user if you have installed prerequisites
|
|
|
|
# locally using cabal-install
|
|
|
|
runhaskell Setup build
|
|
|
|
runhaskell Setup haddock # optional, to build library documentation
|
|
|
|
runhaskell Setup test # optional, to run test suite
|
|
|
|
runhaskell Setup install # this one as root or sudo, or add --user
|
2008-02-09 04:21:44 +01:00
|
|
|
|
|
|
|
This will install the pandoc executable and the Haskell libraries,
|
|
|
|
but not the shell scripts, man pages, or other documentation.
|
|
|
|
|
2008-08-01 01:16:12 +02:00
|
|
|
You may just want the executable, or just the libraries. This
|
|
|
|
can be controlled with configuration flags (the `-` negates the
|
|
|
|
flag):
|
|
|
|
|
2008-09-13 01:10:28 +02:00
|
|
|
runhaskell Setup configure -f-library # just the executable
|
|
|
|
runhaskell Setup configure -f-executable # just the libraries
|
2008-08-01 01:16:12 +02:00
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
You can also specify the directory tree into which pandoc will be
|
|
|
|
installed using the `--prefix=` option to `configure`. For more details,
|
|
|
|
see the [Cabal User's Guide].
|
2008-02-09 04:21:44 +01:00
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
[Cabal User's Guide]: http://www.haskell.org/cabal/release/latest/doc/users-guide/builders.html#setup-configure-paths
|
2008-02-09 04:21:44 +01:00
|
|
|
|
|
|
|
Optional syntax highlighting support
|
|
|
|
------------------------------------
|
|
|
|
|
|
|
|
Pandoc can optionally be compiled with support for syntax highlighting of
|
|
|
|
delimited code blocks. This feature requires the [`highlighting-kate` library].
|
|
|
|
If you are using Cabal to compile pandoc, specify the `highlighting` flag in
|
|
|
|
the configure step:
|
|
|
|
|
2008-09-13 01:10:28 +02:00
|
|
|
runhaskell Setup configure -fhighlighting
|
2008-02-09 04:21:44 +01:00
|
|
|
|
|
|
|
If you are using the Makefile:
|
|
|
|
|
|
|
|
CABALOPTS=-fhighlighting make
|
|
|
|
|
|
|
|
If you have already built pandoc, you may need to do a `make clean` or
|
2008-09-13 01:10:28 +02:00
|
|
|
`runhaskell Setup clean` first.
|
2008-02-09 04:21:44 +01:00
|
|
|
|
|
|
|
[`highlighting-kate` library]: http://johnmacfarlane.net/highlighting-kate
|
|
|
|
|
2008-09-13 22:23:23 +02:00
|
|
|
Optional citeproc support
|
|
|
|
-------------------------
|
|
|
|
|
|
|
|
Pandoc can optionally be compiled with support for bibliographic citations
|
|
|
|
using Andrea Rossato's [`citeproc-hs` library]. This allows you
|
|
|
|
to specify citations in markdown using an intuitive syntax (for example,
|
|
|
|
`[jones2005@p. 3; smith2006]`). These are automatically changed into
|
|
|
|
appropriately styled citations in the output, and a bibliography is
|
|
|
|
added. The bibliography data and style information are taken from XML
|
|
|
|
files that must be specified on the command line. (Note: `citeproc-hs`
|
|
|
|
support is experimental, and the interface may change in the future.)
|
|
|
|
|
|
|
|
If you are using Cabal to compile pandoc, specify the `citeproc` flag in
|
|
|
|
the configure step:
|
|
|
|
|
|
|
|
runhaskell Setup configure -fciteproc
|
|
|
|
|
|
|
|
If you are using the Makefile:
|
|
|
|
|
|
|
|
CABALOPTS=-fciteproc make
|
|
|
|
|
|
|
|
If you have already built pandoc, you may need to do a `make clean` or
|
|
|
|
`runhaskell Setup clean` first.
|
|
|
|
|
|
|
|
[`citeproc-hs` library]: http://code.haskell.org/citeproc-hs/
|
|
|
|
|
2007-08-26 17:34:56 +02:00
|
|
|
Other targets
|
|
|
|
-------------
|
2006-12-31 20:12:53 +01:00
|
|
|
|
|
|
|
The following 'make' targets should not be needed by the average user,
|
|
|
|
but are documented here for packagers and developers:
|
|
|
|
|
2007-08-26 17:34:56 +02:00
|
|
|
### Building and installing
|
2006-12-31 20:12:53 +01:00
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
* `configure`:
|
2006-12-31 20:12:53 +01:00
|
|
|
- Stores values of relevant environment variables in `vars` for
|
|
|
|
persistence.
|
|
|
|
- Runs Cabal's "configure" command.
|
|
|
|
* `build-exec`: Builds `pandoc` executable (using Cabal's "build"
|
2008-08-10 19:34:02 +02:00
|
|
|
command).
|
2006-12-31 20:12:53 +01:00
|
|
|
* `build-doc`: Builds program documentation (e.g. `README.html`).
|
|
|
|
* `build-lib-doc`: Builds Haddock documentation for Pandoc libraries.
|
|
|
|
* `install-doc`, `uninstall-doc`: Installs/uninstalls user documentation
|
|
|
|
and man pages.
|
|
|
|
* `install-lib-doc`, `uninstall-lib-doc`: Installs/uninstalls library
|
|
|
|
documentation and man pages.
|
|
|
|
* `install-exec`, `uninstall-exec`: Installs/uninstalls programs
|
|
|
|
(`pandoc` and wrappers).
|
|
|
|
|
2007-08-26 17:34:56 +02:00
|
|
|
### Testing
|
2006-12-31 20:12:53 +01:00
|
|
|
|
|
|
|
* `test`: Runs Pandoc's test suite. (All tests should pass.)
|
|
|
|
* `test-markdown`: Runs the Markdown regression test suite, using
|
2008-08-08 02:11:58 +02:00
|
|
|
`pandoc --strict`. (One test will fail.)
|
2006-12-31 20:12:53 +01:00
|
|
|
|
2007-08-26 17:34:56 +02:00
|
|
|
### Cleaning
|
2006-12-31 20:12:53 +01:00
|
|
|
|
|
|
|
* `clean`: Restores directory to pre-build state, removing generated files.
|
|
|
|
* `distclean`: Like clean, but also cleans up files created by `make deb`.
|
|
|
|
|
2007-08-26 17:34:56 +02:00
|
|
|
### Packaging
|
2006-12-31 20:12:53 +01:00
|
|
|
|
2007-07-16 18:30:04 +02:00
|
|
|
* `tarball`: Creates a source tarball for distribution.
|
2007-08-25 18:52:42 +02:00
|
|
|
* `macport`: Creates MacPorts Portfile in `macports` directory.
|
2007-08-25 19:35:53 +02:00
|
|
|
* `freebsd`: Creates freebsd Makefile and distinfo in `freebsd` directory.
|
2006-12-31 20:12:53 +01:00
|
|
|
* `win-pkg`: Creates a Windows binary package (presupposes `pandoc.exe`,
|
|
|
|
which must be created by building Pandoc on a Windows machine).
|
|
|
|
* `website`: Creates Pandoc's website in `web/pandoc` directory.
|
|
|
|
|
2007-08-26 17:34:56 +02:00
|
|
|
Installing pandoc using MacPorts
|
|
|
|
================================
|
|
|
|
|
|
|
|
This is an alternative to compiling from source on MacOS X.
|
|
|
|
[MacPorts] is a system for building and maintaining \*nix software
|
|
|
|
on MacOS X computers. If you don't already have MacPorts, follow
|
|
|
|
[these instructions for installing
|
|
|
|
it](http://trac.macosforge.org/projects/macports/wiki/InstallingMacPorts).
|
|
|
|
|
2007-08-28 00:18:36 +02:00
|
|
|
Once you've installed MacPorts, you can install pandoc by typing:
|
2007-08-26 17:34:56 +02:00
|
|
|
|
2007-08-28 00:18:36 +02:00
|
|
|
sudo port sync # to get the most recent ports
|
2007-08-26 17:34:56 +02:00
|
|
|
sudo port install pandoc
|
|
|
|
|
2007-08-28 00:18:36 +02:00
|
|
|
Since pandoc depends on GHC, the process may take a long time.
|
2007-08-26 17:34:56 +02:00
|
|
|
|
2008-09-12 22:12:51 +02:00
|
|
|
Note that the version of pandoc in MacPorts may not be the most recent.
|
2008-09-14 20:11:00 +02:00
|
|
|
To get the most recent version, you can use `cabal-install`:
|
|
|
|
|
|
|
|
sudo port install hs-cabal
|
|
|
|
cabal install pandoc --user # optionally: -fciteproc -fhighlighting
|
|
|
|
|
|
|
|
This will install the `pandoc` executable into `~/.cabal/bin`. This method
|
|
|
|
will not install the wrapper scripts or man pages; if you want those, follow
|
|
|
|
the instructions above for compiling from source.
|
2008-09-12 22:12:51 +02:00
|
|
|
|
2007-08-26 17:34:56 +02:00
|
|
|
Installing the Windows binary
|
|
|
|
=============================
|
|
|
|
|
2008-09-12 22:12:51 +02:00
|
|
|
Simply download the Windows installer [pandoc's google code site]
|
|
|
|
and run it. It will install `pandoc.exe` and ensure that it is
|
|
|
|
in your system PATH.
|
2007-08-26 17:34:56 +02:00
|
|
|
|
|
|
|
Note that the Windows binary distribution does not include the shell
|
2008-08-08 02:11:58 +02:00
|
|
|
scripts `markdown2pdf`, `html2markdown`, or `hsmarkdown`.
|
2007-08-26 17:34:56 +02:00
|
|
|
|
|
|
|
Installing pandoc on Debian
|
|
|
|
===========================
|
|
|
|
|
2008-08-08 02:11:58 +02:00
|
|
|
Pandoc is now in the debian archives, and can be installed using `apt-get` (as root):
|
2007-08-26 17:34:56 +02:00
|
|
|
|
2007-08-28 00:18:36 +02:00
|
|
|
apt-get install pandoc # the program, shell scripts, and docs
|
|
|
|
apt-get install libghc6-pandoc-dev # the libraries
|
|
|
|
apt-get install pandoc-doc # library documentation
|
2007-08-26 17:34:56 +02:00
|
|
|
|
2007-08-28 00:18:36 +02:00
|
|
|
Thanks to Recai Oktaş for setting up the debian packages.
|
2007-08-26 17:34:56 +02:00
|
|
|
|
2008-09-12 22:12:51 +02:00
|
|
|
Note that the version of pandoc in Debian may not be the most recent.
|
|
|
|
|
2007-08-26 17:34:56 +02:00
|
|
|
Installing pandoc on FreeBSD
|
|
|
|
============================
|
|
|
|
|
|
|
|
Pandoc is in the FreeBSD ports repository (`textproc/pandoc`) and can be
|
|
|
|
installed in the normal way:
|
|
|
|
|
|
|
|
cd /usr/ports/textproc/pandoc
|
|
|
|
make install clean # as root
|
|
|
|
|
|
|
|
Alternatively, you can use `pkg_add`:
|
|
|
|
|
|
|
|
pkg_add -r pandoc
|
|
|
|
|
|
|
|
Note that the version of pandoc in FreeBSD's official repository may be
|
|
|
|
somewhat older than the most recent version.
|
|
|
|
|
2008-01-14 06:12:16 +01:00
|
|
|
Installing pandoc on Arch linux
|
|
|
|
===============================
|
|
|
|
|
2008-09-14 20:19:24 +02:00
|
|
|
There are two `pandoc` packages in the Arch AUR repositories,
|
|
|
|
`pandoc` (contributed by Abhishek Dasgupta) and `haskell-pandoc`
|
|
|
|
(contributed by Dons Stewart). `haskell-pandoc` is more up-to-date,
|
|
|
|
but does not install the man pages or wrapper scripts.
|
2008-01-14 06:12:16 +01:00
|
|
|
|
|
|
|
pacman -Sy pandoc
|
2008-09-14 20:19:24 +02:00
|
|
|
pacman -Sy haskell-pandoc
|
2008-01-14 06:12:16 +01:00
|
|
|
|