pandoc/INSTALL
fiddlosopher 59065c103f Modified HTML writer to use the Text.XHtml library. This results
in cleaner, faster code, and it makes it easier to use Pandoc in
other projects, like wikis, that use Text.XHtml.  Two functions
are now provided, writeHtml and writeHtmlString:  the former outputs
an Html structure, the latter a rendered string.  The S5 writer is
also changed, in parallel ways (writeS5, writeS5String).  The Html
header is now written programmatically, so it has been removed from
the 'headers' directory.  The S5 header is still needed, but the
doctype and some of the meta declarations have been removed, since
they are written programatically.  The INSTALL file and cabalize
have been updated to reflect the new dependency on the xhtml package.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@549 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-26 19:08:10 +00:00

137 lines
4.6 KiB
Text

% Installing Pandoc
# Installing GHC
To compile Pandoc, you'll need [GHC] version 6.4 or greater. If
you don't have GHC already, you can get it from the [GHC Download]
page.
[GHC]: http://www.haskell.org/ghc/
[GHC Download]: http://www.haskell.org/ghc/download.html
If you're using GHC 6.4, you'll also need to install the
[Text.XHtml] library. This library is included in the standard
hierarchical libraries in GHC 6.6.
[Text.XHtml]: http://www.cs.chalmers.se/~bringert/darcs/haskell-xhtml/doc/
You'll also need standard build tools: [GNU `make`], `sed`, `bash`,
and `perl`. These are standard on unix systems (including MacOS
X). If you're using Windows, you can install [Cygwin].
[Cygwin]: http://www.cygwin.com/
[GNU `make`]: http://www.gnu.org/software/make/
# Installing Pandoc
1. Change to the directory containing the Pandoc distribution.
2. Compile:
make
If you get "Unknown modifier" errors, it is probably because `make`
on your system is not [GNU `make`]. Try using `gmake` instead.
3. See if it worked (optional, but recommended):
make test
If you want to try `pandoc` before installing it (the next step),
run it with a `./` prefix, as follows:
./pandoc README
If you want to try the shell scripts (`hsmarkdown`, `html2markdown`,
and `markdown2pdf`) before installing `pandoc`, you will need to set
your path to include the build directory, so that the scripts will
find the version of `pandoc` you have just built. So, for example:
PATH=.:$PATH html2markdown http://haskell.org
4. Install:
sudo make install
Note: This installs `pandoc`, together with its wrappers and
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:
PREFIX=~ make install-exec
5. Build and install the Haskell libraries and library
documentation (optional--for Haskell programmers only):
make build-all
sudo make install-all
# Removing Pandoc
Each of the installation steps described above can be reversed:
sudo make uninstall
PREFIX=~ make uninstall-exec
sudo make uninstall-all
# Other targets
The following 'make' targets should not be needed by the average user,
but are documented here for packagers and developers:
## Building and installing
* `configure`: Performs the needed preprocessing to create a proper
Cabal package for Pandoc:
- Builds `Pandoc.cabal` from `Pandoc.cabal.in`, using
the shell script `cabalize`.
- Builds `ASCIIMathML.hs`, `DefaultHeaders.hs`, and `S5.hs`
from templates in `src/templates` and data in `src/ASCIIMathML.js`,
`src/ui`, and `src/headers`.
- Stores values of relevant environment variables in `vars` for
persistence.
- Runs Cabal's "configure" command.
* `build-exec`: Builds `pandoc` executable (using Cabal's "build"
command) and creates the wrappers `html2markdown` and `markdown2pdf`
from templates in `src/wrappers`.
* `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).
## Testing
* `test`: Runs Pandoc's test suite. (All tests should pass.)
* `test-markdown`: Runs the Markdown regression test suite, using
`pandoc --strict`. (One of the list tests will fail.)
## Cleaning
* `clean`: Restores directory to pre-build state, removing generated files.
* `distclean`: Like clean, but also cleans up files created by `make deb`.
## Packaging
* `osx-pkg-prep`: Prepares for building a MacOS X package.
* `osx-pkg`: Builds a MacOS X package (must be run as root, and on OS X).
You should make `osx-pkg-prep` first (not as root).
* `osx-dmg`: Creates a compressed disk image containing Mac OS X package
(must be run on OS X). You should make `osx-pkg` first.
* `win-pkg`: Creates a Windows binary package (presupposes `pandoc.exe`,
which must be created by building Pandoc on a Windows machine).
* `tarball`: Creates a source tarball for distribution.
* `deb`: Creates debian packages in `..` directory.
* `website`: Creates Pandoc's website in `web/pandoc` directory.