App::DocKnot::Generate(3pm) | User Contributed Perl Documentation | App::DocKnot::Generate(3pm) |
App::DocKnot::Generate - Generate documentation from package metadata
use App::DocKnot::Generate; my $docknot = App::DocKnot::Generate->new({ metadata => 'docs/docknot.yaml' }); my $readme = $docknot->generate('readme'); my $index = $docknot->generate('thread'); $docknot->generate_output('readme'); $docknot->generate_output('thread', 'www/index.th')
Perl 5.24 or later and the modules File::BaseDir, File::ShareDir, Kwalify, Path::Tiny, Template (part of Template Toolkit), and YAML::XS, all of which are available from CPAN.
This component of DocKnot provides a system for generating consistent human-readable software package documentation from metadata files, primarily JSON and files containing documentation snippets. It takes as input a directory of metadata and a set of templates and generates a documentation file from the metadata given the template name.
The path to the metadata directory for a package is given as an explicit argument to the App::DocKnot::Generate constructor. All other data (currently templates and license information) is loaded via File::BaseDir and therefore uses XDG paths by default. This means that templates and other global configuration are found by searching the following paths in order:
Default templates and license files are included with the App::DocKnot module and are used unless more specific configuration files exist.
readme -> README readme-md -> README.md
If TEMPLATE isn't one of the templates listed above, the OUTPUT argument is required.
Russ Allbery <rra@cpan.org>
Copyright 2013-2022 Russ Allbery <rra@cpan.org>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
docknot(1), App::DocKnot::Config
This module is part of the App-DocKnot distribution. The current version of DocKnot is available from CPAN, or directly from its web site at <https://www.eyrie.org/~eagle/software/docknot/>.
2022-01-20 | perl v5.32.1 |