aboutsummaryrefslogtreecommitdiff
path: root/src/wrappers
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-12-28 02:20:09 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-12-28 02:20:09 +0000
commita1a30d69bd83e57e494cd3ca5077086077731998 (patch)
tree8193378eb51d13a20cf9f28ce479af431d3dcba4 /src/wrappers
parenta1539d9ab8141ab11add5b304792e7c9bc7a363a (diff)
downloadpandoc-a1a30d69bd83e57e494cd3ca5077086077731998.tar.gz
+ Removed the convenience symlinks (which don't work on Windows under
Cygwin, due to Windows' lack of true symbolic links). + Modified the wrappers to use 'pandoc' instead of the symlinks. + Modified the Makefile to remove all references to the symlinks. + Removed code from Main.hs that made pandoc's behavior depend on the name of the calling program. + Added code to Main.hs that sets default reader and writer based on extensions of input and output filenames (if provided). (Thanks to roktas for the idea.) + Modified README and man pages accordingly. + Removed WINDOWS-README target from Makefile. It is no longer needed now that we don't have the symlinks. git-svn-id: https://pandoc.googlecode.com/svn/trunk@295 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/wrappers')
-rw-r--r--src/wrappers/markdown2pdf.in11
-rw-r--r--src/wrappers/web2markdown.in15
2 files changed, 16 insertions, 10 deletions
diff --git a/src/wrappers/markdown2pdf.in b/src/wrappers/markdown2pdf.in
index c222c1cbd..71d58a7cd 100644
--- a/src/wrappers/markdown2pdf.in
+++ b/src/wrappers/markdown2pdf.in
@@ -1,6 +1,6 @@
#!/bin/sh -e
-REQUIRED="markdown2latex pdflatex"
+REQUIRED="pdflatex"
### common.sh
@@ -9,9 +9,12 @@ REQUIRED="markdown2latex pdflatex"
texname=output
logfile=$THIS_TEMPDIR/log
-if ! markdown2latex -s -d "$@" >$THIS_TEMPDIR/$texname.tex 2>$logfile; then
- [ -f $logfile ] && sed -e 's/markdown2latex/markdown2pdf/g' \
- -e '/^INPUT=/d' -e '/^OUTPUT=/d' $logfile >&2
+if ! pandoc -s -d -r markdown -w latex "$@" >$THIS_TEMPDIR/$texname.tex \
+2>$logfile; then
+ [ -f $logfile ] && sed -e 's/^pandoc/markdown2pdf/g' \
+ -e '/^INPUT=/d' -e '/^OUTPUT=/d' \
+ -e '/^[[:space:]]*\(-f\|-t\|-s\|-R\|-S\|-m\|-i\|-c\|-T\|-D\|-d\)/,/./d'\
+ -e 's/(implies -s)//g' $logfile >&2
exit 1
fi
diff --git a/src/wrappers/web2markdown.in b/src/wrappers/web2markdown.in
index 64ff3db9b..89e884c3d 100644
--- a/src/wrappers/web2markdown.in
+++ b/src/wrappers/web2markdown.in
@@ -2,7 +2,7 @@
# converts HTML from a URL, file, or stdin to markdown
# uses an available program to fetch URL and tidy to normalize it first
-REQUIRED="tidy html2markdown"
+REQUIRED="tidy"
### common.sh
@@ -72,14 +72,16 @@ grabber=
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
- html2markdown -h 2>&1 | sed -e 's/html2markdown/web2markdown/' 1>&2
+ pandoc -h 2>&1 | sed -e 's/pandoc/web2markdown/' \
+ -e '/^[[:space:]]*\(-f\|-t\|-S\|-N\|-m\|-i\|-c\|-T\|-D\|-d\)/,/./d'\
+ 1>&2
err " -e ENCODING, --encoding=ENCODING"
err " Specify character encoding of input"
err " -g COMMAND, --grabber=COMMAND"
err " Specify command to be used to grab contents of URL"
exit 0 ;;
-v|--version)
- html2markdown -v
+ pandoc -v 2>&1 | sed -e 's/pandoc/web2markdown/' 1>&2
exit 0 ;;
-e)
shift
@@ -112,7 +114,7 @@ while [ $# -gt 0 ]; do
shift
done
-# Unpack options. Now "$@" will hold the html2markdown options.
+# Unpack options. Now "$@" will hold the pandoc options.
oldifs="$IFS"; IFS="$NEWLINE"; set -- $options; IFS="$oldifs"
inurl=
@@ -162,10 +164,11 @@ else # assume UTF-8
fi
if [ -z "$argument" ]; then
- tidy -utf8 2>/dev/null | html2markdown "$@"
+ tidy -utf8 2>/dev/null | pandoc -r html -w markdown "$@"
else
if [ -f "$argument" ]; then
- to_utf8 "$argument" | tidy -utf8 2>/dev/null | html2markdown "$@"
+ to_utf8 "$argument" |
+ tidy -utf8 2>/dev/null | pandoc -r html -w markdown "$@"
else
err "File '$argument' not found."
exit 1