From 0469af4b76d7a33b0de2fcc696928b22a53099b9 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Tue, 30 Dec 2014 23:43:21 +0200 Subject: [PATCH] Add SYNOPSIS sections for Zeal::Document and ::Docset --- lib/Zeal/Docset.pm | 11 +++++++++++ lib/Zeal/Document.pm | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/lib/Zeal/Docset.pm b/lib/Zeal/Docset.pm index 3a54621..88c52e2 100644 --- a/lib/Zeal/Docset.pm +++ b/lib/Zeal/Docset.pm @@ -83,6 +83,17 @@ Zeal::Docset - Class representing a Dash/Zeal docset =head1 SYNOPSIS use Zeal::Docset; + my $ds = Zeal::Docset->new('/home/mgv/docsets/Perl.docset'); + say $ds->$path; # /home/mgv/docsets/Perl.docset + say $ds->name; # Perl + say $ds->id; # perl + say $ds->family; # perl + + # In SQL LIKE, % is .* and _ is . + my @matches = $ds->query('perlopen%'); # finds perlopenbsd and perlopentut + my $doc = $ds->query('perlsec'); # A Zeal::Document object for perlsec + my $html = $ds->get('perls_c'); # HTML documentation of perlsec + my @docs = $ds->list; # all documents =head1 DESCRIPTION diff --git a/lib/Zeal/Document.pm b/lib/Zeal/Document.pm index f80bad8..8812502 100644 --- a/lib/Zeal/Document.pm +++ b/lib/Zeal/Document.pm @@ -26,6 +26,11 @@ Zeal::Document - Class representing a Dash/Zeal document =head1 SYNOPSIS use Zeal::Document; + my $doc = $ds->query('perlsec'); # $ds is a Zeal::Docset instance + say $doc->name; # perlsec + say $doc->type; # Module + say $doc->path; # perldoc-html/perlsec.html + my $html = $doc->fetch; # $html is now the HTML documentation for perlsec =head1 DESCRIPTION -- 2.39.2