git.iko.soy/typeable/pandoc
on 1.0 help sign in
typeable/pandoc/man/man1/html2markdown.1.md
95 lines 3.1 kB history raw
1% HTML2MARKDOWN(1) Pandoc User Manuals
2% John MacFarlane and Recai Oktas
3% January 8, 2008
5# NAME
7html2markdown - converts HTML to markdown-formatted text
9# SYNOPSIS
11html2markdown [*pandoc-options*] [\-- *special-options*] [*input-file* or
12*URL*]
14# DESCRIPTION
16`html2markdown` converts *input-file* or *URL* (or text
17from *stdin*) from HTML to markdown-formatted plain text.
18If a URL is specified, `html2markdown` uses an available program
19(e.g. wget, w3m, lynx or curl) to fetch its contents. Output is sent
20to *stdout* unless an output file is specified using the `-o`
21option.
23`html2markdown` uses the character encoding specified in the
24"Content-type" meta tag. If this is not present, or if input comes
25from *stdin*, UTF-8 is assumed. A character encoding may be specified
26explicitly using the `-e` special option.
28# OPTIONS
30`html2markdown` is a wrapper for `pandoc`, so all of
31`pandoc`'s options may be used. See `pandoc`(1) for
32a complete list. The following options are most relevant:
34-s, \--standalone
35: Include title, author, and date information (if present) at the
36 top of markdown output.
38-o *FILE*, \--output=*FILE*
39: Write output to *FILE* instead of *stdout*.
41\--strict
42: Use strict markdown syntax, with no extensions or variants.
44\--reference-links
45: Use reference-style links, rather than inline links, in writing markdown
46 or reStructuredText.
48-R, \--parse-raw
49: Parse untranslatable HTML codes as raw HTML.
51\--no-wrap
52: Disable text wrapping in output. (Default is to wrap text.)
54-H *FILE*, \--include-in-header=*FILE*
55: Include contents of *FILE* at the end of the header. Implies
56 `-s`.
58-B *FILE*, \--include-before-body=*FILE*
59: Include contents of *FILE* at the beginning of the document body.
61-A *FILE*, \--include-after-body=*FILE*
62: Include contents of *FILE* at the end of the document body.
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`.
69# SPECIAL OPTIONS
71In addition, the following special options may be used. The special
72options must be separated from the `html2markdown` command and any
73regular `pandoc` options by the delimiter \``--`', as in
75 html2markdown -o foo.txt -- -g 'curl -u bar:baz' -e latin1 \
76 www.foo.com
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.
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.)
93# SEE ALSO
95`pandoc`(1), `iconv`(1)