git.iko.soy/typeable/pandoc
on pseudopod help sign in
132 lines 4.0 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 This procedure will install the released version of pandoc,
19 which will be downloaded automatically from HackageDB.
20 If you want to install a modified or development version
21 of pandoc instead, switch to the source directory and do
22 as above, but without the 'pandoc':
24 cabal install
263. Make sure the `$CABALDIR/bin` directory is in your path. You should
27now be able to run `pandoc`:
29 pandoc --help
314. Make sure the `$CABALDIR/share/man/man1` directory is in your `MANPATH`.
32You should now be able to access the `pandoc` man page:
34 man pandoc
36[GHC]: http://www.haskell.org/ghc/
37[Haskell platform]: http://hackage.haskell.org/platform/
38[cabal-install]: http://hackage.haskell.org/trac/hackage/wiki/CabalInstall
40Custom install
41--------------
43This is a step-by-step procedure that offers maximal control
44over the build and installation. Most users should use the
45quick install, but this information may be of use to packagers.
46For more details, see the [Cabal User's Guide].
481. Install dependencies: in addition to the [Haskell platform],
49you will need [zip-archive], [blaze-html], and [highlighting-kate].
512. Configure:
53 runghc Setup.hs configure --prefix=DIR --bindir=DIR --libdir=DIR \
54 --datadir=DIR --libsubdir=DIR --datasubdir=DIR --docdir=DIR \
55 --htmldir=DIR --program-prefix=PREFIX --program-suffix=SUFFIX \
56 --mandir=DIR --flags=FLAGSPEC
58 All of the options have sensible defaults that can be overridden
59 as needed.
61 `FLAGSPEC` is a list of Cabal configuration flags, optionally
62 preceded by a `-` (to force the flag to `false`), and separated
63 by spaces. Pandoc's flags include:
65 - `executable`: build the pandoc executable (default yes)
66 - `library`: build the pandoc library (default yes)
68 So, for example,
70 --flags="-executable"
72 tells Cabal to build the library but not the executables,
73 and to compile with syntax highlighting support.
753. Build:
77 runghc Setup.hs build
794. Build API documentation:
81 runghc Setup.hs haddock --html-location=URL --hyperlink-source
835. Copy the files:
85 runghc Setup.hs copy --destdir=PATH
87 The default destdir is `/`.
896. Register pandoc as a GHC package:
91 runghc Setup.hs register
93 Package managers may want to use the `--gen-script` option to
94 generate a script that can be run to register the package at
95 install time.
97Creating a relocatable Windows binary
98-------------------------------------
100On Windows it is possible to compile pandoc such that it
101(and its data files) are "relocatable." You can put the relocatable
102binary in any directory (even on a USB drive), and it will look for its
103data files there.
105 cabal install --flags="embed_data_files" citeproc-hs
106 cabal install --flags="executable -library" --datasubdir=
108You can find `pandoc.exe` in `dist/build/pandoc`. Copy this wherever
109you please, and copy the following data files to the same place:
111 README
112 COPYRIGHT
113 COPYING
114 reference.odt
115 reference.docx
116 epub.css
117 default.csl
118 templates/
119 data/
120 s5/
121 slidy/
122 dzslides/
123 pcre-license.txt
124 pcre3.dll
126This is essentially what the binary installer does.
128[zip-archive]: http://hackage.haskell.org/package/zip-archive
129[highlighting-kate]: http://hackage.haskell.org/package/highlighting-kate
130[blaze-html]: http://hackage.haskell.org/package/blaze-html
131[Cabal User's Guide]: http://www.haskell.org/cabal/release/latest/doc/users-guide/builders.html#setup-configure-paths