summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-02 02:58:54 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-01-02 02:58:54 +0000
commit5387ebd8db3b8cf98befd75d9aa42716acaf8dec (patch)
tree31357b758f45c39339b315e72456d6dfb40c3f4f
parent89f2468f38d7b85d78fe1d94bab7cc8ea46152d0 (diff)
Added 'hsmarkdown' wrapper, designed to be used as a drop-in
replacement for Markdown.pl. It calls pandoc with the options '--from markdown --to html --strict' and disallows other options. (Any command-line options will be interpreted as arguments.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@399 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--Makefile2
-rw-r--r--README32
-rw-r--r--debian/changelog3
-rwxr-xr-xhsmarkdown5
-rw-r--r--man/man1/hsmarkdown.136
-rw-r--r--man/man1/pandoc.12
-rwxr-xr-xosx/uninstall-pandoc2
-rw-r--r--web/index.txt4
8 files changed, 70 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index db722522a..3414ff62f 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@ EXECSBASE := $(shell sed -ne 's/^[Ee]xecutable:[[:space:]]*//p' $(CABAL).in)
#-------------------------------------------------------------------------------
# Install targets
#-------------------------------------------------------------------------------
-WRAPPERS := html2markdown markdown2pdf
+WRAPPERS := html2markdown markdown2pdf hsmarkdown
# Add .exe extensions if we're running Windows/Cygwin.
EXTENSION := $(shell uname | tr '[:upper:]' '[:lower:]' | \
sed -ne 's/^cygwin.*$$/\.exe/p')
diff --git a/README b/README
index caee57852..84bccc785 100644
--- a/README
+++ b/README
@@ -48,10 +48,6 @@ The wrapper script `html2markdown` requires
- `iconv` (for character encoding conversion). (If `iconv` is absent,
`html2markdown` will still work, but it will treat everything as UTF-8.)
-[Cygwin]: http://www.cygwin.com/
-[HTML Tidy]: http://tidy.sourceforge.net/
-[`iconv`]: http://www.gnu.org/software/libiconv/
-
The wrapper script `markdown2pdf` requires
- `pandoc` (which must be in the PATH)
@@ -67,6 +63,11 @@ The wrapper script `markdown2pdf` requires
and unpack it into `~/texmf/tex/latex/`. You may also need to run
`mktexlsr` or `texhash` before the files can be found by TeX.)
+The wrapper script `hsmarkdown` requires only a POSIX-compliant shell.
+
+[Cygwin]: http://www.cygwin.com/
+[HTML Tidy]: http://tidy.sourceforge.net/
+[`iconv`]: http://www.gnu.org/software/libiconv/
[CTAN]: http://www.ctan.org "Comprehensive TeX Archive Network"
[unicode]: http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/
[fancyvrb]: http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/
@@ -152,13 +153,13 @@ The shell scripts (described below) automatically convert the input
from the local encoding to UTF-8 before running them through `pandoc`,
then convert the output back to the local encoding.
-`markdown2pdf` and `html2markdown`
-==================================
+`markdown2pdf`, `html2markdown`, and `hsmarkdown`
+=================================================
-Two shell scripts, `markdown2pdf` and `html2markdown`, 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.)
+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.)
1. `markdown2pdf` produces a PDF file from markdown-formatted
text, using `pandoc` and `pdflatex`. The default
@@ -190,6 +191,14 @@ in Windows under Cygwin.)
html2markdown -g 'wget --user=foo --password=bar' mysite.com
+3. `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
+ variants, described below, are disabled.) No other command-line
+ options are allowed. (In fact, options will be interpreted as
+ filenames.)
+
Command-line options
====================
@@ -299,7 +308,8 @@ Pandoc's markdown vs. standard markdown
In parsing markdown, Pandoc departs from and extends [standard markdown]
in a few respects. (To run Pandoc on the official
markdown test suite, type `make test-markdown`.) These differences can
-be suppressed by specifying the `--strict` command-line option.
+be suppressed by specifying the `--strict` command-line option or by
+using the `hsmarkdown` wrapper.
[standard markdown]: http://daringfireball.net/projects/markdown/syntax
"Markdown syntax description"
diff --git a/debian/changelog b/debian/changelog
index 99324bac9..ef8c77067 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -159,6 +159,9 @@ pandoc (0.3) unstable; urgency=low
a '.exe' extension is added to each executable in EXECS.
* Removed all wrappers except markdown2pdf and html2markdown.
+ Added new wrapper hsmarkdown, to be used as a drop-in replacement
+ for Markdown.pl. hsmarkdown calls pandoc with the '--strict'
+ option and disables other options.
* Added code to html2markdown that tries to determine the character
encoding of an HTML file, by parsing the "Content-type" meta tag.
diff --git a/hsmarkdown b/hsmarkdown
new file mode 100755
index 000000000..17f970234
--- /dev/null
+++ b/hsmarkdown
@@ -0,0 +1,5 @@
+#!/bin/sh
+# hsmarkdown - intended as a drop-in replacement for Markdown.pl.
+# Uses pandoc to convert from markdown to HTML, using --strict mode
+# for maximum compatibility with official markdown syntax.
+exec pandoc --from markdown --to html --strict -- "$@"
diff --git a/man/man1/hsmarkdown.1 b/man/man1/hsmarkdown.1
new file mode 100644
index 000000000..3db8a8b45
--- /dev/null
+++ b/man/man1/hsmarkdown.1
@@ -0,0 +1,36 @@
+.TH HSMARKDOWN 1 "January 1, 2007" Pandoc "User Manuals"
+.SH NAME
+hsmarkdown \- convert markdown-formatted text to HTML
+.SH SYNOPSIS
+\fBhsmarkdown\fR [\fIinput\-file\fR]...
+.SH DESCRIPTION
+\fBhsmarkdown\fR converts markdown-formatted text to HTML. It is designed
+to be usable as a drop-in replacement for John Gruber's \fBMarkdown.pl\fR.
+.PP
+If no \fIinput\-file\fR is specified, input is read from STDIN.
+Otherwise, the \fIinput\-files\fR are concatenated (with a blank
+line between each) and used as input. Output goes to STDOUT by
+default. For output to a file, use shell redirection:
+.IP
+.B hsmarkdown input.txt > output.html
+.PP
+\fBhsmarkdown\fR uses the UTF\-8 character encoding for both input and output.
+If your local character encoding is not UTF\-8, you should pipe input
+and output through \fBiconv\fR:
+.IP
+.B iconv \-t utf\-8 input.txt | hsmarkdown | iconv \-f utf\-8
+.PP
+\fBhsmarkdown\fR is implemented as a wrapper around \fBpandoc\fR(1). It
+calls \fBpandoc\fR with the options \fB\-\-from markdown \-\-to html
+\-\-strict\fR and disables all other options. (Command-line options
+will be interpreted as filenames, as they are by \fBMarkdown.pl\fR.)
+.SH "SEE ALSO"
+\fBpandoc\fR(1).
+The
+.I README
+file distributed with Pandoc contains full documentation.
+
+The Pandoc source code and all documentation may be downloaded from
+<http://sophos.berkeley.edu/macfarlane/pandoc/>.
+.SH AUTHOR
+John MacFarlane
diff --git a/man/man1/pandoc.1 b/man/man1/pandoc.1
index a1df84208..4123cd5d9 100644
--- a/man/man1/pandoc.1
+++ b/man/man1/pandoc.1
@@ -4,7 +4,7 @@ pandoc \- general markup converter
.SH SYNOPSIS
\fBpandoc\fR [\fIoptions\fR] [\fIinput\-file\fR]...
.SH DESCRIPTION
-\fBPandoc\fR converts files from one markup format to another. It can
+\fIPandoc\fR converts files 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, RTF, DocBook
XML, and S5 HTML slide shows.
diff --git a/osx/uninstall-pandoc b/osx/uninstall-pandoc
index a8f920fec..db2001da1 100755
--- a/osx/uninstall-pandoc
+++ b/osx/uninstall-pandoc
@@ -8,7 +8,7 @@ if [ "`id -u`" != 0 ]; then \
exit 1; \
fi
-MAN_PAGES="pandoc.1 markdown2pdf.1 html2markdown.1"
+MAN_PAGES="pandoc.1 markdown2pdf.1 html2markdown.1 hsmarkdown.1"
EXECUTABLES=`echo $MAN_PAGES | sed -e 's#\.1##g'`
EXECUTABLES="$EXECUTABLES uninstall-pandoc"
DOCUMENTS="`ls /usr/local/share/doc/pandoc`"
diff --git a/web/index.txt b/web/index.txt
index ec96b01dd..dadcdd189 100644
--- a/web/index.txt
+++ b/web/index.txt
@@ -35,8 +35,8 @@ you should extract from the zip archive and put somewhere in your
PATH). See the included file `README-WINDOWS.txt` for instructions
on using the program. Note: If you use [Cygwin], we recommend that
you compile Pandoc from source. This will give you access to the
-wrapper scripts `markdown2pdf` and `html2markdown`, which are not
-included in the Windows binary package.
+wrapper scripts `markdown2pdf`, `html2markdown`, and `hsmarkdown`,
+which are not included in the Windows binary package.
[`@TARBALL_NAME@`]: http://pandoc.googlecode.com/files/@TARBALL_NAME@
"Download source tarball from Pandoc's Google Code site"