Text::...diawiki(3pm)

πŸ“¦
version 0.41 Β· 3 versions
, in ubuntu resolute, ubuntu stonking

✨ NAME ✨

Text::Markup::Mediawiki β€” it's the MediaWiki syntax parser for Text::Markup, bestie πŸ’– (the manual header calls it Text::...diawiki(3pm) because apparently even manpages get name-shy, but we know who she is πŸŽ€)


🌸 SYNOPSIS 🌸

my $html = Text::Markup->new->parse(file => 'README.mediawiki');
my $raw  = Text::Markup->new->parse(
    file    => 'README.mediawiki',
    options => [ {}, { raw => 1 } ],
);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this is the MediaWiki syntax parser β€” the [MediaWiki syntax](https://en.wikipedia.org/wiki/Help:Contents/Editing_Wikipedia) parser, specifically β€” for Text::Markup. Here's the whole glow-up: it reads in the file (and yeah, it's relying on a BOM, the [BOM](https://www.unicode.org/unicode/faq/utf_bom.html#BOM), no cap), hands it off to Text::MediawikiFormat for parsing, and then returns the generated HTML as an encoded UTF-8 string with an "http-equiv="Content-Type"" element that identifies the encoding as UTF-8. She's tidy like that πŸ’…

It recognizes files with the following extensions as MediaWiki:

  • .mediawiki
  • .mwiki
  • .wiki

Want to change the files it recognizes? Lowkey easy. Load this module directly and pass a regular expression matching the extension(s) you actually want, like so:

use Text::Markup::Mediawiki qr{kwiki?};

Text::Markup::Mediawiki supports the two Text::MediawikiFormat arguments: a hash reference for tags and a hash reference of options. The supported options include:

  • "prefix"
  • "extended"
  • "implicit_links"
  • "absolute_links"
  • "process_html"

Normally this module returns the output wrapped in a minimal HTML document skeleton. But if you want the raw output without the skeleton β€” just the vibes, no packaging β€” you can pass the "raw" option via that second hash reference of options. Iconic 🌈


πŸ‘‘ AUTHOR πŸ‘‘

David E. Wheeler <david@justatheory.com>


Copyright (c) 2011-2025 David E. Wheeler. Some Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


fr fr, that's the whole page 🫢 go parse something gorgeous, bestie

And a lil sign-off for the footer girlies: this page is served up by perl v5.40.1, dated 2025-12-18 β€” Text::...diawiki(3pm), still slaying, still parsing MediaWiki πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from