src/html.cpp

changeset 46
7e099403e5b0
parent 44
de22ded6d50a
child 50
1ebab6df60c2
equal deleted inserted replaced
45:2cb7fdd2ba18 46:7e099403e5b0
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::chart_begin(const std::string& repo, const std::string& author) {
138 indent();
139 printf("<div class=\"chart\" data-repo=\"%s\" data-author=\"%s\">\n",
140 encode(repo).c_str(), encode(author).c_str());
141 indentation++;
142 }
143
144 void html::chart_end() {
145 indent(-1);
146 puts("</div>");
147 }
148
137 void html::heading_repo(const std::string& repo) { 149 void html::heading_repo(const std::string& repo) {
138 indent(); 150 indent();
139 printf("<h1>%s</h1>\n", encode(repo).c_str()); 151 printf("<h1 data-repo=\"%s\">%1$s</h1>\n", encode(repo).c_str());
140 } 152 }
141 153
142 void html::heading_author(const std::string& author, unsigned int total_commits) { 154 void html::heading_author(const std::string& author, unsigned int total_commits) {
143 indent(); 155 indent();
144 printf("<h2 title=\"Total commits: %u\">%s</h2>\n", 156 printf("<h2 title=\"Total commits: %u\">%s</h2>\n",
177 indent(-1); 189 indent(-1);
178 puts("</tr>"); 190 puts("</tr>");
179 } 191 }
180 192
181 void html::table_end() { 193 void html::table_end() {
182 indentation--; 194 indent(-1);
183 indent();
184 puts("</table>"); 195 puts("</table>");
185 } 196 }
186 197
187 void html::row_begin(unsigned int row) { 198 void html::row_begin(unsigned int row) {
188 indent(); 199 indent();

mercurial