HTML2WIKI(1)
html2wiki π aka the HTML β wiki markup glow-up machine
okay bestie so this is html2wiki, a user-contributed Perl documentation page (manual section 1, she's iconic like that), and she's about to make your messy HTML look cute in wiki markup. no cap. π
β¨ NAME β¨
html2wiki β convert HTML into wiki markup π¦
β¨ SYNOPSIS β¨
html2wiki [options] [file]
Commonly used options (the ones you'll actually be reaching for, fr fr):
--dialect=dialectβ the dialect name, like"MediaWiki". lowkey required unless you're using theWCDIALECTenvironment variable instead π--encoding=encodingβ source encoding. default is'utf-8'bestie, keep it that way unless you have a reason π--base-uri=uriβ base URI for relative links π--wiki-uri=uriβ URI fragment for wiki links π--wrap-in-htmlβ wrap input in<html>and</html>. enabled by default. Use--no-wrap-in-htmlto disable it π--escape-entitiesβ escape HTML entities within text elements. enabled by default. Use--no-escape-entitiesto disable it π--listβ list installed dialects and exit π--optionsβ list all recognized options (except for negations such as--no-wrap-in-html) π--helpβ show this message and exit π
Additional options, including those corresponding to dialect attributes, are also supported. Consult the html2wiki man page for details π
Example, because seeing it is believing:
html2wiki --dialect MediaWiki --encoding iso-8859-1 \
--base-uri http://en.wikipedia.org/wiki/ \
--wiki-uri http://en.wikipedia.org/wiki/ \
input.html > output.wiki
β¨ DESCRIPTION β¨
"html2wiki" is a command-line interface to HTML::WikiConverter, which it uses to convert HTML to wiki markup. that's the whole vibe, and honestly? she ate. π
β¨ DIALECTS β¨
If the dialect you provide in --dialect is not installed on your system (like, say you specify "MediaWiki" but you never installed its dialect module, HTML::WikiConverter::MediaWiki), a fatal error will be issued. π not a cute look, so don't do that.
Use html2wiki --list to list all available dialects on your system. Additional dialects may be downloaded from the CPAN β there's always more where that came from β¨
β¨ OPTIONS β¨
π« Correspondence of options and attributes
Each of the options accepted by "html2wiki" corresponds to an HTML::WikiConverter attribute. So the commonly used options described in "html2wiki --help" correspond to attributes discussed in "ATTRIBUTES" in HTML::WikiConverter. That section also contains other attributes that may be used as "html2wiki" command-line options. iykyk π§
π« Mapping an attribute name to an option name
While related, option names are not identical to their corresponding attribute names. The only difference is that attribute names use underscores to separate words while option names use hyphens. For example, the "base_uri" attribute corresponds to the --base-uri command-line option. see, they're siblings, not twins π
π« Additional options defined in dialect modules
Individual dialects may define their own attributes, and therefore make available their own command-line options to "html2wiki", in addition to the ones defined by "HTML::WikiConverter". The same rules described above apply for converting between these attribute names and their corresponding command-line option names.
For example, Markdown supports an "unordered_list_style" attribute that takes a string value. To use this attribute on the command line, one would use the --unordered-list-style option. Consult individual dialect man pages for a list of supported attributes π
π« Options that are enabled by default
Attributes that take boolean values may be enabled by default. The "wrap_in_html" attribute is one such example. Because of this, "html2wiki" will effectively behave by default as if --wrap-in-html had been specified in every invocation. If this is not desired, the option name may be prefixed with no- to disable the option, as in --no-wrap-in-html. π«
π« Options that take multiple values
Some attributes (eg, "wiki_uri" and "strip_tags") accept an array of values. To accommodate this in "html2wiki", such options can be specified more than once on the command line. Like, stack 'em, bestie π
For example, to specify that only comment and script elements should be stripped from HTML:
% html2wiki --strip-tags ~comment --strip-tags script ...
β¨ INPUT/OUTPUT β¨
Input is taken from STDIN, so you may pipe the output from another program into "html2wiki". For example:
curl http://example.com/input.html | html2wiki --dialect MediaWiki
You may also specify a file to read HTML from:
html2wiki --dialect MediaWiki input.html
Output is sent to STDOUT, though you may redirect it on the command line:
html2wiki --dialect MediaWiki input.html > output.wiki
Or you may pipe it into another program:
html2wiki --dialect MediaWiki input.html | less
so many options, all of them valid, all of them slaying π
β¨ AUTHOR β¨
David J. Iberri, "<diberri@cpan.org>" β ty king π«Ά
β¨ COPYRIGHT & LICENSE β¨
Copyright 2006 David J. Iberri, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
β¨ SEE ALSO β¨
HTML::WikiConverterβ go read her, she's the main character π
and that's the whole page bestie!! this was perl v5.42.0, dated 2025-07-25, filed under HTML2WIKI(1) β she's been iconic since 2006 and she's still serving β¨π
π
π¦ where this page comes from
- fedora 43: html2wiki 0.68-47.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms