Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use examples-metadata attr in write-category-indices
  • Loading branch information
Paul Cochrane committed Mar 29, 2015
1 parent e8e5490 commit 5afb69f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/Pod/Htmlify.pm6
Expand Up @@ -15,7 +15,7 @@ class Website is export {
self.write-index;
self.collect-example-metadata;
my %examples = %!examples-metadata;
self.write-category-indices(%examples);
self.write-category-indices;
self.create-category-dirs;
self.write-example-files(%examples);
}
Expand All @@ -37,11 +37,11 @@ class Website is export {
self.p2h(EVAL slurp('lib/HomePage.pod') ~ "\n\$=pod");
}

method write-category-indices(%examples) {
method write-category-indices {
say "Creating category index files";
my @headers = qw{File Title Author};
for $!categories.categories-table.kv -> $category, $title {
my @examples = %examples{$category}{""}.values;
my @examples = %!examples-metadata{$category}{""}.values;
my @rows = @examples.map: {[.pod-link, .title, .author]};
spurt $!base-html-dir ~ "/$category.html", self.p2h(
pod-with-title($title,
Expand Down
3 changes: 2 additions & 1 deletion t/004-website-basic.t
Expand Up @@ -116,7 +116,8 @@ subtest {
my $base-dir = "/tmp/website-test";
$website.base-html-dir = $base-dir;
mkdir $base-dir unless $base-dir.IO.d;
$website.write-category-indices(%examples);
$website.examples-metadata = %examples;
$website.write-category-indices;

ok(($base-dir ~ "/sender.html").IO.e,
"index file for 'sender' category created");
Expand Down

0 comments on commit 5afb69f

Please sign in to comment.