From ddf1753c71ae84d2bb6ff9bf3f1eb36715002851 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Thu, 17 Mar 2022 05:08:43 +0100 Subject: [PATCH] Adding a script to autogenerate documentation. --- bin/generate_documentation.pl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 bin/generate_documentation.pl diff --git a/bin/generate_documentation.pl b/bin/generate_documentation.pl new file mode 100644 index 0000000..4537a78 --- /dev/null +++ b/bin/generate_documentation.pl @@ -0,0 +1,22 @@ +#!/usr/bin/env perl + +use v5.30.0; + +use strict; +use warnings; + +use Path::Tiny qw/path/; + +my $current_dir = path(__FILE__)->parent->parent->child('lib'); + +$current_dir->visit( + sub { + my ( $path, $state ) = @_; + if ( -f $path ) { + return if $path !~ /\.pm$/; + system mkdir => '-pv', 'doc/' . $path->parent; + system pod2html => $path, '-o', 'doc/' . $path . '.html', '--htmldir', $current_dir->child('./doc')->realpath, '--podpath', 'lib', '--recurse'; + } + }, + { recurse => 1 } +);