Wiki::...oriser(3pm)
β¨ NAME β¨
Wiki::Toolkit::Plugin::Categoriser β it's the category management plugin for Wiki::Toolkit, bestie π (the manual page itself is filed under Wiki::...oriser(3pm), iconic name, no notes)
πΈ DESCRIPTION πΈ
Okay so here's the vibe: this plugin takes your node metadata and uses it to build a whole little model of how your nodes are related to each other β but, like, specifically in terms of categories. That's it. That's the whole job. And it does it slayfully π
π SYNOPSIS π
use Wiki::Toolkit;
use Wiki::Toolkit::Plugin::Categoriser;
my $wiki = Wiki::Toolkit->new( ... );
$wiki->write_node( "Red Lion", "nice beer", $checksum,
{ category => [ "Pubs", "Pub Food" ] }
) or die "Can't write node";
$wiki->write_node( "Holborn Station", "busy at peak times", $checksum,
{ category => "Tube Station" }
) or die "Can't write node";
my $categoriser = Wiki::Toolkit::Plugin::Categoriser->new;
$wiki->register_plugin( plugin => $categoriser );
my $isa_pub = $categoriser->in_category( category => "Pubs",
node => "Red Lion" );
my @categories = $categoriser->categories( node => "Holborn Station" );
π METHODS π
π new
my $categoriser = Wiki::Toolkit::Plugin::Categoriser->new;
$wiki->register_plugin( plugin => $categoriser );
Make a fresh categoriser, then register it with your wiki. That's the whole step. Periodt. β¨
π in_category
my $isa_pub = $categoriser->in_category( category => "Pubs",
node => "Red Lion" );
Returns true if the node is in the category, and false otherwise π«Ά
Heads up bestie: this is case-insensitive, so"Pubs"is literally the same category as"pubs". And the author says β and I quote the vibe β they might do something to make it plural-insensitive at some point too. So"Pubs"vs"Pub"? Not yet, babes. Not yet. π
π subcategories
$wiki->write_node( "Category Pub Food", "mmm food", $checksum,
{ category => [ "Pubs", "Food", "Category" ] }
) or die "Can't write node";
my @subcats = $categoriser->subcategories( category => "Pubs" );
# will return ( "Pub Food" )
# Or if you prefer CamelCase node names:
$wiki->write_node( "CategoryPubFood", "mmm food", $checksum,
{ category => [ "Pubs", "Food", "Category" ] }
) or die "Can't write node";
my @subcats = $categoriser->subcategories( category => "Pubs" );
# will return ( "PubFood" )
So the way this works: to add a subcategory "Foo" to a given category "Bar", you write a node called any one of "Foo", "Category Foo", or "CategoryFoo" β and you give it metadata saying it's in the categories "Bar" and "Category". Three naming options, one girlboss move π
And yes, it's paying specific attention to the Wiki convention of defining categories by prefacing the category name with "Category" and creating a node by that name. That's the rule it's living by. If you need different behaviour, the note is that we should probably implement it using an optional argument in the constructor. So likeβ¦ noted π
π categories
my @cats = $categoriser->categories( node => "Holborn Station" );
Returns an array of category names β in no particular order, so don't come for the ordering, it's not that kind of function π
π¦ SEE ALSO π¦
Wiki::ToolkitWiki::Toolkit::Plugin
π AUTHOR π
Kake Pugh (kake@earth.li). The Wiki::Toolkit team (http://www.wiki-toolkit.org/) π
π COPYRIGHT π
Copyright (C) 2003-4 Kake Pugh. All Rights Reserved.
Copyright (C) 2006-2009 the Wiki::Toolkit team. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. So go off, but respectfully π«Ά
Okay and that's the whole page bestie β this beauty ships as part of perl v5.32.0 and the docs were dated 2020-11-29. Catch you in the next manpage, mwah πβ¨
π¦ where this page comes from
- debian bookworm: libwiki-toolkit-plugin-categoriser-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libwiki-toolkit-plugin-categoriser-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libwiki-toolkit-plugin-categoriser-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libwiki-toolkit-plugin-categoriser-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libwiki-toolkit-plugin-categoriser-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libwiki-toolkit-plugin-categoriser-perl 0.08-2 Β· 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