--- a/src/html.cpp Tue Dec 16 21:23:39 2025 +0100 +++ b/src/html.cpp Fri Feb 06 16:22:33 2026 +0100 @@ -73,17 +73,8 @@ } } -void html::open(bool fragment, unsigned char fragment_indent) { - if (fragment) { - indent(fragment_indent); - puts("<div class=\"heatmap-content\">"); - indentation++; - } else { - puts(R"(<!DOCTYPE html> -<html> - <head> - <meta charset="UTF-8"> - <style> +void html::styles_and_script() { + puts(R"( <style> table.heatmap { table-layout: fixed; border-collapse: separate; @@ -273,8 +264,21 @@ } }); }); - </script> - </head> + </script>)"); +} + +void html::open(bool fragment, unsigned char fragment_indent) { + if (fragment) { + indent(fragment_indent); + puts("<div class=\"heatmap-content\">"); + indentation++; + } else { + puts(R"(<!DOCTYPE html> +<html> + <head> + <meta charset="UTF-8">)"); + styles_and_script(); + puts(R"( </head> <body> <div class="heatmap-content">)"); indentation = 3;