HTML::...iaWiki(3pm)

πŸ“¦
version 0.59 Β· 2 versions
  • 0.59 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.59 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 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