Let's say I have the following module:
module Simple-Mod;
#| Calculate the nth fibonacci number.
multi fib( 0 ) { 1 }
multi fib( 1 ) { 1 }
multi fib( Int $n where * > 1 ) {
fib($n - 2 ) + fib($n - 1);
}
#| Say hello to a person.
sub hello( $person ) { say "Hello, $person!" }
=begin pod
=head1 SYNOPSIS
A really simple module.
=head1 Example
=begin code
use Simple-Mod;
say fib(3); #=> 2
hello("Gina"); #=> Hello, Gina!
=end code
=head1 Subroutines
=end pod
At the moment, when I extract the Pod from this module, I obtain this:
sub fib(
Int $ where { ... },
)
Calculate the nth fibonacci number.
sub hello(
$person,
)
Say hello to a person.
SYNOPSIS
A really simple module.
Example
use Simple-Mod;
say fib(3); #=> 2
hello("Gina"); #=> Hello, Gina!
Subroutines
Is it posible to instruct the Pod parsing process to place the
subroutine definitions and comments after the Subroutines
header? Like this:
SYNOPSIS
A really simple module.
Example
use Simple-Mod;
say fib(3); #=> 2
hello("Gina"); #=> Hello, Gina!
Subroutines
sub fib(
Int $ where { ... },
)
Calculate the nth fibonacci number.
sub hello(
$person,
)
Say hello to a person.
It would be great if it did, right? But no, that's not possible unless you create your own Pod parser. Shouldn't be hard, though...