132 } else { |
132 } else { |
133 puts(" </div>\n </body>\n</html>"); |
133 puts(" </div>\n </body>\n</html>"); |
134 } |
134 } |
135 } |
135 } |
136 |
136 |
137 void html::h1(const std::string& heading) { |
137 void html::heading_repo(const std::string& repo) { |
138 indent(); |
138 indent(); |
139 printf("<h1>%s</h1>\n", encode(heading).c_str()); |
139 printf("<h1>%s</h1>\n", encode(repo).c_str()); |
140 } |
140 } |
141 |
141 |
142 void html::h2(const std::string& heading) { |
142 void html::heading_author(const std::string& author, unsigned int total_commits) { |
143 indent(); |
143 indent(); |
144 printf("<h2>%s</h2>\n", encode(heading).c_str()); |
144 printf("<h2 title=\"Total commits: %u\">%s</h2>\n", |
145 } |
145 total_commits, |
146 |
146 encode(author).c_str()); |
147 void html::table_begin(year y) { |
147 } |
|
148 |
|
149 void html::table_begin(year y, const std::array<unsigned int, 12> &commits_per_month) { |
148 static constexpr const char* months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; |
150 static constexpr const char* months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; |
149 // compute the column spans, first |
151 // compute the column spans, first |
150 unsigned colspans[12] = {}; |
152 unsigned colspans[12] = {}; |
151 { |
153 { |
152 unsigned total_cols = 0; |
154 unsigned total_cols = 0; |