git.iko.soy/typeable/pandoc
on 1.5 help sign in
129 lines 4.4 kB history raw
1% Installing pandoc
3These instructions explain how to install pandoc from source.
4Binary packages or ports of pandoc are available for freebsd
5and several linux distributions, so check your package manager.
6There is also a Windows installer.
8Quick install
9-------------
111. Install the [Haskell platform]. This will give you [GHC] and
12the [cabal-install] build tool.
142. Use `cabal` to install pandoc and its dependencies:
16 cabal install pandoc
18 If you want support for source code syntax highlighting, set
19 the `highlighting` flag:
21 cabal install -fhighlighting pandoc
23 This procedure will install the released version of pandoc,
24 which will be downloaded automatically from HackageDB.
25 If you want to install a modified or development version
26 of pandoc instead, switch to the source directory and do
27 as above, but without the 'pandoc':
29 cabal install
313. Make sure the `$CABALDIR/bin` directory is in your path. You should
32now be able to run `pandoc`:
34 pandoc --help
364. Make sure the `$CABALDIR/share/man/man1` directory is in your `MANPATH`.
37You should now be able to access the `pandoc` man page:
39 man pandoc
41[GHC]: http://www.haskell.org/ghc/
42[Haskell platform]: http://hackage.haskell.org/platform/
43[cabal-install]: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall
45Custom install
46--------------
48This is a step-by-step procedure that offers maximal control
49over the build and installation. Most users should use the
50quick install, but this information may be of use to packagers.
51For more details, see the [Cabal User's Guide].
531. Install dependencies: in addition to the [Haskell platform],
54you will need [zip-archive] and (if you want syntax highlighting)
55[highlighting-kate].
572. Configure:
59 runghc Setup.hs configure --prefix=DIR --bindir=DIR --libdir=DIR \
60 --datadir=DIR --libsubdir=DIR --datasubdir=DIR --docdir=DIR \
61 --htmldir=DIR --program-prefix=PREFIX --program-suffix=SUFFIX \
62 --mandir=DIR --flags=FLAGSPEC
64 All of the options have sensible defaults that can be overridden
65 as needed.
67 `FLAGSPEC` is a list of Cabal configuration flags, optionally
68 preceded by a `-` (to force the flag to `false`), and separated
69 by spaces. Pandoc's flags include:
71 - `library`: build the library (default yes)
72 - `executable`: build the pandoc executable (default yes)
73 - `wrappers`: build the wrappers `markdown2pdf` and `hsmarkdown`
74 (default yes)
75 - `highlighting`: compile with syntax highlighting support (increases
76 the size of the executable) (default no)
78 So, for example,
80 --flags="-library highlighting"
82 tells Cabal to build the executable but not the library, and to
83 compile with syntax highlighting support.
853. Build:
87 runghc Setup.hs build
894. Build API documentation:
91 runghc Setup.hs haddock --html-location=URL --hyperlink-source
935. Copy the files:
95 runghc Setup.hs copy --destdir=PATH
97 The default destdir is `/`.
996. Register pandoc as a GHC package:
101 runghc Setup.hs register
103 Package managers may want to use the `--gen-script` option to
104 generate a script that can be run to register the package at
105 install time.
107[zip-archive]: http://hackage.haskell.org/package/zip-archive
108[highlighting-kate]: http://hackage.haskell.org/package/highlighting-kate
109[Cabal User's Guide]: http://www.haskell.org/cabal/release/latest/doc/users-guide/builders.html#setup-configure-paths
111Optional citeproc support
112-------------------------
114Pandoc can optionally be compiled with support for bibliographic citations
115using Andrea Rossato's [`citeproc-hs` library]. This allows you
116to specify citations in markdown using an intuitive syntax (for example,
117`[jones2005@p. 3; smith2006]`). These are automatically changed into
118appropriately styled citations in the output, and a bibliography is
119added. The bibliography data and style information are taken from XML
120files that must be specified on the command line. (Note: `citeproc-hs`
121support is experimental, and the interface may change in the future.)
123If you are using Cabal to compile pandoc, specify the `citeproc` flag in
124the configure step:
126 runhaskell Setup configure --flags="citeproc"
128[`citeproc-hs` library]: http://code.haskell.org/citeproc-hs/