#!/usr/bin/perl -w

# convert POD to HTML with Graph::Easy graphs

use lib 'lib';
use lib '../lib';
use Graph::Easy::Pod2HTML;
use Getopt::Long;
use strict;

my $options = scalar @ARGV;
my $input = shift || 'test.pod';
my $menulink = '';
my $version;
my $format = 'html';	# or 'txt,html' etc
my $output;

my $rc = GetOptions (
        "menulink=s" => \$menulink,
        "outputdir=s"   => \$output,
        "version"   => \$version,
        "outputformat=s"   => \$format,
        );

if (!$rc || $options == 0 || $version)
  {
  print "\n  Generate HTML from POD with graphs by Graph::Easy. Usage:\n\n";
  print "   ./pod2html inputfile [--output=path/file] [--menulink='Main|index.html|Back to the main page']\n\n";
  exit unless $rc;
  exit if $version;
  }

my $parser = Graph::Easy::Pod2HTML->new();

$parser->css_file('base.css');
#$parser->output_format($format);
#$parser->add_menulink($menulink);
#$parser->set_output_file($output) if $output;
$parser->parse_file($input);

