ADD: initial commit

This commit is contained in:
Dominik Meyer 2018-06-25 15:45:44 +02:00
commit aa1c94384a
No known key found for this signature in database
GPG Key ID: B4C312B600606B64
2 changed files with 72 additions and 0 deletions

14
dist.ini Normal file
View File

@ -0,0 +1,14 @@
name = HiD-Processor-Markdown
author = Dominik Meyer <dmeyer@federationhq.de>
license = Perl_5
copyright_holder = Dominik Meyer
copyright_year = 2018
[@Basic]
[@Git]
[Git::NextVersion]
first_version = 0.001 ; this is the default
version_by_branch = 0 ; this is the default
version_regexp = ^v(.+)$ ; this is the default
[PodWeaver]
[ChangelogFromGit]

View File

@ -0,0 +1,58 @@
package HiD::Generator::Markdown;
#ABSTRACT: Markdown Processor for HiD
use Moose;
with 'HiD::Generator';
use File::Find;
use File::Basename;
=head1 DESCRIPTION
This generator searches for all markdown files within the HiD working
directory and generates html pages from them.
=cut
=attr markdown files
all found markdown files
=cut
has 'markdown_files' => (is=>'rw', defaults => sub{return [];});
sub generate {
my( $self , $site ) = @_;
my $follow = $site->config->{markdown}{follow_symlinks} || "false";
return unless $site->config->{markdown}{generate};
if ($follow=~/true/)
{
$follow=1;
}
else
{
$follow=0;
}
# find all markdown files
find(sub {
return unless substr($_,0,1) != "_";
my($filename, $dirs, $suffix) = fileparse($File::Find::name);
return unless $suffix=="md";
push(@{$self->markdown_files()},$File::Find::name);
},
[$site->config->{source}]
);
# generate pages
}
1;