Removed markdown2pdf and all references to it.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1395 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2008-08-10 17:34:02 +00:00
parent 0f4bdc6b7d
commit 1cbc974e7e
15 changed files with 45 additions and 283 deletions

View file

@ -175,8 +175,7 @@ but are documented here for packagers and developers:
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`.
command).
* `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

View file

@ -24,7 +24,7 @@ EXECSBASE := $(shell sed -ne 's/^[Ee]xecutable:\{0,1\}[[:space:]]*//p' $(CABAL))
#-------------------------------------------------------------------------------
# Install targets
#-------------------------------------------------------------------------------
WRAPPERS := html2markdown markdown2pdf hsmarkdown
WRAPPERS := html2markdown hsmarkdown
# Add .exe extensions if we're running Windows/Cygwin.
EXTENSION := $(shell uname | tr '[:upper:]' '[:lower:]' | \
sed -ne 's/^cygwin.*$$/\.exe/p')
@ -85,8 +85,8 @@ all: build-program
./$(MAIN) -s -w latex $< >$@ || rm -f $@
%.rtf: % $(MAIN)
./$(MAIN) -s -w rtf $< >$@ || rm -f $@
%.pdf: % $(MAIN) markdown2pdf
sh ./markdown2pdf $< || rm -f $@
%.pdf: % $(MAIN)
./$(MAIN) -w pdf -o $@ $< || rm -f $@
%.txt: %
perl -p -e 's/\n/\r\n/' $< > $@ || rm -f $@ # convert to DOS line endings

45
README
View file

@ -55,9 +55,9 @@ If you want to write to a file, use the `-o` option:
pandoc -o hello.html hello.txt
[^1]: The exception is for non-text output formats, such as `odt`.
For output in `odt` format, an output file must be specified
explicitly.
[^1]: The exception is for non-text output formats, such as `odt`
and `pdf`. For output in these formats, an output file must be
specified explicitly.
Note that you can specify multiple input files on the command line.
`pandoc` will concatenate them all (with blank lines between them)
@ -148,37 +148,12 @@ then convert the output back to the local encoding.
Shell scripts
=============
Three shell scripts, `markdown2pdf`, `html2markdown`, and
`hsmarkdown`, are included in the standard Pandoc installation. (They
are not included in the Windows binary package, as they require a POSIX
shell, but they may be used in Windows under Cygwin.)
Two shell scripts, `html2markdown` and `hsmarkdown`, are included in
the standard Pandoc installation. (They are not included in the Windows
binary package, as they require a POSIX shell, but they may be used in
Windows under Cygwin.)
1. `markdown2pdf` produces a PDF file from markdown-formatted
text, using `pandoc` and `pdflatex`. The default
behavior of `markdown2pdf` is to create a file with the same
base name as the first argument and the extension `pdf`; thus,
for example,
markdown2pdf sample.txt endnotes.txt
will produce `sample.pdf`. (If `sample.pdf` exists already,
it will be backed up before being overwritten.) An output file
name can be specified explicitly using the `-o` option:
markdown2pdf -o book.pdf chap1 chap2
If no input file is specified, input will be taken from stdin.
All of `pandoc`'s options will work with `markdown2pdf` as well.
`markdown2pdf` assumes that `pdflatex` is in the path. It also
assumes that the following LaTeX packages are available:
`unicode`, `fancyhdr` (if you have verbatim text in footnotes),
`graphicx` (if you use images), `array` (if you use tables),
and `ulem` (if you use strikeout text). If they are not already
included in your LaTeX distribution, you can get them from
[CTAN].
2. `html2markdown` grabs a web page from a file or URL and converts
1. `html2markdown` grabs a web page from a file or URL and converts
it to markdown-formatted text, using `tidy` and `pandoc`.
All of `pandoc`'s options will work with `html2markdown` as well.
@ -207,7 +182,7 @@ shell, but they may be used in Windows under Cygwin.)
It uses [`iconv`] for character encoding conversions; if `iconv`
is absent, it will still work, but it will treat everything as UTF-8.
3. `hsmarkdown` is designed to be used as a drop-in replacement for
2. `hsmarkdown` is designed to be used as a drop-in replacement for
`Markdown.pl`. It forces `pandoc` to convert from markdown to
HTML, and to use the `--strict` flag for maximal compliance with
official markdown syntax. (All of Pandoc's syntax extensions and
@ -252,7 +227,7 @@ For further documentation, see the `pandoc(1)` man page.
`-o` or `--output` *filename*
: sends output to *filename*. If this option is not specified,
or if its argument is `-`, output will be sent to stdout.
(Exception: if the output format is `odt`, output to stdout
(Exception: if the output format is `odt` or `pdf`, output to stdout
is disabled.)
`-p` or `--preserve-tabs`

View file

@ -50,7 +50,7 @@ makeReferenceODT sources = do
-- | Build man pages from markdown sources in man/man1/.
makeManPages _ _ _ _ = do
mapM makeManPage ["pandoc.1", "hsmarkdown.1", "markdown2pdf.1", "html2markdown.1"]
mapM makeManPage ["pandoc.1", "hsmarkdown.1", "html2markdown.1"]
return ()
-- | Build a man page from markdown source in man/man1.

18
debian/control vendored
View file

@ -18,9 +18,9 @@ Description: general markup converter
Pandoc is a Haskell library for converting from one markup format to
another, and a command-line tool that uses this library. It can read
markdown and (subsets of) reStructuredText, HTML, and LaTeX, and it
can write markdown, reStructuredText, HTML, LaTeX, ConTeXt, DocBook XML,
OpenDocument XML, RTF, GNU Texinfo, MediaWiki markup, groff man pages,
and S5 HTML slide shows.
can write markdown, reStructuredText, HTML, LaTeX, ConTeXt, PDF,
DocBook XML, OpenDocument XML, ODT, RTF, GNU Texinfo, MediaWiki markup,
groff man pages, and S5 HTML slide shows.
.
Pandoc extends standard markdown syntax with footnotes, embedded LaTeX,
tables, definition lists, and other features. A compatibility mode is
@ -44,9 +44,9 @@ Description: general markup converter
Pandoc is a Haskell library for converting from one markup format to
another, and a command-line tool that uses this library. It can read
markdown and (subsets of) reStructuredText, HTML, and LaTeX, and it
can write markdown, reStructuredText, HTML, LaTeX, ConTeXt, DocBook XML,
OpenDocument XML, RTF, GNU Texinfo, MediaWiki markup, groff man pages,
and S5 HTML slide shows.
can write markdown, reStructuredText, HTML, LaTeX, ConTeXt, PDF,
DocBook XML, OpenDocument XML, ODT, RTF, GNU Texinfo, MediaWiki markup,
groff man pages, and S5 HTML slide shows.
.
Pandoc extends standard markdown syntax with footnotes, embedded LaTeX,
tables, definition lists, and other features. A compatibility mode is
@ -70,9 +70,9 @@ Description: general markup converter
Pandoc is a Haskell library for converting from one markup format to
another, and a command-line tool that uses this library. It can read
markdown and (subsets of) reStructuredText, HTML, and LaTeX, and it
can write markdown, reStructuredText, HTML, LaTeX, ConTeXt, DocBook XML,
OpenDocument XML, RTF, GNU Texinfo, MediaWiki markup, groff man pages,
and S5 HTML slide shows.
can write markdown, reStructuredText, HTML, LaTeX, ConTeXt, PDF,
DocBook XML, OpenDocument XML, ODT, RTF, GNU Texinfo, MediaWiki markup,
groff man pages, and S5 HTML slide shows.
.
Pandoc extends standard markdown syntax with footnotes, embedded LaTeX,
tables, definition lists, and other features. A compatibility mode is

2
debian/rules vendored
View file

@ -111,7 +111,7 @@ binary-arch: build install
dh_installexamples -a
dh_installman -a
dh_link -a
dh_strip -a -Xhtml2 -Xmarkdown2 -Xlatex2 -Xrst2
dh_strip -a -Xhtml2
dh_compress -a
dh_fixperms -a
dh_installdeb -a

View file

@ -16,16 +16,14 @@ COMMENT= A general markup converter
BUILD_DEPENDS= ghc>=6.6:${PORTSDIR}/lang/ghc
MANCOMPRESSED= no
MAN1= pandoc.1 markdown2pdf.1 html2markdown.1 hsmarkdown.1 markdown2odt.1
MAN1= pandoc.1 html2markdown.1 hsmarkdown.1
USE_GMAKE= yes
USE_PERL5= yes
PLIST_FILES= bin/pandoc bin/markdown2pdf bin/html2markdown bin/hsmarkdown \
bin/markdown2odt
PLIST_FILES= bin/pandoc bin/html2markdown bin/hsmarkdown
PORTDOCS= BUGS README README.html
SCRIPTS= hsmarkdown html2markdown markdown2pdf markdown2odt
DATA_FILES= odt-styles/reference.odt
SCRIPTS= hsmarkdown html2markdown
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/dist/build/pandoc/pandoc ${PREFIX}/bin

View file

@ -1,8 +1,8 @@
Pandoc is a command-line tool for converting from one markup format
to another. It can read markdown and (subsets of) reStructuredText,
HTML, and LaTeX, and it can write markdown, reStructuredText, HTML,
LaTeX, ConTeXt, DocBook XML, OpenDocument XML, RTF, GNU Texinfo,
MediaWiki markup, groff man pages, and S5 HTML slide shows.
LaTeX, ConTeXt, PDF, DocBook XML, OpenDocument XML, ODT, RTF, GNU
Texinfo, MediaWiki markup, groff man pages, and S5 HTML slide shows.
Pandoc extends standard markdown syntax with footnotes, embedded LaTeX,
and other features. A compatibility mode is provided for those who

View file

@ -11,7 +11,7 @@ long_description \
Pandoc is a command-line tool for converting from one markup format \
to another. It can read markdown and (subsets of) reStructuredText, \
HTML, and LaTeX, and it can write markdown, reStructuredText, HTML, \
LaTeX, ConTeXt, DocBook XML, OpenDocument XML, RTF, Texinfo, \
LaTeX, ConTeXt, PDF, DocBook XML, OpenDocument XML, ODT, RTF, Texinfo, \
MediaWiki markup, groff man, and S5 HTML slide shows.
homepage http://johnmacfarlane.net/pandoc/
@ -40,8 +40,8 @@ destroot {
xinstall -m 755 ${worksrcpath}/unregister.sh \
${destroot}${prefix}/libexec/${name}-${version}
# install shell scripts:
xinstall -m 755 -W ${worksrcpath} html2markdown hsmarkdown markdown2pdf \
markdown2odt ${destroot}${prefix}/bin
xinstall -m 755 -W ${worksrcpath} html2markdown hsmarkdown \
${destroot}${prefix}/bin
# install data file:
xinstall -d ${destroot}${prefix}/share/${name}
xinstall -m 644 -W ${worksrcpath} odt-styles/reference.odt \
@ -51,7 +51,7 @@ destroot {
xinstall -m 644 -W ${worksrcpath} README README.html COPYRIGHT BUGS \
${destroot}${prefix}/share/doc/${name}
xinstall -m 644 -W ${worksrcpath}/man/man1 pandoc.1 hsmarkdown.1 \
markdown2pdf.1 html2markdown.1 markdown2odt.1 \
html2markdown.1 \
${destroot}${prefix}/share/man/man1
}

View file

@ -1,69 +0,0 @@
% MARKDOWN2PDF(1) Pandoc User Manuals
% John MacFarlane and Recai Oktas
% January 8, 2008
# NAME
markdown2pdf - converts markdown-formatted text to PDF, using pdflatex
# SYNOPSIS
markdown2pdf [*options*] [*input-file*]...
# DESCRIPTION
`markdown2pdf` converts *input-file* (or text from standard
input) from markdown-formatted plain text to PDF, using `pdflatex`.
If no output filename is specified (using the `-o` option),
the name of the output file is derived from the input file; thus, for
example, if the input file is *hello.txt*, the output file will be
*hello.pdf*. If the input is read from STDIN and no output filename
is specified, the output file will be named *stdin.pdf*. If multiple
input files are specified, they will be concatenated before conversion,
and the name of the output file will be derived from the first input file.
Input is assumed to be in the UTF-8 character encoding. If your
local character encoding is not UTF-8, you should pipe input
through `iconv`:
iconv -t utf-8 input.txt | markdown2pdf
`markdown2pdf` assumes that the `unicode`, `array`, `fancyvrb`,
`graphicx`, and `ulem` packages are in latex's search path. If these
packages are not included in your latex setup, they can be obtained from
<http://ctan.org>.
# OPTIONS
`markdown2pdf` is a wrapper around `pandoc`, so all of
`pandoc`'s options can be used with `markdown2pdf` as well.
See `pandoc`(1) for a complete list.
The following options are most relevant:
-o *FILE*, \--output=*FILE*
: Write output to *FILE*.
\--strict
: Use strict markdown syntax, with no extensions or variants.
-N, \--number-sections
: Number section headings in LaTeX output. (Default is not to number them.)
-H *FILE*, \--include-in-header=*FILE*
: Include (LaTeX) contents of *FILE* at the end of the header. Implies
`-s`.
-B *FILE*, \--include-before-body=*FILE*
: Include (LaTeX) contents of *FILE* at the beginning of the document body.
-A *FILE*, \--include-after-body=*FILE*
: Include (LaTeX) contents of *FILE* at the end of the document body.
-C *FILE*, \--custom-header=*FILE*
: Use contents of *FILE*
as the LaTeX document header (overriding the default header, which can be
printed using `pandoc -D latex`). Implies `-s`.
# SEE ALSO
`pandoc`(1), `pdflatex`(1)

View file

@ -1,140 +0,0 @@
#!/bin/sh -e
REQUIRED="pdflatex"
SYNOPSIS="converts markdown-formatted text to PDF, using pdflatex."
THIS=${0##*/}
NEWLINE='
'
err () { echo "$*" | fold -s -w ${COLUMNS:-110} >&2; }
errn () { printf "$*" | fold -s -w ${COLUMNS:-110} >&2; }
usage () {
err "$1 - $2" # short description
err "See the $1(1) man page for usage."
}
# Portable which(1).
pathfind () {
oldifs="$IFS"; IFS=':'
for _p in $PATH; do
if [ -x "$_p/$*" ] && [ -f "$_p/$*" ]; then
IFS="$oldifs"
return 0
fi
done
IFS="$oldifs"
return 1
}
for p in pandoc $REQUIRED; do
pathfind $p || {
err "You need '$p' to use this program!"
exit 1
}
done
CONF=$(pandoc --dump-args "$@" 2>&1) || {
errcode=$?
echo "$CONF" | sed -e '/^pandoc \[OPTIONS\] \[FILES\]/,$d' >&2
[ $errcode -eq 2 ] && usage "$THIS" "$SYNOPSIS"
exit $errcode
}
OUTPUT=$(echo "$CONF" | sed -ne '1p')
ARGS=$(echo "$CONF" | sed -e '1d')
# As a security measure refuse to proceed if mktemp is not available.
pathfind mktemp || { err "Couldn't find 'mktemp'; aborting."; exit 1; }
# Avoid issues with /tmp directory on Windows/Cygwin
cygwin=
cygwin=$(uname | sed -ne '/^CYGWIN/p')
if [ -n "$cygwin" ]; then
TMPDIR=.
export TMPDIR
fi
THIS_TEMPDIR=
THIS_TEMPDIR="$(mktemp -d -t $THIS.XXXXXXXX)" || exit 1
readonly THIS_TEMPDIR
trap 'exitcode=$?
[ -z "$THIS_TEMPDIR" ] || rm -rf "$THIS_TEMPDIR"
exit $exitcode' 0 1 2 3 13 15
texname=output
logfile=$THIS_TEMPDIR/log
pandoc -s -r markdown -w latex "$@" -o $THIS_TEMPDIR/$texname.tex
if [ "$OUTPUT" = "-" ]; then
firstinfile="$(echo $ARGS | sed -ne '1p')"
firstinfilebase="${firstinfile%.*}"
destname="${firstinfilebase:-stdin}.pdf"
else
destname="$OUTPUT"
fi
(
origdir=$(pwd)
cd $THIS_TEMPDIR
TEXINPUTS=$origdir:$TEXINPUTS:
export TEXINPUTS
finished=no
runs=0
while [ $finished = "no" ]; do
pdflatex -interaction=batchmode $texname.tex >/dev/null || {
errcode=$?
err "${THIS}: pdfLaTeX failed with error code $errcode"
[ -f $texname.log ] && {
err "${THIS}: error context:"
sed -ne '/^!/,/^[[:space:]]*$/p' \
-ne '/^[Ll]a[Tt]e[Xx] [Ww]arning/,/^[[:space:]]*$/p' \
-ne '/^[Ee]rror/,/^[[:space:]]*$/p' $texname.log >&2
if grep -q "File \`ucs.sty' not found" $texname.log; then
err "${THIS}: Please install the 'unicode' package from CTAN:"
err " http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
fi
if grep -q "File \`ulem.sty' not found" $texname.log; then
err "${THIS}: Please install the 'ulem' package from CTAN:"
err " http://www.ctan.org/tex-archive/macros/latex/contrib/misc/ulem.sty"
fi
}
exit $errcode
}
if [ $runs -lt 3 ] &&
((grep -q "LaTeX Warning: There were undefined references." $texname.log) ||
(echo "$@" | grep -q -- "--toc\|--table-of-contents")); then
runs=$(($runs + 1))
if grep -q "LaTeX Warning:.*[Cc]itation" $texname.log; then
bibtex $texname 2>&1 >bibtex.err
if [ $runs -gt 2 ]; then
if grep -q "error message" bibtex.err ||
grep -q "Warning" bibtex.err; then
cat bibtex.err >&2
fi
fi
fi
else
finished=yes
fi
done
) || exit $?
is_target_exists=
if [ -f "$destname" ]; then
is_target_exists=1
mv "$destname" "$destname~"
fi
mv -f $THIS_TEMPDIR/$texname.pdf "$destname"
errn "Created $destname"
[ -z "$is_target_exists" ] || {
errn " (previous file has been backed up as $destname~)"
}
err .

View file

@ -18,7 +18,7 @@ Description: Pandoc is a Haskell library for converting from one markup
this library. It can read markdown and (subsets of)
reStructuredText, HTML, and LaTeX, and it can write
markdown, reStructuredText, HTML, LaTeX, ConTeXt, Docbook,
OpenDocument, ODT, RTF, MediaWiki, groff man pages, and
OpenDocument, ODT, PDF, RTF, MediaWiki, groff man pages, and
S5 HTML slide shows.
.
Pandoc extends standard markdown syntax with footnotes,
@ -38,12 +38,12 @@ Extra-Source-Files:
-- documentation
README, INSTALL, COPYRIGHT, COPYING, changelog,
-- sources for man pages
man/man1/pandoc.1.md, man/man1/markdown2pdf.1.md,
man/man1/pandoc.1.md,
man/man1/html2markdown.1.md, man/man1/hsmarkdown.1.md,
-- Makefile
Makefile,
-- wrappers
markdown2pdf, html2markdown, hsmarkdown,
html2markdown, hsmarkdown,
-- data for DefaultHeaders.hs
data/headers/ConTeXt.header,
data/headers/Docbook.header,
@ -118,7 +118,7 @@ Extra-Source-Files:
tests/Diff.hs,
tests/RunTests.hs
Extra-Tmp-Files: man/man1/pandoc.1, man/man1/hsmarkdown.1,
man/man1/markdown2pdf.1, man/man1/html2markdown.1
man/man1/html2markdown.1
Flag splitBase
Description: Choose the new, smaller, split-up base package.

View file

@ -1,4 +1,4 @@
ALL := index.html README.html INSTALL.html examples.html pandoc.1.html markdown2pdf.1.html html2markdown.1.html hsmarkdown.1.html html2x.html
ALL := index.html README.html INSTALL.html examples.html pandoc.1.html html2markdown.1.html hsmarkdown.1.html html2x.html
PANDOC_PATH ?= $(dir $(shell which pandoc))
MAKEPAGE = $(PANDOC_PATH)/pandoc -s -S -H css -A footer.html
all : $(ALL)

View file

@ -61,11 +61,11 @@ click on the name of the output file:
13. From markdown to PDF:
@ markdown2pdf @@README@@ -o @@example13.pdf@@
@ pandoc @@README@@ -o @@example13.pdf@@
14. PDF with numbered sections and a custom LaTeX header:
@ markdown2pdf -N -C @@myheader.tex@@ @@README@@ -o @@example14.pdf@@
@ pandoc -N -C @@myheader.tex@@ @@README@@ -o @@example14.pdf@@
[xmlto]: http://cyberelk.net/tim/xmlto/

View file

@ -6,8 +6,8 @@ Pandoc is a [Haskell] library for converting from one markup format
to another, and a command-line tool that uses this library. It can read
[markdown] and (subsets of) [reStructuredText], [HTML], and [LaTeX],
and it can write [markdown], [reStructuredText], [HTML], [LaTeX], [ConTeXt],
[RTF], [DocBook XML], [OpenDocument XML], [GNU Texinfo], [MediaWiki markup],
[groff man] pages, and [S5] HTML slide shows.
[PDF], [RTF], [DocBook XML], [OpenDocument XML], [ODT], [GNU Texinfo],
[[MediaWiki markup], groff man] pages, and [S5] HTML slide shows.
Pandoc features
@ -36,8 +36,6 @@ Pandoc features
- Convenient wrapper scripts:
+ `html2markdown` makes it easy to produce a markdown version
of any web page.
+ `markdown2pdf` converts markdown to PDF in one step.
+ `markdown2odt` converts markdown to ODT in one step.
+ `hsmarkdown` is a drop-in replacement for `Markdown.pl`.
- Multi-platform: runs on Windows, MacOS X, Linux, Unix.
- Free software, released under the [GPL].
@ -51,7 +49,6 @@ or [try pandoc on the web](/pandoc/try).
- [Demonstrations](examples.html)
- Man pages
- [`pandoc(1)`](pandoc.1.html)
- [`markdown2pdf(1)`](markdown2pdf.1.html)
- [`html2markdown(1)`](html2markdown.1.html)
- [`hsmarkdown(1)`](hsmarkdown.1.html)
- [Library documentation](doc/pandoc/index.html) (for Haskell programmers)
@ -168,6 +165,8 @@ kind.
[LaTeX]: http://www.latex-project.org/
[ConTeXt]: http://www.pragma-ade.nl/
[RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format
[PDF]: http://en.wikipedia.org/wiki/Portable_Document_Format
[ODT]: http://en.wikipedia.org/wiki/OpenDocument
[DocBook XML]: http://www.docbook.org/
[OpenDocument XML]: http://opendocument.xml.org/
[MediaWiki markup]: http://www.mediawiki.org/wiki/Help:Formatting