Skip to content

Commit

Permalink
Document methods in Website class
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Cochrane committed Mar 30, 2015
1 parent 8e2abeb commit d7aec39
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Pod/Htmlify.pm6
Expand Up @@ -11,6 +11,7 @@ class Website is export {
has $.base-categories-dir is rw = "categories";
has %.examples-metadata;

#| build the website
method build {
self.write-index;
self.collect-all-metadata;
Expand All @@ -19,6 +20,7 @@ class Website is export {
self.write-example-files;
}

#| create category and subcategory directories
method create-category-dirs {
for $!categories.categories-list -> $category {
my $category-dir-name = $!base-html-dir ~ "/categories/" ~ $category.key;
Expand All @@ -30,12 +32,14 @@ class Website is export {
}
}

#| write main index file
method write-index {
say "Creating main index file";
spurt $!base-html-dir ~ '/index.html',
self.p2h(EVAL slurp('lib/HomePage.pod') ~ "\n\$=pod");
}

#| write index files for all categories
method write-category-indices {
say "Creating category index files";
my @headers = qw{File Title Author};
Expand All @@ -50,6 +54,7 @@ class Website is export {
}
}

#| write html pages for all examples
method write-example-files {
for $!categories.categories-list -> $category {
my $category-key = $category.key;
Expand Down Expand Up @@ -108,6 +113,7 @@ class Website is export {
return $example;
}

#| convert the POD into html
method p2h($pod) {
my $head = slurp 'template/head.html';
my $footer = footer-html;
Expand Down

0 comments on commit d7aec39

Please sign in to comment.