#!/usr/local/bin/perl -w

use APIdict;

$dict = new APIdict;

$dict->readfile("api.list");
$dict->hyperlinks(1);
@elist = $dict->entity_list();
%hrefs = ();

foreach (@elist) {
    $hrefs{$_} = "$_-doc";
}

($scratch, $n2) = @elist;
$scratch = $n2;

print "Hyperlinks: " . $dict->hyperlinks() . "\n";
print "Entity '$n2':\n";
print " defined:           " . $dict->defined($n2) . "\n";
print " Category:          " . $dict->category($n2) . "\n";
print " Category name:     " . $dict->category_name($dict->category($n2)) . "\n";
print " See-Also:          " . $dict->see_also($n2) . "\n";
print " Expanded See-Also: ";
$esa = join("\n                    ", $dict->expanded_seealso($n2));
print "$esa\n";
print " Linked:            ";
print $dict->add_links($esa, "", "pre", "post", %hrefs) . "\n";
print " Description file:  " . $dict->description_file($n2) . "\n";
print " Description:\n"      . $dict->description($n2) . "\n";
print " Definition:\n"       . $dict->definition($n2) . "\n";
print " Example:\n"          . $dict->example($n2) . "\n";
