- SEE ALSO
- COPYRIGHT AND LICENSE
Perinci::To::Doc::Role::Section - Role for class that generates documentation with sections
This document describes version 0.860 of Perinci::To::Doc::Role::Section (from Perl distribution Perinci-To-Doc), released on 2017-08-12.
This is a role for classes that produce documentation with sections. This role provides a workflow for parsing and generating sections, regulating indentation, and a
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
Should be set to the names of available sections.
Character(s) used for indent.
The method will first initialize
doc_lines to an empty array
doc_indent_level to 0.
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.
Then, as described in "DESCRIPTION", for each section listed in
doc_sections it will call
After that, it will call
after_gen_doc if the hook method exists, to allow class to do stuffs after document generation.
Lastly, it returns concatenated
Please visit the project's homepage at https://metacpan.org/release/Perinci-To-Doc.
Source repository is at https://github.com/perlancar/perl-Perinci-To-Doc.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-To-Doc
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.
This role is used, among others, by:
Perinci::To::Doc::Role::Section::AddTextLines which provides
add_doc_lines to add text with optional text wrapping.
This software is copyright (c) 2017, 2016, 2015, 2014, 2013 by firstname.lastname@example.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.