diff options
-rw-r--r-- | activity.lua | 3 | ||||
-rw-r--r-- | activity/formats/svg.lua | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/activity.lua b/activity.lua index 398d2e8..55cb061 100644 --- a/activity.lua +++ b/activity.lua @@ -33,6 +33,7 @@ function generate_rolling (lookup, format, date) return at.year, dates.day_of_year(at) end + local head = format.start_document"Activity" .. format.start_table() for index, weekday in pairs(weekdays) do rows = rows .. format.start_row() .. format.label(weekday) for week=0,51 do @@ -45,7 +46,7 @@ function generate_rolling (lookup, format, date) end rows = rows .. format.end_row() end - return format.start_document"Activity" .. format.start_table() .. rows .. format.end_table() .. format.end_document() + return head .. rows .. format.end_table() .. format.end_document() end diff --git a/activity/formats/svg.lua b/activity/formats/svg.lua index ab3ab69..f7e2700 100644 --- a/activity/formats/svg.lua +++ b/activity/formats/svg.lua @@ -44,7 +44,7 @@ function svg.end_table () end -local cell_offset = 28 +local cell_offset function svg.start_row () @@ -73,7 +73,7 @@ end function svg.cell (level) local cell = ([[<rect class="cell level%d" x="%d"/>]]):format(level, cell_offset) - cell_offset = cell_offset + 12 + svg.spot() -- Increment cell_offset in one place in code. return cell end |