Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use examples-metadata attr in write-example-files
  • Loading branch information
Paul Cochrane committed Mar 29, 2015
1 parent 5afb69f commit 355906b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions lib/Pod/Htmlify.pm6
Expand Up @@ -14,10 +14,9 @@ class Website is export {
method build {
self.write-index;
self.collect-example-metadata;
my %examples = %!examples-metadata;
self.write-category-indices;
self.create-category-dirs;
self.write-example-files(%examples);
self.write-example-files;
}

method create-category-dirs {
Expand Down Expand Up @@ -51,14 +50,14 @@ class Website is export {
}
}

method write-example-files(%examples) {
my @categories = %examples.keys;
method write-example-files {
my @categories = %!examples-metadata.keys;
for @categories -> $category {
say "Creating example files for category: $category";
my @files = files-in-category($category, base-dir => $!base-categories-dir);
for @files -> $file {
next unless $file.IO.e;
my $example = %examples{$category}{""}{$file.IO.basename};
my $example = %!examples-metadata{$category}{""}{$file.IO.basename};
my $pod = format-author-heading($example);
$pod.push: source-reference($file, $category);
my $html-file = $file.IO.basename.subst(/\.p(l|6)/, ".html");
Expand Down
3 changes: 2 additions & 1 deletion t/004-website-basic.t
Expand Up @@ -166,7 +166,8 @@ subtest {
}

$website.create-category-dirs;
$website.write-example-files(%examples);
$website.examples-metadata = %examples;
$website.write-example-files;

my @example-html-files = qw{
sender/bob.html
Expand Down

0 comments on commit 355906b

Please sign in to comment.