src/main.cpp

changeset 44
de22ded6d50a
parent 41
19cc90878968
--- a/src/main.cpp	Tue Feb 25 18:22:55 2025 +0100
+++ b/src/main.cpp	Tue Feb 25 18:46:17 2025 +0100
@@ -34,6 +34,8 @@
 #include <cstring>
 #include <cerrno>
 
+#include <numeric>
+
 using namespace std::chrono;
 
 static constexpr auto program_version = "1.1.0 (dev)";
@@ -266,11 +268,14 @@
         for (const auto &[author, entries] : authors) {
             if (settings.exclude_author(author)) continue;
             if (!h1_rendered) {
-                html::h1(repo);
+                html::heading_repo(repo);
                 h1_rendered = true;
             }
-            html::h2(author);
-            html::table_begin(report_year);
+
+            const auto commits_per_month = heatmap.commits_per_month(repo, author, report_year);
+            const auto total_commits = std::accumulate(commits_per_month.begin(), commits_per_month.end(), 0u);
+            html::heading_author(author, total_commits);
+            html::table_begin(report_year, commits_per_month);
 
             // initialize counters
             unsigned column = 0, row = 0;

mercurial