| 1 | package Pod::Knit::Plugin::Attributes; | ||
| 2 | 2 | our $AUTHORITY = 'cpan:YANICK'; | |
| 3 | # ABSTRACT: POD structure for attributes | ||
| 4 | 2 | $Pod::Knit::Plugin::Attributes::VERSION = '0.0.1'; | |
| 5 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 2 | ▶ | use XML::WriterX::Simple; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 2 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 2 | extends 'Pod::Knit::Plugin'; | |
| 13 | 2 | with 'Pod::Knit::DOM::WebQuery'; | |
| 14 | |||
| 15 | 2 | ▶ | use experimental 'signatures'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | 1 | ▶ | sub setup_podparser { |
|
Subroutine
setup_podparser: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 18 | 1 | my( $self, $parser ) = @_; | |
| 19 | |||
| 20 | 1 | $parser->accept_directive_as_processed( qw/ | |
| 21 | attribute default | ||
| 22 | /); | ||
| 23 | |||
| 24 | 1 | $parser->commands->{attribute} = { alias => 'head3' }; | |
| 25 | 1 | $parser->commands->{default} = { alias => 'head4' }; | |
| 26 | } | ||
| 27 | |||
| 28 | 1 | ▶ | sub munge( $self, $doc ) { |
|
Subroutine
munge: called CC=1 SCAR=2.6
| |||
| 29 | |||
| 30 | 0 | ▶ | $doc->dom->find( 'section.attribute' )->each(sub{ |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 31 | 0 | $_->detach; | |
| 32 | #$self->transform_attribute( $_, $doc ); | ||
| 33 | 0 | $self->attributes_section($doc)->append($_); | |
| 34 | 1 | }); | |
| 35 | |||
| 36 | } | ||
| 37 | |||
| 38 | 0 | ▶ | sub attributes_section($self, $doc) { |
|
Subroutine
attributes_section: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 39 | 0 | return $doc->find_or_create_section('attributes'); | |
| 40 | } | ||
| 41 | |||
| 42 | 0 | ▶ | sub transform_attribute ($self,$doc) { |
|
Subroutine
transform_attribute: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 43 | 0 | ▶ | $doc->dom->find( '.default' )->each(sub{ |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 44 | 0 | $_->detach; | |
| 45 | 0 | $doc->dom->find('.')->filter('head3')->after($_); | |
| 46 | 0 | }); | |
| 47 | } | ||
| 48 | |||
| 49 | 2 | 1; | |
| 50 | |||
| 51 | __END__ | ||