preaction / Statocles

Static website CMS
http://preaction.me/statocles
Other
84 stars 33 forks source link

Add additional Pod::Weaver config information #520

Open preaction opened 7 years ago

preaction commented 7 years ago

When we're using Pod::Weaver to build our documentation, there are times where we need to give it more information like what license we want to use and who our contributors are. This is information that usually Dist::Zilla gives to Pod::Weaver automatically for us, usually built from some kind of plugin (like Dist::Zilla::Plugin::Git::Contributors to list our contributors from Git).

At minimum, we should be able to simply give this extra information in the config file, using a new attribute called weave_config, like so:

perldoc_app:
    $class: Statocles::App::Perldoc
    inc:
        - lib/
    modules:
        - Local
        - Local::
    weave: 1
    weave_config:
        license: GPL2
        authors:
            - Doug Bell <doug@example.com>

This information is given directly to Pod::Weaver->weave_document as a hash.

It would be nice if some of the more-common information was able to be extracted automatically (like version to put in to Pod::Weaver::Section::Version). It would also be nice if it was easy to specify a license and correctly build the Software::License object as required by Pod::Weaver::Section::License.

In the future, we may do some things with the dist.ini file, or perhaps by using Dist::Zilla plugins directly, but for now, we just need to be able to specify some simple things. Also, in the future it may be useful to be able to specify a config on a per-module basis: Maybe we only want the license and author information to show up on the main entry module. These are not initial requirements.