The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SHARYANTO::Role::Doc::Section - Role for class that generates documentation with sections

VERSION

version 0.19

DESCRIPTION

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 generate_doc() method.

To generate documentation, first you provide a list of section names in doc_sections. Then you run generate_doc(), which will call doc_parse_SECTION and doc_gen_SECTION methods for each section consecutively. doc_parse_* is supposed to parse information from some source into a form readily usable in $self->doc_parse hash. doc_gen_* is supposed to generate the actual section in the final documentation format, by calling add_doc_lines to add text. Finally all the added lines is concatenated together and returned.

This module uses Log::Any for logging.

This module uses Moo for object system.

ATTRIBUTES

doc_sections => ARRAY

doc_sections => ARRAY

doc_parse => HASH

indent_level => INT

indent => STR (default ' ' (two spaces))

Character(s) used for indent.

METHODS

add_doc_section_before($name, $anchor)

add_doc_section_after($name, $anchor)

delete_doc_section($name)

add_doc_lines(@lines)

inc_indent([N])

dec_indent([N])

generate_doc() => STR

SEE ALSO

This module is used, among others, by: Perinci::To::* modules.

FUNCTIONS

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 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.