line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::App::APISchema::Document; |
2
|
1
|
|
|
1
|
|
749
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
4
|
1
|
|
|
1
|
|
4
|
use parent qw(Plack::Component); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
5
|
1
|
|
|
1
|
|
3339
|
use Plack::Util::Accessor qw(schema); |
|
1
|
|
|
|
|
191
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
277
|
use Text::Markdown::Hoedown qw(markdown); |
|
1
|
|
|
|
|
800
|
|
|
1
|
|
|
|
|
78
|
|
7
|
1
|
|
|
1
|
|
262
|
use Text::MicroTemplate qw(encoded_string); |
|
1
|
|
|
|
|
2319
|
|
|
1
|
|
|
|
|
51
|
|
8
|
1
|
|
|
1
|
|
234
|
use Text::MicroTemplate::DataSection qw(render_mt); |
|
1
|
|
|
|
|
10812
|
|
|
1
|
|
|
|
|
81
|
|
9
|
1
|
|
|
1
|
|
10
|
use Encode qw(encode_utf8); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
76
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
318
|
use APISchema::Generator::Markdown; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
165
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub call { |
14
|
3
|
|
|
3
|
1
|
16859
|
my ($self, $env) = @_; |
15
|
|
|
|
|
|
|
|
16
|
3
|
|
|
|
|
23
|
my $generator = APISchema::Generator::Markdown->new; |
17
|
3
|
|
|
|
|
2785
|
my $markdown = $generator->format_schema($self->schema); |
18
|
|
|
|
|
|
|
|
19
|
3
|
|
|
|
|
566
|
my $body = markdown( |
20
|
|
|
|
|
|
|
$markdown, |
21
|
|
|
|
|
|
|
extensions => int( |
22
|
|
|
|
|
|
|
0 |
23
|
|
|
|
|
|
|
| Text::Markdown::Hoedown::HOEDOWN_EXT_TABLES |
24
|
|
|
|
|
|
|
| Text::Markdown::Hoedown::HOEDOWN_EXT_AUTOLINK |
25
|
|
|
|
|
|
|
| Text::Markdown::Hoedown::HOEDOWN_EXT_FENCED_CODE |
26
|
|
|
|
|
|
|
| Text::Markdown::Hoedown::HOEDOWN_EXT_NO_INTRA_EMPHASIS |
27
|
|
|
|
|
|
|
) |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
|
|
|
346
|
my $renderer = Text::MicroTemplate::DataSection->new(package => ref $self); |
31
|
3
|
|
100
|
|
|
258
|
my $title = $self->schema->title || ''; |
32
|
3
|
|
|
|
|
41
|
my $html = $renderer->render_mt('template.mt', $title, $body); |
33
|
|
|
|
|
|
|
|
34
|
3
|
|
|
|
|
3888
|
return [200, ['Content-Type' => 'text/html; charset=utf-8'], [encode_utf8 $html]]; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__DATA__ |