@@ -11,6 +11,7 @@ class Website is export {
11
11
has $ . base-categories-dir is rw = " categories" ;
12
12
has % . examples-metadata ;
13
13
14
+ # | build the website
14
15
method build {
15
16
self . write-index;
16
17
self . collect-all-metadata;
@@ -19,6 +20,7 @@ class Website is export {
19
20
self . write-example-files;
20
21
}
21
22
23
+ # | create category and subcategory directories
22
24
method create-category-dirs {
23
25
for $ ! categories . categories-list -> $ category {
24
26
my $ category-dir-name = $ ! base-html-dir ~ " /categories/" ~ $ category . key ;
@@ -30,12 +32,14 @@ class Website is export {
30
32
}
31
33
}
32
34
35
+ # | write main index file
33
36
method write-index {
34
37
say " Creating main index file" ;
35
38
spurt $ ! base-html-dir ~ ' /index.html' ,
36
39
self . p2h(EVAL slurp (' lib/HomePage.pod' ) ~ " \n \$=pod" );
37
40
}
38
41
42
+ # | write index files for all categories
39
43
method write-category-indices {
40
44
say " Creating category index files" ;
41
45
my @ headers = qw { File Title Author } ;
@@ -50,6 +54,7 @@ class Website is export {
50
54
}
51
55
}
52
56
57
+ # | write html pages for all examples
53
58
method write-example-files {
54
59
for $ ! categories . categories-list -> $ category {
55
60
my $ category-key = $ category . key ;
@@ -108,6 +113,7 @@ class Website is export {
108
113
return $ example ;
109
114
}
110
115
116
+ # | convert the POD into html
111
117
method p2h ($ pod ) {
112
118
my $ head = slurp ' template/head.html' ;
113
119
my $ footer = footer-html;
0 commit comments