Removed endpoint API class documentation code

- there is no standard way for a swagger spec to define descriptive
information for an endpoint API
- added markdown as a format to the autodoc script
- added some version information to autogenerated docs
This commit is contained in:
Dave Baird
2015-11-13 19:30:47 +01:00
parent 970c94a4d9
commit 995a1f547f
13 changed files with 438 additions and 223 deletions

View File

@@ -7,7 +7,7 @@ use Moose::Util qw(apply_all_roles);
use Getopt::Std;
my %options=();
getopts("wnphHc:", \%options);
getopts("wnphmHc:", \%options);
help if $options{h};
my $my_app = $options{c} || 'My::App';
@@ -28,10 +28,13 @@ else {
package main;
my $opt;
$opt = 'pod' if $options{p};
$opt = 'wide' if $options{w};
$opt = 'narrow' if $options{n};
$opt = 'pod' if $options{p};
$opt = 'pod' if $options{H};
$opt = 'pod' if $options{m};
$opt ||= 'wide';
my $api = $my_app->new;
@@ -42,6 +45,12 @@ if ($options{H}) {
$api->autodoc($opt);
close STDOUT or die "Can't close: $!";
}
elsif ($options{m}) {
my $pod2markdown = "pod2markdown --html-encode-chars 1";
open STDOUT, "| $pod2markdown" or die "Can't fork: $!";
$api->autodoc($opt);
close STDOUT or die "Can't close: $!";
}
else {
$api->autodoc($opt);
}
@@ -57,6 +66,7 @@ Usage: autodoc [OPTION] [-c My::App::Class]
-n narrow format
-p POD format
-H HTML format
-m Markdown format
-h print this help message
-c your application class