Text::...:Blocks(3pm)
π NAME π
Text::MediawikiFormat::Blocks β bestie, this is the home of the blocktypes for Text::MediawikiFormat. That's it, that's the whole job. π
β¨ SYNOPSIS β¨
okay so. there is literally nothing to call here directly:
None.
No cap. You use Text::MediawikiFormat as the public interface, unless β and only unless β you're feeling brave and want to create your own block type. Main character energy only. π
π¦ DESCRIPTION π¦
So this module lowkey just makes subclasses of Text::MediawikiFormat::Block, which is where the actually interesting code lives. This one's the sparkly little wardrobe of block outfits. π
A block, for the uninitiated, is a collection of related lines. Like:
- a code block (text to display verbatim in a monospaced font)
- a header
- an unordered list
- an ordered list
- a paragraph (text to display in a proportional font)
And every single block extends Text::MediawikiFormat::Block. Every one. No exceptions, fr fr.
πΈ METHODS πΈ
The following methods exist:
new( %args )β creates and returns a new block. Iconic behaviour. The valid arguments are:textβ the text of the line found in the block.argsβ the arguments captured by the block-identifying regular expression.levelβ the level of indentation for the block (usually only useful for list blocks, ngl).tagsβ the tags in effect for the current type of wiki formatting.optsβ the options in effect for the current type of wiki formatting.
Use the accessors of the same names to retrieve the values of the attributes. Same name, same vibe, zero surprises. π«Ά
add_text( @lines_of_text )β adds a list of lines of text to the current text for the block. This is very useful when you encounter a block and want to merge it with the previous block of the same type. Obsessed with this one actually.add_args( @arguments )β adds further arguments to the block; useful when merging blocks.formatted_text()β returns text formatted appropriately for this block. Blocks don't have to have formatters, but they may. It's giving optional, and we respect that.formatter( $line_of_text )β formats the$lineusingText::MediawikiFormat::format_line(). You can add your own formatter here; this is worth overriding. Go off, customise. π₯merge( $next_block )β merges the current block with$next_block(the next block encountered) if they're of the same type and are at the same level. This adds the text and args of$next_blockto the current block.
β οΈ It's your responsibility to remove $next_block from whatever your code iterates over. Not the module's. Yours. Don't make it awkward. π
nests()β returns true if this block should nest (as in lists and unordered lists) for the active wiki formatting.nest( $next_block )β nests$next_blockunder this block if the both nest and if$next_blockhas a level greater than the current block. This actually adds$next_blockas a text item within the current block.
π Beware. That's the whole warning. Beware.
π AUTHOR π
chromatic, "chromatic at wgz dot org" β the icon who wrote all this. Stan. π
π BUGS π
No known bugs. Immaculate. Flawless. Nothing to see here, bestie. β¨
π COPYRIGHT π
Copyright (c) 2006, chromatic. Some rights reserved.
This module is free software; you can use, redistribute, and modify it under the same terms as Perl 5.8.x. Slay, honestly.
that's the whole page, babe π this was Text::MediawikiFormat::Blocks, straight out of the User Contributed Perl Documentation, running on perl v5.34.0, dated 2022-06-28. love that for us. bye bestie, go format some wiki text π¦β¨π
π¦ where this page comes from
- debian bookworm: libtext-mediawikiformat-perl 1.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtext-mediawikiformat-perl 1.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtext-mediawikiformat-perl 1.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtext-mediawikiformat-perl 1.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtext-mediawikiformat-perl 1.04-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