@@ -65,61 +65,67 @@ ($out_dir = 'html')
65
65
}
66
66
}
67
67
68
- sub write-index-file ( $ out_dir ) {
69
- my $ pod = Pod ::Block::Named. new (
68
+ sub pod-with-title ( $ title , * @ blocks ) {
69
+ Pod ::Block::Named. new (
70
70
name => " pod" ,
71
- content => Array . new (
71
+ content => [
72
72
Pod ::Block::Named. new (
73
73
name => " TITLE" ,
74
74
content => Array . new (
75
75
Pod ::Block::Para. new (
76
- content => [" Perl 6 Documentation " ],
76
+ content => [$ title ],
77
77
)
78
78
)
79
79
),
80
- Pod ::Block::Para. new (
81
- content => [' Official Perl 6 documentation' ],
82
- ),
83
- # TODO: add more
84
- Pod ::Heading. new (
80
+ @ blocks ,
81
+ ]
82
+ );
83
+ }
84
+
85
+ sub write-index-file ($ out_dir ) {
86
+ my $ pod = pod-with-title(' Perl 6 Documentation' ,
87
+ Pod ::Block::Para. new (
88
+ content => [' Official Perl 6 documentation' ],
89
+ ),
90
+ # TODO: add more
91
+ Pod ::Heading. new (
92
+ level => 1 ,
93
+ content => Array . new (
94
+ Pod ::Block::Para. new (content => [" Language Documentation" ])
95
+ )
96
+ ),
97
+ % types <language >. pairs . sort . map ({
98
+ Pod ::Item. new (
85
99
level => 1 ,
86
- content => Array . new (
87
- Pod ::Block::Para . new (content => [ " Language Documentation " ])
88
- )
89
- ),
90
- % types < language > . pairs . sort . map ({
91
- Pod ::Item . new (
92
- level => 1 ,
93
- content => [
94
- Pod ::FormattingCode . new (
95
- type => ' L ' ,
96
- content => [
97
- . key ~ ' | ' ~ . value ;
98
- ],
99
- ),
100
- ],
101
- );
102
- }),
103
- Pod ::Heading . new (
100
+ content => [
101
+ Pod ::FormattingCode . new (
102
+ type => ' L ' ,
103
+ content => [
104
+ . key ~ ' | ' ~ . value ;
105
+ ],
106
+ ) ,
107
+ ],
108
+ );
109
+ }) ,
110
+ Pod ::Heading . new (
111
+ level => 1 ,
112
+ content => Array . new (
113
+ Pod ::Block::Para . new ( content => [ " Types " ])
114
+ )
115
+ ),
116
+ % types < type > . sort . map ({
117
+ Pod ::Item . new (
104
118
level => 1 ,
105
- content => Array . new (
106
- Pod ::Block::Para. new (content => [" Types" ])
107
- )
119
+ content => [
120
+ Pod ::FormattingCode. new (
121
+ type => ' L' ,
122
+ content => [
123
+ . key ~ ' |' ~ . value ;
124
+ ],
125
+ ),
126
+ ],
108
127
),
109
- % types <type >. sort . map ({
110
- Pod ::Item. new (
111
- level => 1 ,
112
- content => [
113
- Pod ::FormattingCode. new (
114
- type => ' L' ,
115
- content => [
116
- . key ~ ' |' ~ . value ;
117
- ],
118
- ),
119
- ],
120
- ),
121
- }),
122
- )
128
+ })
123
129
);
124
130
my $ file = open : w, " $ out_dir /index.html" ;
125
131
$ file . print : pod2html($ pod );
0 commit comments