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
This commit is contained in:
parent
89f2468f38
commit
5387ebd8db
8 changed files with 70 additions and 16 deletions
2
Makefile
2
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')
|
||||
|
|
32
README
32
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"
|
||||
|
|
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -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.
|
||||
|
|
5
hsmarkdown
Executable file
5
hsmarkdown
Executable file
|
@ -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 -- "$@"
|
36
man/man1/hsmarkdown.1
Normal file
36
man/man1/hsmarkdown.1
Normal file
|
@ -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
|
|
@ -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.
|
||||
|
|
|
@ -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`"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue