Pod::Elemental::Transformer::Splint - Documentation from class metadata
Version 0.1202, released 2020-12-26.
# in weaver.ini [-Transformer / Splint] transformer = Splint
Pod::Elemental::Transformer::Splint uses MooseX::AttributeDocumented to add inlined documentation about attributes to pod. If you write your classes with Moops you can also document method signatures with Kavorka::TraitFor::Parameter::doc (and ::ReturnType::doc).
A class defined like this:
package My::Class; use Moose; has has_brakes => ( is => 'ro', isa => Bool, default => 1, traits => ['Documented'], documentation => 'Does the bike have brakes?', documentation_alts => { 0 => 'Hopefully a track bike', 1 => 'Always nice to have', }, ); =pod :splint classname My::Class :splint attributes =cut
Will render like this (to html):
begin
1
0
Does the bike have brakes?
end
A Moops class defined like this:
class My::MoopsClass using Moose { ... method advanced_method(Int $integer does doc("Just an integer\nmethod_doc|This method is advanced."), ArrayRef[Str|Bool] $lots_of_stuff does doc('It works with both types'), Str :$name! does doc("What's the name"), Int :$age does doc('The age of the thing') = 0, Str :$pseudonym does doc('Incognito..') --> Bool but assumed does doc('Did it succeed?') ) { return 1; } method less_advanced($stuff, $another_thing does doc("Don't know what we get here"), ArrayRef $the_remaining is slurpy does doc('All the remaining') ) { return 1; } ... } =pod :splint classname My::MoopsClass :splint method advanced_method It needs lots of documentation. :splint method less_advanced =cut
This method is advanced.
$integer
$lots_of_stuff
name => $value
age => $value
= 0
pseudonym => $value
It needs lots of documentation.
$stuff
$another_thing
$the_remaining
The following settings are available in weaver.ini:
weaver.ini
Default: :splint
:splint
Defines the command used at the beginning of the line in pod.
Default: HTML=HtmlDefault, markdown=HtmlDefault
HTML=HtmlDefault, markdown=HtmlDefault
Define which renderers to use. Comma separated list of pairs where the key defines the format in pod and the value defines the renderer (in the Pod::Elemental::Transformer::Splint::AttributeRenderer namespace).
Pod::Elemental::Transformer::Splint::AttributeRenderer
The default will render each attribute like this:
=begin HTML <!-- attribute information --> =end HTML =begin markdown <!-- attribute information --> =end markdown
Similar to "attribute_renderer" but for methods. This is currently only assumed to work for methods defined with Kavorka or Moops.
Method renderers are in the Pod::Elemental::Transformer::Splint::MethodRenderer namespace.
Pod::Elemental::Transformer::Splint::MethodRenderer
Default: undef
undef
If you use Type::Tiny based type libraries, the types are usually linked to the correct library. Under some circumstances it might be necessary to specify which library a certain type belongs to.
It is a space separated list:
type_libraries = Custom::Types=AType Types::Standard=Str,Int
Default: Types::Standard
Types::Standard
The default Type::Tiny based type library to link types to.
https://github.com/Csson/p5-Pod-Elemental-Transformer-Splint
https://metacpan.org/release/Pod-Elemental-Transformer-Splint
Erik Carlsson <info@code301.com>
This software is copyright (c) 2016 by Erik Carlsson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Pod::Elemental::Transformer::Splint, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pod::Elemental::Transformer::Splint
CPAN shell
perl -MCPAN -e shell install Pod::Elemental::Transformer::Splint
For more information on module installation, please visit the detailed CPAN module installation guide.