git.iko.soy/typeable/pandoc
on master help sign in
Removed html2markdown and hsmarkdown.

html2markdown is no longer needed, since you can pass URI arguments to pandoc and directly convert web pages. (Note, however, that pandoc assumes the pages are UTF8. html2markdown made an attempt to guess the encoding and convert them.) hsmarkdown is pointless -- a large executable that could be replaced by 'pandoc --strict'. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1834 788f1e2b-df1e-0410-8736-df70ead52e1b

commit997ea5ea1d02e31bb8a9b03e3db26684cc81ac59 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 6 Feb 2010, 18:55 (17 years ago) parent645d5d4
7 files changed+44−506
README+39−83 Setup.hs+2−2 html2markdown−221 man/man1/hsmarkdown.1.md−42 man/man1/html2markdown.1.md−95 pandoc.cabal+3−16 src/hsmarkdown.hs−47
README+39−83
@@ -127,92 +127,49 @@ will convert `source.txt` from the local encoding to UTF-8, then
127127convert it to HTML, then convert back to the local encoding,
128128putting the output in `output.html`.
129129
130−The wrapper scripts (described below) automatically convert the input
131−from the local encoding to UTF-8 before running them through `pandoc`,
132−then convert the output back to the local encoding.
133−
134130Wrappers
135131========
136132
137−Three wrapper scripts, `markdown2pdf`, `html2markdown`, and
138−`hsmarkdown`, are included in the standard Pandoc installation. (The
139−Windows binary package does not include `html2markdown`, which is
140−a POSIX shell script. It does include portable Haskell versions of
141−`markdown2pdf` and `hsmarkdown`.)
142−
143−1. `markdown2pdf` produces a PDF file from markdown-formatted
144− text, using `pandoc` and `pdflatex`. The default
145− behavior of `markdown2pdf` is to create a file with the same
146− base name as the first argument and the extension `pdf`; thus,
147− for example,
148−
149− markdown2pdf sample.txt endnotes.txt
150−
151− will produce `sample.pdf`. (If `sample.pdf` exists already,
152− it will be backed up before being overwritten.) An output file
153− name can be specified explicitly using the `-o` option:
154−
155− markdown2pdf -o book.pdf chap1 chap2
156−
157− If no input file is specified, input will be taken from stdin.
158− All of `pandoc`'s options will work with `markdown2pdf` as well.
159−
160− `markdown2pdf` assumes that `pdflatex` is in the path. It also
161− assumes that the following LaTeX packages are available:
162− `unicode`, `fancyhdr` (if you have verbatim text in footnotes),
163− `graphicx` (if you use images), `array` (if you use tables),
164− and `ulem` (if you use strikeout text). If they are not already
165− included in your LaTeX distribution, you can get them from
166− [CTAN]. A full [TeX Live] or [MacTeX] distribution will have all of
167− these packages.
168−
169−2. `html2markdown` grabs a web page from a file or URL and converts
170− it to markdown-formatted text, using `tidy` and `pandoc`.
171−
172− All of `pandoc`'s options will work with `html2markdown` as well.
173− In addition, the following special options may be used.
174− The special options must be separated from the `html2markdown`
175− command and any regular Pandoc options by the delimiter `--`:
176−
177− html2markdown -o out.txt -- -e latin1 -g curl google.com
178−
179− The `-e` or `--encoding` option specifies the character encoding
180− of the HTML input. If this option is not specified, and input
181− is not from stdin, `html2markdown` will attempt to determine the
182− page's character encoding from the "Content-type" meta tag.
183− If this is not present, UTF-8 is assumed.
184−
185− The `-g` or `--grabber` option specifies the command to be used to
186− fetch the contents of a URL:
187−
188− html2markdown -g 'curl --user foo:bar' www.mysite.com
189−
190− If this option is not specified, `html2markdown` searches for an
191− available program (`wget`, `curl`, or a text-mode browser) to fetch
192− the contents of a URL.
193−
194− `html2markdown` requires [HTML Tidy], which must be in the path.
195− It uses [`iconv`] for character encoding conversions; if `iconv`
196− is absent, it will still work, but it will treat everything as UTF-8.
197−
198−3. `hsmarkdown` is designed to be used as a drop-in replacement for
199− `Markdown.pl`. It forces `pandoc` to convert from markdown to
200− HTML, and to use the `--strict` flag for maximal compliance with
201− official markdown syntax. (All of Pandoc's syntax extensions and
202− variants, described below, are disabled.) No other command-line
203− options are allowed. (In fact, options will be interpreted as
204− filenames.)
205−
206− As an alternative to using the `hsmarkdown` script, the
207− user may create a symbolic link to `pandoc` called `hsmarkdown`.
208− When invoked under the name `hsmarkdown`, `pandoc` will behave
209− as if the `--strict` flag had been selected, and no command-line
210− options will be recognized. However, this approach does not work
211− under Cygwin, due to problems with its simulation of symbolic
212− links.
133+`markdown2pdf`
134+--------------
135+
136+The standard Pandoc installation includes `markdown2pdf`, a wrapper
137+around `pandoc` and `pdflatex` that produces PDFs directly from markdown
138+sources. The default behavior of `markdown2pdf` is to create a file with
139+the same base name as the first argument and the extension `pdf`; thus,
140+for example,
141+
142+ markdown2pdf sample.txt endnotes.txt
143+
144+will produce `sample.pdf`. (If `sample.pdf` exists already,
145+it will be backed up before being overwritten.) An output file
146+name can be specified explicitly using the `-o` option:
147+
148+ markdown2pdf -o book.pdf chap1 chap2
149+
150+If no input file is specified, input will be taken from stdin.
151+All of `pandoc`'s options will work with `markdown2pdf` as well.
152+
153+`markdown2pdf` assumes that `pdflatex` is in the path. It also
154+assumes that the following LaTeX packages are available:
155+`unicode`, `fancyhdr` (if you have verbatim text in footnotes),
156+`graphicx` (if you use images), `array` (if you use tables),
157+and `ulem` (if you use strikeout text). If they are not already
158+included in your LaTeX distribution, you can get them from
159+[CTAN]. A full [TeX Live] or [MacTeX] distribution will have all of
160+these packages.
161+
162+`hsmarkdown`
163+------------
164+
165+A user who wants a drop-in replacement for `Markdown.pl` may create
166+a symbolic link to the `pandoc` executable called `hsmarkdown`. When
167+invoked under the name `hsmarkdown`, `pandoc` will behave as if the
168+`--strict` flag had been selected, and no command-line options will be
169+recognized. However, this approach does not work under Cygwin, due to
170+problems with its simulation of symbolic links.
213171
214172[Cygwin]: http://www.cygwin.com/
215−[HTML Tidy]: http://tidy.sourceforge.net/
216173[`iconv`]: http://www.gnu.org/software/libiconv/
217174[CTAN]: http://www.ctan.org "Comprehensive TeX Archive Network"
218175[TeX Live]: http://www.tug.org/texlive/
@@ -562,8 +519,7 @@ Pandoc's markdown vs. standard markdown
562519
563520In parsing markdown, Pandoc departs from and extends [standard markdown]
564521in a few respects. Except where noted, these differences can
565−be suppressed by specifying the `--strict` command-line option or by
566−using the `hsmarkdown` wrapper.
522+be suppressed by specifying the `--strict` command-line option.
567523
568524[standard markdown]: http://daringfireball.net/projects/markdown/syntax
569525 "Markdown syntax description"
Setup.hs+2−2
@@ -51,7 +51,7 @@ makeManPages :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO
5151makeManPages _ flags _ _ = mapM_ (makeManPage (fromFlag $ buildVerbosity flags)) manpages
5252
5353manpages :: [FilePath]
54−manpages = ["pandoc.1", "hsmarkdown.1", "html2markdown.1", "markdown2pdf.1"]
54+manpages = ["pandoc.1", "markdown2pdf.1"]
5555
5656manDir :: FilePath
5757manDir = "man" </> "man1"
@@ -80,7 +80,7 @@ installScripts pkg lbi verbosity copy =
8080 (zip (repeat ".") (wrappers \\ exes))
8181 where exes = map exeName $ filter isBuildable $ executables pkg
8282 isBuildable = buildable . buildInfo
83− wrappers = ["html2markdown", "hsmarkdown", "markdown2pdf"]
83+ wrappers = ["markdown2pdf"]
8484
8585installManpages :: PackageDescription -> LocalBuildInfo
8686 -> Verbosity -> CopyDest -> IO ()
html2markdowndeleted−221
@@ -1,221 +0,0 @@
1−#!/bin/sh -e
2−# converts HTML from a URL, file, or stdin to markdown
3−# uses an available program to fetch URL and tidy to normalize it first
4−
5−REQUIRED="tidy"
6−SYNOPSIS="converts HTML from a URL, file, or STDIN to markdown-formatted text."
7−
8−THIS=${0##*/}
9−
10−NEWLINE='
11−'
12−
13−err () { echo "$*" | fold -s -w ${COLUMNS:-110} >&2; }
14−errn () { printf "$*" | fold -s -w ${COLUMNS:-110} >&2; }
15−
16−usage () {
17− err "$1 - $2" # short description
18− err "See the $1(1) man page for usage."
19−}
20−
21−# Portable which(1).
22−pathfind () {
23− oldifs="$IFS"; IFS=':'
24− for _p in $PATH; do
25− if [ -x "$_p/$*" ] && [ -f "$_p/$*" ]; then
26− IFS="$oldifs"
27− return 0
28− fi
29− done
30− IFS="$oldifs"
31− return 1
32−}
33−
34−for p in pandoc $REQUIRED; do
35− pathfind $p || {
36− err "You need '$p' to use this program!"
37− exit 1
38− }
39−done
40−
41−CONF=$(pandoc --dump-args "$@" 2>&1) || {
42− errcode=$?
43− echo "$CONF" | sed -e '/^pandoc \[OPTIONS\] \[FILES\]/,$d' >&2
44− [ $errcode -eq 2 ] && usage "$THIS" "$SYNOPSIS"
45− exit $errcode
46−}
47−
48−OUTPUT=$(echo "$CONF" | sed -ne '1p')
49−ARGS=$(echo "$CONF" | sed -e '1d')
50−
51−
52−grab_url_with () {
53− url="${1:?internal error: grab_url_with: url required}"
54−
55− shift
56− cmdline="$@"
57−
58− prog=
59− prog_opts=
60− if [ -n "$cmdline" ]; then
61− eval "set -- $cmdline"
62− prog=$1
63− shift
64− prog_opts="$@"
65− fi
66−
67− if [ -z "$prog" ]; then
68− # Locate a sensible web grabber (note the order).
69− for p in wget lynx w3m curl links w3c; do
70− if pathfind $p; then
71− prog=$p
72− break
73− fi
74− done
75−
76− [ -n "$prog" ] || {
77− errn "$THIS: Couldn't find a program to fetch the file from URL "
78− err "(e.g. wget, w3m, lynx, w3c, or curl)."
79− return 1
80− }
81− else
82− pathfind "$prog" || {
83− err "$THIS: No such web grabber '$prog' found; aborting."
84− return 1
85− }
86− fi
87−
88− # Setup proper base options for known grabbers.
89− base_opts=
90− case "$prog" in
91− wget) base_opts="-O-" ;;
92− lynx) base_opts="-source" ;;
93− w3m) base_opts="-dump_source" ;;
94− curl) base_opts="" ;;
95− links) base_opts="-source" ;;
96− w3c) base_opts="-n -get" ;;
97− *) err "$THIS: unhandled web grabber '$prog'; hope it succeeds."
98− esac
99−
100− err "$THIS: invoking '$prog $base_opts $prog_opts $url'..."
101− eval "set -- $base_opts $prog_opts"
102− $prog "$@" "$url"
103−}
104−
105−# Parse command-line arguments
106−parse_arguments () {
107− while [ $# -gt 0 ]; do
108− case "$1" in
109− --encoding=*)
110− wholeopt="$1"
111− # extract encoding from after =
112− encoding="${wholeopt#*=}" ;;
113− -e|--encoding|-encoding)
114− shift
115− encoding="$1" ;;
116− --grabber=*)
117− wholeopt="$1"
118− # extract encoding from after =
119− grabber="\"${wholeopt#*=}\"" ;;
120− -g|--grabber|-grabber)
121− shift
122− grabber="$1" ;;
123− *)
124− if [ -z "$argument" ]; then
125− argument="$1"
126− else
127− err "Warning: extra argument '$1' will be ignored."
128− fi ;;
129− esac
130− shift
131− done
132−}
133−
134−argument=
135−encoding=
136−grabber=
137−
138−oldifs="$IFS"
139−IFS=$NEWLINE
140−parse_arguments $ARGS
141−IFS="$oldifs"
142−
143−inurl=
144−if [ -n "$argument" ] && ! [ -f "$argument" ]; then
145− # Treat given argument as an URL.
146− inurl="$argument"
147−fi
148−
149−# As a security measure refuse to proceed if mktemp is not available.
150−pathfind mktemp || { err "Couldn't find 'mktemp'; aborting."; exit 1; }
151−
152−# Avoid issues with /tmp directory on Windows/Cygwin
153−cygwin=
154−cygwin=$(uname | sed -ne '/^CYGWIN/p')
155−if [ -n "$cygwin" ]; then
156− TMPDIR=.
157− export TMPDIR
158−fi
159−
160−THIS_TEMPDIR=
161−THIS_TEMPDIR="$(mktemp -d -t $THIS.XXXXXXXX)" || exit 1
162−readonly THIS_TEMPDIR
163−
164−trap 'exitcode=$?
165− [ -z "$THIS_TEMPDIR" ] || rm -rf "$THIS_TEMPDIR"
166− exit $exitcode' 0 1 2 3 13 15
167−
168−if [ -n "$inurl" ]; then
169− err "Attempting to fetch file from '$inurl'..."
170−
171− grabber_out=$THIS_TEMPDIR/grabber.out
172− grabber_log=$THIS_TEMPDIR/grabber.log
173− if ! grab_url_with "$inurl" "$grabber" 1>$grabber_out 2>$grabber_log; then
174− errn "grab_url_with failed"
175− if [ -f $grabber_log ]; then
176− err " with the following error log."
177− err
178− cat >&2 $grabber_log
179− else
180− err .
181− fi
182− exit 1
183− fi
184−
185− argument="$grabber_out"
186−fi
187−
188−if [ -z "$encoding" ] && [ "x$argument" != "x" ]; then
189− # Try to determine character encoding if not specified
190− # and input is not STDIN.
191− encoding=$(
192− head "$argument" |
193− LC_ALL=C tr 'A-Z' 'a-z' |
194− sed -ne '/<meta .*content-type.*charset=/ {
195− s/.*charset=["'\'']*\([-a-zA-Z0-9]*\).*["'\'']*/\1/p
196− }'
197− )
198−fi
199−
200−if [ -n "$encoding" ] && pathfind iconv; then
201− alias to_utf8='iconv -f "$encoding" -t utf-8'
202−else # assume UTF-8
203− alias to_utf8='cat'
204−fi
205−
206−htmlinput=$THIS_TEMPDIR/htmlinput
207−
208−if [ -z "$argument" ]; then
209− to_utf8 > $htmlinput # read from STDIN
210−elif [ -f "$argument" ]; then
211− to_utf8 "$argument" > $htmlinput # read from file
212−else
213− err "File '$argument' not found."
214− exit 1
215−fi
216−
217−if ! cat $htmlinput | pandoc --ignore-args -r html -w markdown "$@" ; then
218− err "Failed to parse HTML. Trying again with tidy..."
219− tidy -q -asxhtml -utf8 $htmlinput | \
220− pandoc --ignore-args -r html -w markdown "$@"
221−fi
man/man1/hsmarkdown.1.mddeleted−42
@@ -1,42 +0,0 @@
1−% HSMARKDOWN(1) Pandoc User Manuals
2−% John MacFarlane
3−% January 8, 2008
4−
5−# NAME
6−
7−hsmarkdown - convert markdown-formatted text to HTML
8−
9−# SYNOPSIS
10−
11−hsmarkdown [*input-file*]...
12−
13−# DESCRIPTION
14−
15−`hsmarkdown` converts markdown-formatted text to HTML. It is designed
16−to be usable as a drop-in replacement for John Gruber's `Markdown.pl`.
17−
18−If no *input-file* is specified, input is read from *stdin*.
19−Otherwise, the *input-files* are concatenated (with a blank
20−line between each) and used as input. Output goes to *stdout* by
21−default. For output to a file, use shell redirection:
22−
23− hsmarkdown input.txt > output.html
24−
25−`hsmarkdown` uses the UTF-8 character encoding for both input and output.
26−If your local character encoding is not UTF-8, you should pipe input
27−and output through `iconv`:
28−
29− iconv -t utf-8 input.txt | hsmarkdown | iconv -f utf-8
30−
31−`hsmarkdown` is implemented as a wrapper around `pandoc`(1). It
32−calls `pandoc` with the options `--from markdown --to html
33−--strict` and disables all other options. (Command-line options
34−will be interpreted as filenames, as they are by `Markdown.pl`.)
35−
36−# SEE ALSO
37−
38−`pandoc`(1). The *README*
39−file distributed with Pandoc contains full documentation.
40−
41−The Pandoc source code and all documentation may be downloaded from
42−<http://johnmacfarlane.net/pandoc/>.
man/man1/html2markdown.1.mddeleted−95
@@ -1,95 +0,0 @@
1−% HTML2MARKDOWN(1) Pandoc User Manuals
2−% John MacFarlane and Recai Oktas
3−% January 8, 2008
4−
5−# NAME
6−
7−html2markdown - converts HTML to markdown-formatted text
8−
9−# SYNOPSIS
10−
11−html2markdown [*pandoc-options*] [\-- *special-options*] [*input-file* or
12−*URL*]
13−
14−# DESCRIPTION
15−
16−`html2markdown` converts *input-file* or *URL* (or text
17−from *stdin*) from HTML to markdown-formatted plain text.
18−If a URL is specified, `html2markdown` uses an available program
19−(e.g. wget, w3m, lynx or curl) to fetch its contents. Output is sent
20−to *stdout* unless an output file is specified using the `-o`
21−option.
22−
23−`html2markdown` uses the character encoding specified in the
24−"Content-type" meta tag. If this is not present, or if input comes
25−from *stdin*, UTF-8 is assumed. A character encoding may be specified
26−explicitly using the `-e` special option.
27−
28−# OPTIONS
29−
30−`html2markdown` is a wrapper for `pandoc`, so all of
31−`pandoc`'s options may be used. See `pandoc`(1) for
32−a complete list. The following options are most relevant:
33−
34−-s, \--standalone
35−: Include title, author, and date information (if present) at the
36− top of markdown output.
37−
38−-o *FILE*, \--output=*FILE*
39−: Write output to *FILE* instead of *stdout*.
40−
41−\--strict
42−: Use strict markdown syntax, with no extensions or variants.
43−
44−\--reference-links
45−: Use reference-style links, rather than inline links, in writing markdown
46− or reStructuredText.
47−
48−-R, \--parse-raw
49−: Parse untranslatable HTML codes as raw HTML.
50−
51−\--no-wrap
52−: Disable text wrapping in output. (Default is to wrap text.)
53−
54−-H *FILE*, \--include-in-header=*FILE*
55−: Include contents of *FILE* at the end of the header. Implies
56− `-s`.
57−
58−-B *FILE*, \--include-before-body=*FILE*
59−: Include contents of *FILE* at the beginning of the document body.
60−
61−-A *FILE*, \--include-after-body=*FILE*
62−: Include contents of *FILE* at the end of the document body.
63−
64−-C *FILE*, \--custom-header=*FILE*
65−: Use contents of *FILE*
66− as the document header (overriding the default header, which can be
67− printed using `pandoc -D markdown`). Implies `-s`.
68−
69−# SPECIAL OPTIONS
70−
71−In addition, the following special options may be used. The special
72−options must be separated from the `html2markdown` command and any
73−regular `pandoc` options by the delimiter \``--`', as in
74−
75− html2markdown -o foo.txt -- -g 'curl -u bar:baz' -e latin1 \
76− www.foo.com
77−
78−-e *encoding*, \--encoding=*encoding*
79−: Assume the character encoding *encoding* in reading HTML.
80− (Note: *encoding* will be passed to `iconv`; a list of
81− available encodings may be obtained using `iconv -l`.)
82− If this option is not specified and input is not from
83− *stdin*, `html2markdown` will try to extract the character encoding
84− from the "Content-type" meta tag. If no character encoding is
85− specified in this way, or if input is from *stdin*, UTF-8 will be
86− assumed.
87−
88−-g *command*, \--grabber=*command*
89−: Use *command* to fetch the contents of a URL. (By default,
90− `html2markdown` searches for an available program or text-based
91− browser to fetch the contents of a URL.)
92−
93−# SEE ALSO
94−
95−`pandoc`(1), `iconv`(1)
pandoc.cabal+3−16
@@ -59,11 +59,10 @@ Data-Files:
5959 -- documentation
6060 README, INSTALL, COPYRIGHT, BUGS, changelog,
6161 -- wrappers
62− markdown2pdf, html2markdown, hsmarkdown
62+ markdown2pdf
6363Extra-Source-Files:
6464 -- sources for man pages
6565 man/man1/pandoc.1.md, man/man1/markdown2pdf.1.md,
66− man/man1/html2markdown.1.md, man/man1/hsmarkdown.1.md,
6766 -- tests
6867 tests/bodybg.gif,
6968 tests/writer.latex,
@@ -120,8 +119,7 @@ Extra-Source-Files:
120119 tests/lhs-test.html+lhs,
121120 tests/lhs-test.fragment.html+lhs,
122121 tests/RunTests.hs
123−Extra-Tmp-Files: man/man1/pandoc.1, man/man1/hsmarkdown.1,
124− man/man1/html2markdown.1, man/man1/markdown2pdf.1
122+Extra-Tmp-Files: man/man1/pandoc.1, man/man1/markdown2pdf.1
125123
126124Flag highlighting
127125 Description: Compile in support for syntax highlighting of code blocks.
@@ -130,7 +128,7 @@ Flag executable
130128 Description: Build the pandoc executable.
131129 Default: True
132130Flag wrappers
133− Description: Build the wrappers (hsmarkdown, markdown2pdf).
131+ Description: Build the wrappers (markdown2pdf).
134132 Default: True
135133Flag library
136134 Description: Build the pandoc library.
@@ -219,17 +217,6 @@ Executable pandoc
219217 else
220218 Buildable: False
221219
222−Executable hsmarkdown
223− Hs-Source-Dirs: src
224− Main-Is: hsmarkdown.hs
225− Ghc-Options: -Wall -threaded
226− Ghc-Prof-Options: -auto-all
227− Extensions: CPP
228− if flag(wrappers)
229− Buildable: True
230− else
231− Buildable: False
232−
233220Executable markdown2pdf
234221 Hs-Source-Dirs: src
235222 Main-Is: markdown2pdf.hs
src/hsmarkdown.hsdeleted−47
@@ -1,47 +0,0 @@
1−{-
2−Copyright (C) 2006-8 John MacFarlane <jgm@berkeley.edu>
3−
4−This program is free software; you can redistribute it and/or modify
5−it under the terms of the GNU General Public License as published by
6−the Free Software Foundation; either version 2 of the License, or
7−(at your option) any later version.
8−
9−This program is distributed in the hope that it will be useful,
10−but WITHOUT ANY WARRANTY; without even the implied warranty of
11−MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12−GNU General Public License for more details.
13−
14−You should have received a copy of the GNU General Public License
15−along with this program; if not, write to the Free Software
16−Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17−-}
18−
19−{- |
20− Copyright : Copyright (C) 2009 John MacFarlane
21− License : GNU GPL, version 2 or above
22−
23− Maintainer : John MacFarlane <jgm@berkeley@edu>
24− Stability : alpha
25− Portability : portable
26−
27−Wrapper around pandoc that emulates Markdown.pl as closely as possible.
28−-}
29−module Main where
30−import System.Process
31−import System.Environment ( getArgs )
32−-- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv
33−-- So we use System.IO.UTF8 only if we have an earlier version
34−#if MIN_VERSION_base(4,2,0)
35−#else
36−import Prelude hiding ( putStr, putStrLn, writeFile, readFile, getContents )
37−import System.IO.UTF8
38−#endif
39−import Control.Monad (forM_)
40−
41−main :: IO ()
42−main = do
43− files <- getArgs
44− let runPandoc inp = readProcess "pandoc" ["--from", "markdown", "--to", "html", "--strict"] inp >>= putStrLn
45− if null files
46− then getContents >>= runPandoc
47− else forM_ files $ \f -> readFile f >>= runPandoc