HTML2WIKI(1p)
β¨ HTML2WIKI(1p) β¨
okay bestie, so like β this is html2wiki, the manual page for it, and honestly? it's giving "little command, big power." it converts HTML into wiki markup and it's about to be your new fave. π
πΈ NAME πΈ
html2wiki β convert HTML into wiki markup β¨
π SYNOPSIS π
html2wiki [options] [file]
the options you'll actually use 24/7, no cap:
--dialect=dialect Dialect name, e.g. "MediaWiki" (required unless
the WCDIALECT environment variable is used)
--encoding=encoding Source encoding (default is 'utf-8')
--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-html to disable.
--escape-entities Escape HTML entities within text elements (enabled by
default). Use --no-escape-entities to disable.
--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
lowkey there are more options too β including the ones that line up with dialect attributes. so like, go read the full html2wiki man page for the whole tea. π«
here's a lil example that eats, honestly:
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, and that's the little icon it uses to turn your HTML into wiki markup. one job, doing it flawlessly. periodt. π
π DIALECTS π
so here's the thing, bestie β if the dialect you hand over in --dialect isn't installed on your system, it's over. fatal error, no warning shot. like, if you say MediaWiki but never installed its dialect module, HTML::WikiConverter::MediaWiki? yeah. screaming. π
use html2wiki --list to see every dialect you've got chilling on your system. and if you want more? extra dialects can be downloaded from the CPAN. collect them like pokΓ©mon, fr fr. β¨
π OPTIONS π
π Correspondence of options and attributes
every single option html2wiki accepts corresponds to an HTML::WikiConverter attribute. so the commonly used options described in html2wiki --help? those match up with the attributes discussed in "ATTRIBUTES" in HTML::WikiConverter. and btw that section also has other attributes you can absolutely use as html2wiki command-line options. it's a whole buffet. π
π Mapping an attribute name to an option name
they're related, yeah, but option names and attribute names are not identical β and the only difference is the separator: attribute names use underscores to split words up, option names use hyphens.
example, since i know you want one: the base_uri attribute β the --base-uri command-line option. that's it, that's the whole rule. π
π Additional options defined in dialect modules
individual dialects can define their own attributes, which means they get to hand html2wiki their own command-line options on top of the ones HTML::WikiConverter defines. and the same conversion rules from above apply here too, no exceptions.
for example β Markdown supports an unordered_list_style attribute that takes a string value. to use that attribute on the command line you'd write the --unordered-list-style option. see how it works? iconic. π
heads up: go consult the individual dialect man pages for the list of attributes each one supports. i can't do everything for you, bestie. π
π Options that are enabled by default
attributes that take boolean values can be enabled by default, and wrap_in_html is literally the poster child for this. so html2wiki will effectively act by default like --wrap-in-html was typed in every single invocation. every. one. π
not feeling it? prefix the option name with no- to turn it off, like --no-wrap-in-html. easy. slay. β¨
π Options that take multiple values
some attributes (looking at you, wiki_uri and strip_tags) accept an array of values. to make that work in html2wiki, you just specify those options more than once on the command line. yes, really, that's the trick. π§
so if you wanted only comment and script elements stripped from the HTML:
% html2wiki --strip-tags ~comment --strip-tags script ...
see? repeat the flag. ate. π₯
π INPUT/OUTPUT π
input comes from STDIN, which means you can pipe another program's output straight into html2wiki. main character energy:
curl http://example.com/input.html | html2wiki --dialect MediaWiki
you can also just hand it a file to read HTML from:
html2wiki --dialect MediaWiki input.html
output goes to STDOUT, but you can redirect that on the command line whenever:
html2wiki --dialect MediaWiki input.html > output.wiki
or pipe it into another program, because why not:
html2wiki --dialect MediaWiki input.html | less
flexible? obsessed. πΈ
β AUTHOR β
David J. Iberri, "<diberri@cpan.org>"
π 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
okay that's the whole page bestie, you're officially certified πβ¨ β this was HTML2WIKI(1p), documented under perl v5.34.0 and dated 2022-06-14. go forth and convert, no cap π
π
π¦ where this page comes from
- debian bookworm: libhtml-wikiconverter-perl 0.68-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libhtml-wikiconverter-perl 0.68-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-wikiconverter-perl 0.68-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-wikiconverter-perl 0.68-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhtml-wikiconverter-perl 0.68-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms