From ef0ef32a725810a4b4add17f042d49051b4db7b3 Mon Sep 17 00:00:00 2001
From: George Abbott <george@gabbott.dev>
Date: Sun, 19 Nov 2023 16:20:18 +0000
Subject: Added allowwrap option  to fmt-as-table

---
 web/fmt-as-table          | 10 +++++++++-
 web/training-format-table |  4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/web/fmt-as-table b/web/fmt-as-table
index c7064b5..186a5a9 100755
--- a/web/fmt-as-table
+++ b/web/fmt-as-table
@@ -21,6 +21,7 @@ end
 ## Handle options
 is_collapsible = false
 collapsible_summary = ""
+allowwrap = false
 
 
 
@@ -34,6 +35,8 @@ options.each do |opt|
   if opt[0..10] == "collapsible" then 
     is_collapsible = true
     collapsible_summary = opt.split("(")[1].split(")")[0]
+  elsif opt == "allowwrap" then
+    allowwrap = true
   end
 end
 
@@ -45,7 +48,12 @@ if is_collapsible then
 end
 
 # Sort out the header.
-table << "<table>\n"
+if allowwrap then
+  table << "<table class=\"allowwrap\">\n"
+else
+  table << "<table>"
+end
+
 table << "\t<tr class=\"header\">\n"
 ARGV[1].split("\t").each do |entry|
   table << ("\t\t<th>" + entry + "</th>\n")
diff --git a/web/training-format-table b/web/training-format-table
index 4638578..2e55775 100755
--- a/web/training-format-table
+++ b/web/training-format-table
@@ -6,7 +6,7 @@
 # months.
 
 # 2023-10
-fmt-as-table "$1/2023-10" "Index	Date	Sit-ups	Planks	Squats	Ball Squats	Comments" "collapsible(2023-10)"
+fmt-as-table "$1/2023-10" "Index	Date	Sit-ups	Planks	Squats	Ball Squats	Comments" "collapsible(2023-10),allowwrap"
 
 # 2023-11
-fmt-as-table "$1/2023-11" "Index	Date	Press-ups	Planks	Dumbbells	Ball Squats	Comments" "collapsible(2023-11)"
+fmt-as-table "$1/2023-11" "Index	Date	Press-ups	Planks	Dumbbells	Ball Squats	Comments" "collapsible(2023-11),allowwrap"
-- 
cgit v1.2.1