Perl6::Pod::Directive::config - handle =config directive


Perl6-Pod documentation Contained in the Perl6-Pod distribution.

Index


Code Index:

NAME

Top

Perl6::Pod::Directive::config - handle =config directive

SYNOPSIS

Top

Block pre-configuration

  =config head1 :numbered
  =config head2 :like<head1> :formatted<I>

Pre-configuring formatting codes



  =config V<>  :allow<E>
  =config C<>  :formatted<I>




DESCRIPTION

Top

Perl6::Pod::Directive::config - handle =config directive

The =config directive allows you to prespecify standard configuration information that is applied to every block of a particular type.

    =config BLOCK_TYPE  CONFIG OPTIONS
    =                   OPTIONAL EXTRA CONFIG OPTIONS

SEE ALSO

Top

http://zag.ru/perl6-pod/S26.html, Perldoc Pod to HTML converter: http://zag.ru/perl6-pod/, Perl6::Pod::Lib

AUTHOR

Top

Zahatski Aliaksandr, <zag@cpan.org>

COPYRIGHT AND LICENSE

Top


Perl6-Pod documentation Contained in the Perl6-Pod distribution.
package Perl6::Pod::Directive::config;

#$Id$

use warnings;
use strict;
use Perl6::Pod::Block;
use base 'Perl6::Pod::Block';
use Data::Dumper;

sub new {
      my ( $class, %args ) = @_;
      my $self = $class->SUPER::new(%args, parent_context=>1);
}

sub start {
    my $self = shift;
    my ( $parser, $attr ) = @_;
    $self->delete_element->skip_content;

    #handle
    #=config block_name :config_attr
    my $opt = $self->{_pod_options};
    my ( $name, @params ) = split( /\s+/, $opt );
    my $current_opt = $parser->current_context->config->{$name} || '';
    $opt = join " ", $current_opt, @params;
    $parser->current_context->config->{$name} = $opt;
}

1;

__END__