From fc7360684af097d8520cf659c047f77f8ab9c806 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 11 Aug 2025 15:05:42 +0300 Subject: initially adding radicale --- frontends/scripts/foostats.pl | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'frontends/scripts') diff --git a/frontends/scripts/foostats.pl b/frontends/scripts/foostats.pl index 7418a98..e38add4 100644 --- a/frontends/scripts/foostats.pl +++ b/frontends/scripts/foostats.pl @@ -808,6 +808,11 @@ package Foostats::Reporter { next; } + # Skip 365-day summary section header in HTML output + if ($line =~ /^## 365-Day Summary Reports\s*$/) { + next; + } + # Check if we need to close a list if ($in_list && $line !~ /^\* /) { $html .= "\n"; @@ -825,6 +830,10 @@ package Foostats::Reporter { # Links elsif ($line =~ /^=> (\S+)\s+(.*)/) { my ($url, $text) = ($1, $2); + # Drop 365-day summary links from HTML output + if ($url =~ /(?:^|[\/.])365day_summary_\d{8}\.gmi$/) { + next; + } # Convert .gmi links to .html $url =~ s/\.gmi$/\.html/; $html .= "

" . encode_entities($text) . "

\n"; @@ -1213,13 +1222,17 @@ $content say "Writing $days-day summary report to $report_path"; FileHelper::write( $report_path, $report_content ); - # Also write HTML version - mkdir $html_output_dir unless -d $html_output_dir; - my $html_path = "$html_output_dir/${days}day_summary_$report_date.html"; - my $html_content = gemtext_to_html($report_content); - my $html_page = generate_html_page("$days-Day Summary Report", $html_content); - say "Writing HTML $days-day summary report to $html_path"; - FileHelper::write( $html_path, $html_page ); + # Also write HTML version, except for 365-day summaries (HTML suppressed) + if ($days != 365) { + mkdir $html_output_dir unless -d $html_output_dir; + my $html_path = "$html_output_dir/${days}day_summary_$report_date.html"; + my $html_content = gemtext_to_html($report_content); + my $html_page = generate_html_page("$days-Day Summary Report", $html_content); + say "Writing HTML $days-day summary report to $html_path"; + FileHelper::write( $html_path, $html_page ); + } else { + say "Skipping HTML generation for 365-day summary (Gemtext only)"; + } } sub build_report_header { -- cgit v1.2.3