src/html.cpp

changeset 20
8639ccd855ba
parent 15
ef0f2497843e
child 22
a9230f197e61
--- a/src/html.cpp	Sat Feb 01 17:15:14 2025 +0100
+++ b/src/html.cpp	Mon Feb 03 23:13:19 2025 +0100
@@ -67,9 +67,12 @@
     }
 }
 
-void html::open() {
-    puts(
-R"(<html>
+void html::open(bool fragment) {
+    if (fragment) {
+        puts("<div class=\"heatmap-content\">");
+        indentation = 1;
+    } else {
+        puts(R"(<html>
     <head>
         <style>
             table.heatmap {
@@ -116,12 +119,18 @@
             }
         </style>
     </head>
-    <body>)");
-    indentation = 2;
+    <body>
+        <div class=\"heatmap-content\">)");
+        indentation = 3;
+    }
 }
 
-void html::close() {
-    puts("\t</body>\n</html>");
+void html::close(bool fragment) {
+    if (fragment) {
+        puts("</div>");
+    } else {
+        puts("\t\t</div>\n\t</body>\n</html>");
+    }
 }
 
 void html::h1(const std::string& heading) {

mercurial