The Perl Advent Calendar needs more articles for 2022. Submit your idea today!


Pod::Knit - Stitches together POD documentation


version 0.0.1


    my $knit = Pod::Knit->new( config => {
        plugins => [
            { Sort => { order => [qw/ NAME * VERSION /] },
    print $knit->munge_document( file => './lib/Pod/' )->as_string;


Pod::Knit is a POD processor heavily inspired by Pod::Weaver. The main difference being that Pod::Weaver uses a Pod::Elemental DOM to represent and transform the POD document, whereas Pod::Knit uses representation of the document (the tags used in that representation are given in Pod::Knit::Document).

This module mostly take care of taking in the desired configuration, and transform POD documents based on it. For documentation of the system as a whole, peer at Pod::Knit::Manual.



Configuration file for the knit pipeline. Must be a YAML file.


--- stash: author: Yanick Champoux <> plugins: - Abstract - Attributes - Methods - NamedSections: sections: - synopsis - description - Version - Authors - Legal - Sort: order: - NAME - VERSION - SYNOPSIS - DESCRIPTION - ATTRIBUTES - METHODS - '*' - AUTHORS - AUTHOR - COPYRIGHT AND LICENSE

./knit.yml if the file exists.


Hashref of the configuration for the knit pipeline.

The configuration recognizes two keys: stash, which value is a hashref of configuration elements to pass to the plugins, and plugins, the arrayref of plugins and (optionally) their arguments. See config_file for an example.

the content of the config_file, if it exists.


Hashref of values accessible to the knit pipeline. Can be used to set values required by various plugins, like the distribution's version, the list of authors, etc.

the stash value of the config attribute, if presents. Else an empty hashref.



    my $doc = $knit->munge_document( %args )

    my $doc = $knit->munge_document( $original )

Takes a Pod::Knit::Document and returns a new document munged by the plugins.

If the input is %args, it is a shortcut for

    my $doc = $knit->munge_document( 
        Pod::Knit::Document->new( knit => $knit, %args )


Yanick Champoux <>


This software is copyright (c) 2018 by Yanick Champoux.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Full text of the license can be found in the LICENSE file included in this distribution.