HTML::...iaWiki(3pm)
π HTML::WikiConverter::MediaWiki π
okay bestie, welcome to the MediaWiki dialect of HTML::WikiConverter (yes it's a 3pm page, User Contributed Perl Documentation, we love a user contribution era β¨). This one's your little conversion fairy π§ that turns HTML into MediaWiki markup, no cap.
β¨ SYNOPSIS β¨
lowkey the whole vibe in three lines:
use HTML::WikiConverter;
my $wc = new HTML::WikiConverter( dialect => 'MediaWiki' );
print $wc->html2wiki( $html );
that's it. that's the spell. π
πΈ DESCRIPTION πΈ
so this module is literally just the rulebook π for converting HTML into MediaWiki markup. that's its whole job, its main character moment.
if you want the rest of the usage tea, go read HTML::WikiConverter, because this page is only covering the extras. iykyk.
π ATTRIBUTES π
okay so besides the normal set of attributes that the HTML::WikiConverter constructor already knows and loves, this dialect also accepts these lil guys below. each one is a Boolean, so it's a yes/no, true/false, slay/not-slay situation. π
preserve_bold
Boolean that says whether bold HTML elements should be preserved as HTML in the wiki output instead of getting converted into MediaWiki markup.
by default, <b> and <strong> elements both get converted into wiki markup identically (same treatment, no favorites π). but sometimes you want the <b> tags from the HTML to just... stay as <b> tags in the resulting MediaWiki markup. this attribute is how you make that happen.
so like, if preserve_bold is enabled, HTML that looks like
<ul>
<li> <b>Bold</b>
<li> <strong>Strong</strong>
</ul>
gets converted into
* <b>Bold</b>
* '''Strong'''
and when it's disabled (which is the default), that same HTML markup above would instead come out as
* '''Bold'''
* '''Strong'''
periodt. π
preserve_italic
Boolean saying whether italic HTML elements should be preserved as HTML in the wiki output instead of being converted into MediaWiki markup.
for example, if preserve_italic is enabled, HTML like
<ul>
<li> <i>Italic</i>
<li> <em>Emphasized</em>
</ul>
gets converted to
* <i>Italic</i>
* ''Emphasized''
and when disabled (again, the default), that same markup would convert into
* ''Italic''
* ''Emphasized''
no notes, gorgeous. β¨
preserve_templates
Boolean indicating whether {{template}} calls found in the HTML should be preserved in the wiki markup. if it's disabled (the default, bestie), those template calls get wrapped in <nowiki> tags. π«Ά
preserve_nowiki
Boolean indicating whether <nowiki> tags found in the HTML should be preserved in the wiki markup. if it's disabled (yep, default), the nowiki tags get replaced with their content instead. π¦
pad_headings
Boolean indicating whether section headings should be padded with spaces β like == Section == instead of ==Section==. the default is false, meaning no padding, we keep it tight. πΈ
π AUTHOR π
David J. Iberri, "<diberri at cpan.org>" β we stan. π
π BUGS π
please report any bugs or feature requests to "bug-html-wikiconverter-mediawiki at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-WikiConverter-MediaWiki>.
and the way this works is: I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. so you're never left on read, fr fr. π₯
π«Ά SUPPORT π«Ά
you can find the documentation for this module with the perldoc command:
perldoc HTML::WikiConverter::MediaWiki
you can also go hunting for info at these iconic spots:
- AnnoCPAN: Annotated CPAN documentation
<http://annocpan.org/dist/HTML-WikiConverter-MediaWiki>
- CPAN Ratings
<http://cpanratings.perl.org/d/HTML-WikiConverter-MediaWiki>
- RT: CPAN's request tracker
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTML-WikiConverter-MediaWiki>
- Search CPAN
<http://search.cpan.org/dist/HTML-WikiConverter-MediaWiki>
π 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. β¨
and that's the whole page bestie β this one's from perl v5.34.0, dated 2022-06-14, and it lives under the manual name HTML::...iaWiki(3pm). go convert something cute. bye bye! πππ¦
π¦ where this page comes from
- debian bookworm: libhtml-wikiconverter-mediawiki-perl 0.59-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libhtml-wikiconverter-mediawiki-perl 0.59-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-wikiconverter-mediawiki-perl 0.59-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-wikiconverter-mediawiki-perl 0.59-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhtml-wikiconverter-mediawiki-perl 0.59-3 Β· 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