Browse Source

ADD: initial commit

master
Dominik Meyer 2 years ago
commit
aa1c94384a
Signed by: byterazor <byterazor@federationhq.de> GPG Key ID: B4C312B600606B64
2 changed files with 72 additions and 0 deletions
  1. +14
    -0
      dist.ini
  2. +58
    -0
      lib/HiD/Generator/Markdown.pm

+ 14
- 0
dist.ini 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]

+ 58
- 0
lib/HiD/Generator/Markdown.pm 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;

Loading…
Cancel
Save