Text::...Blocks(3pm)
π Text::WikiFormat::Blocks β the blocktypes for Text::WikiFormat π
okay bestie, welcome to the little module that does the blocky part of Text::WikiFormat. This is a page from the User Contributed Perl Documentation section of the manual, and it's lowkey just here to tell you what a "block" is and what it can do. π
β¨ NAME β¨
Text::WikiFormat::Blocks β blocktypes for Text::WikiFormat
πΈ SYNOPSIS πΈ
None. Like, actually none. Use Text::WikiFormat as the public interface, bestie β unless you're feeling main character energy and want to create your own block type. π
π¦ DESCRIPTION π¦
So this module merely creates subclasses of Text::WikiFormat::Block, which is where the actually interesting code lives. No cap.
And what even is a block? A block is a collection of related lines, bestie. Like:
- a code block β text you display verbatim in a monospaced font π»
- a header
- an unordered list
- an ordered list
- a paragraph β text you display in a proportional font
Every block extends Text::WikiFormat::Block. Every single one. Fr fr.
π METHODS π
The following methods exist, and yes we're going through all of them:
new( %args )β Creates and returns a new block. π 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).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. iykyk.
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. π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. πformatter( $line_of_text )β Formats the$lineusingText::WikiFormat::format_line(). You can add your own formatter here; this is worth overriding. β¨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. π
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 they 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 it. That's the whole warning. Beware.
π AUTHOR π
chromatic, chromatic at wgz dot org
π BUGS π
No known bugs. We ate and left no crumbs. π
πΈ 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. π«Ά
and that's the whole page, bestie β this was perl v5.40.1, dated 2025-04-07, from the Text::...Blocks(3pm) corner of the manual. slay, go build a block type πβ¨
π¦ where this page comes from
- debian trixie: libtext-wikiformat-perl 0.81-1 Β· GPL-2.0-only OR Artistic-1.0-Perl
- ubuntu resolute: libtext-wikiformat-perl 0.81-1 Β· GPL-2.0-only OR Artistic-1.0-Perl
- ubuntu stonking: libtext-wikiformat-perl 0.81-1 Β· GPL-2.0-only OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms