git.iko.soy/typeable/pandoc
on master help sign in
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

commit5387ebd8db3b8cf98befd75d9aa42716acaf8dec authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateTue 2 Jan 2007, 02:58 (20 years ago) parent89f2468
8 files changed+70−16
Makefile+1−1 README+21−11 debian/changelog+3 hsmarkdown+5 man/man1/hsmarkdown.1+36 man/man1/pandoc.1+1−1 osx/uninstall-pandoc+1−1 web/index.txt+2−2
Makefile+1−1
@@ -25,7 +25,7 @@ EXECSBASE := $(shell sed -ne 's/^[Ee]xecutable:[[:space:]]*//p' $(CABAL).in)
2525#-------------------------------------------------------------------------------
2626# Install targets
2727#-------------------------------------------------------------------------------
28−WRAPPERS := html2markdown markdown2pdf
28+WRAPPERS := html2markdown markdown2pdf hsmarkdown
2929# Add .exe extensions if we're running Windows/Cygwin.
3030EXTENSION := $(shell uname | tr '[:upper:]' '[:lower:]' | \
3131 sed -ne 's/^cygwin.*$$/\.exe/p')
README+21−11
@@ -48,10 +48,6 @@ The wrapper script `html2markdown` requires
4848 - `iconv` (for character encoding conversion). (If `iconv` is absent,
4949 `html2markdown` will still work, but it will treat everything as UTF-8.)
5050
51−[Cygwin]: http://www.cygwin.com/
52−[HTML Tidy]: http://tidy.sourceforge.net/
53−[`iconv`]: http://www.gnu.org/software/libiconv/
54−
5551The wrapper script `markdown2pdf` requires
5652
5753 - `pandoc` (which must be in the PATH)
@@ -67,6 +63,11 @@ The wrapper script `markdown2pdf` requires
6763 and unpack it into `~/texmf/tex/latex/`. You may also need to run
6864 `mktexlsr` or `texhash` before the files can be found by TeX.)
6965
66+The wrapper script `hsmarkdown` requires only a POSIX-compliant shell.
67+
68+[Cygwin]: http://www.cygwin.com/
69+[HTML Tidy]: http://tidy.sourceforge.net/
70+[`iconv`]: http://www.gnu.org/software/libiconv/
7071[CTAN]: http://www.ctan.org "Comprehensive TeX Archive Network"
7172[unicode]: http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/
7273[fancyvrb]: http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/
@@ -152,13 +153,13 @@ The shell scripts (described below) automatically convert the input
152153from the local encoding to UTF-8 before running them through `pandoc`,
153154then convert the output back to the local encoding.
154155
155−`markdown2pdf` and `html2markdown`
156−==================================
156+`markdown2pdf`, `html2markdown`, and `hsmarkdown`
157+=================================================
157158
158−Two shell scripts, `markdown2pdf` and `html2markdown`, are included in
159−the standard Pandoc installation. (They are not included in the Windows
160−binary package, as they require a POSIX shell, but they may be used
161−in Windows under Cygwin.)
159+Three shell scripts, `markdown2pdf`, `html2markdown`, and `hsmarkdown`,
160+are included in the standard Pandoc installation. (They are not included
161+in the Windows binary package, as they require a POSIX shell, but they
162+may be used in Windows under Cygwin.)
162163
1631641. `markdown2pdf` produces a PDF file from markdown-formatted
164165 text, using `pandoc` and `pdflatex`. The default
@@ -190,6 +191,14 @@ in Windows under Cygwin.)
190191
191192 html2markdown -g 'wget --user=foo --password=bar' mysite.com
192193
194+3. `hsmarkdown` is designed to be used as a drop-in replacement for
195+ `Markdown.pl`. It forces `pandoc` to convert from markdown to
196+ HTML, and to use the `--strict` flag for maximal compliance with
197+ official markdown syntax. (All of Pandoc's syntax extensions and
198+ variants, described below, are disabled.) No other command-line
199+ options are allowed. (In fact, options will be interpreted as
200+ filenames.)
201+
193202Command-line options
194203====================
195204
@@ -299,7 +308,8 @@ Pandoc's markdown vs. standard markdown
299308In parsing markdown, Pandoc departs from and extends [standard markdown]
300309in a few respects. (To run Pandoc on the official
301310markdown test suite, type `make test-markdown`.) These differences can
302−be suppressed by specifying the `--strict` command-line option.
311+be suppressed by specifying the `--strict` command-line option or by
312+using the `hsmarkdown` wrapper.
303313
304314[standard markdown]: http://daringfireball.net/projects/markdown/syntax
305315 "Markdown syntax description"
debian/changelog+3
@@ -159,6 +159,9 @@ pandoc (0.3) unstable; urgency=low
159159 a '.exe' extension is added to each executable in EXECS.
160160
161161 * Removed all wrappers except markdown2pdf and html2markdown.
162+ Added new wrapper hsmarkdown, to be used as a drop-in replacement
163+ for Markdown.pl. hsmarkdown calls pandoc with the '--strict'
164+ option and disables other options.
162165
163166 * Added code to html2markdown that tries to determine the character
164167 encoding of an HTML file, by parsing the "Content-type" meta tag.
hsmarkdownnew file+5
@@ -0,0 +1,5 @@
1+#!/bin/sh
2+# hsmarkdown - intended as a drop-in replacement for Markdown.pl.
3+# Uses pandoc to convert from markdown to HTML, using --strict mode
4+# for maximum compatibility with official markdown syntax.
5+exec pandoc --from markdown --to html --strict -- "$@"
man/man1/hsmarkdown.1new file+36
@@ -0,0 +1,36 @@
1+.TH HSMARKDOWN 1 "January 1, 2007" Pandoc "User Manuals"
2+.SH NAME
3+hsmarkdown \- convert markdown-formatted text to HTML
4+.SH SYNOPSIS
5+\fBhsmarkdown\fR [\fIinput\-file\fR]...
6+.SH DESCRIPTION
7+\fBhsmarkdown\fR converts markdown-formatted text to HTML. It is designed
8+to be usable as a drop-in replacement for John Gruber's \fBMarkdown.pl\fR.
9+.PP
10+If no \fIinput\-file\fR is specified, input is read from STDIN.
11+Otherwise, the \fIinput\-files\fR are concatenated (with a blank
12+line between each) and used as input. Output goes to STDOUT by
13+default. For output to a file, use shell redirection:
14+.IP
15+.B hsmarkdown input.txt > output.html
16+.PP
17+\fBhsmarkdown\fR uses the UTF\-8 character encoding for both input and output.
18+If your local character encoding is not UTF\-8, you should pipe input
19+and output through \fBiconv\fR:
20+.IP
21+.B iconv \-t utf\-8 input.txt | hsmarkdown | iconv \-f utf\-8
22+.PP
23+\fBhsmarkdown\fR is implemented as a wrapper around \fBpandoc\fR(1). It
24+calls \fBpandoc\fR with the options \fB\-\-from markdown \-\-to html
25+\-\-strict\fR and disables all other options. (Command-line options
26+will be interpreted as filenames, as they are by \fBMarkdown.pl\fR.)
27+.SH "SEE ALSO"
28+\fBpandoc\fR(1).
29+The
30+.I README
31+file distributed with Pandoc contains full documentation.
32+
33+The Pandoc source code and all documentation may be downloaded from
34+<http://sophos.berkeley.edu/macfarlane/pandoc/>.
35+.SH AUTHOR
36+John MacFarlane
man/man1/pandoc.1+1−1
@@ -4,7 +4,7 @@ pandoc \- general markup converter
44.SH SYNOPSIS
55\fBpandoc\fR [\fIoptions\fR] [\fIinput\-file\fR]...
66.SH DESCRIPTION
7−\fBPandoc\fR converts files from one markup format to another. It can
7+\fIPandoc\fR converts files from one markup format to another. It can
88read markdown and (subsets of) reStructuredText, HTML, and LaTeX, and
99it can write markdown, reStructuredText, HTML, LaTeX, RTF, DocBook
1010XML, and S5 HTML slide shows.
osx/uninstall-pandoc+1−1
@@ -8,7 +8,7 @@ if [ "`id -u`" != 0 ]; then \
88 exit 1; \
99fi
1010
11−MAN_PAGES="pandoc.1 markdown2pdf.1 html2markdown.1"
11+MAN_PAGES="pandoc.1 markdown2pdf.1 html2markdown.1 hsmarkdown.1"
1212EXECUTABLES=`echo $MAN_PAGES | sed -e 's#\.1##g'`
1313EXECUTABLES="$EXECUTABLES uninstall-pandoc"
1414DOCUMENTS="`ls /usr/local/share/doc/pandoc`"
web/index.txt+2−2
@@ -35,8 +35,8 @@ you should extract from the zip archive and put somewhere in your
3535PATH). See the included file `README-WINDOWS.txt` for instructions
3636on using the program. Note: If you use [Cygwin], we recommend that
3737you compile Pandoc from source. This will give you access to the
38−wrapper scripts `markdown2pdf` and `html2markdown`, which are not
39−included in the Windows binary package.
38+wrapper scripts `markdown2pdf`, `html2markdown`, and `hsmarkdown`,
39+which are not included in the Windows binary package.
4040
4141[`@TARBALL_NAME@`]: http://pandoc.googlecode.com/files/@TARBALL_NAME@
4242 "Download source tarball from Pandoc's Google Code site"