NAME

Wikibase::Datatype::Print::Sitelink - Wikibase sitelink pretty print helpers.

SYNOPSIS

use Wikibase::Datatype::Print::Sitelink qw(print);

my $pretty_print_string = print($obj, $opts_hr);
my @pretty_print_lines = print($obj, $opts_hr);

SUBROUTINES

print

my $pretty_print_string = print($obj, $opts_hr);
my @pretty_print_lines = print($obj, $opts_hr);

Construct pretty print output for Wikibase::Datatype::Sitelink object.

Returns string in scalar context. Returns list of lines in array context.

ERRORS

print():
        Object isn't 'Wikibase::Datatype::Sitelink'.

EXAMPLE

use strict;
use warnings;

use Unicode::UTF8 qw(decode_utf8 encode_utf8);
use Wikibase::Datatype::Print::Sitelink;
use Wikibase::Datatype::Sitelink;

# Object.
my $obj = Wikibase::Datatype::Sitelink->new(
        'badges' => [
                Wikibase::Datatype::Value::Item->new(
                        'value' => 'Q123',
                ),
        ],
        'site' => 'cswiki',
        'title' => decode_utf8('Hlavní strana'),
);

# Print.
print encode_utf8(Wikibase::Datatype::Print::Sitelink::print($obj))."\n";

# Output:
# Hlavní strana (cswiki) [Q123]

DEPENDENCIES

Error::Pure, Exporter, Readonly, Wikibase::Datatype::Print::Value::Item.

SEE ALSO

Wikibase sitelink datatype.

REPOSITORY

https://github.com/michal-josef-spacek/Wikibase-Datatype-Print

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© 2020-2024 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.17