SHARYANTO::Role::Doc::Section - Role for class that generates documentation with sections
version 0.71
SHARYANTO::Role::Doc::Section is a role for classes that produce documentation with sections. This role provides a workflow for parsing and generating sections, regulating indentation, and a gen_doc() method.
gen_doc()
To generate documentation, first you provide a list of section names in doc_sections. Then you run gen_doc(), which will call gen_doc_section_SECTION() method for each section consecutively, which is supposed to append lines of text to doc_lines. Finally all the added lines is concatenated together and returned by gen_doc().
doc_sections
gen_doc_section_SECTION()
doc_lines
This module uses Log::Any for logging.
This module uses Moo for object system.
Should be set to the names of available sections.
Character(s) used for indent.
Generate documentation.
The method will first initialize doc_lines to an empty array [] and doc_indent_level to 0.
[]
doc_indent_level
It will then call before_gen_doc if the hook method exists, to allow class to do stuffs prior to document generation. Perinci::To::Text uses this, for example, to retrieve metadata from Riap server.
before_gen_doc
Then, as described in "DESCRIPTION", for each section listed in doc_sections it will call gen_doc_section_SECTION.
gen_doc_section_SECTION
After that, it will call after_gen_doc if the hook method exists, to allow class to do stuffs after document generation.
after_gen_doc
Lastly, it returns concatenated doc_lines.
This role is used, among others, by: Perinci::To::* modules.
Perinci::To::*
SHARYANTO::Role::Doc::Section::AddTextLines which provides add_doc_lines to add text with optional text wrapping.
add_doc_lines
Please visit the project's homepage at https://metacpan.org/release/SHARYANTO-Roles.
Source repository is at https://github.com/sharyanto/perl-SHARYANTO-Roles.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=SHARYANTO-Roles
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Steven Haryanto <stevenharyanto@gmail.com>
This software is copyright (c) 2014 by Steven Haryanto.
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 SHARYANTO::Roles, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SHARYANTO::Roles
CPAN shell
perl -MCPAN -e shell install SHARYANTO::Roles
For more information on module installation, please visit the detailed CPAN module installation guide.