feat: workout-suggester, weather-aware workouts from a local Gemma
Go + Templ + HTMX app that checks the weather (Open-Meteo, MET Norway fallback), scores run/ride/walk with plain rules, and has a local open-weight model (Gemma 4 E2B via any OpenAI-compatible server) write the plan. Routes are loops from your door (BRouter) plus signposted OpenStreetMap routes (Overpass), with GPX export.
This commit is contained in:
42 files changed
+7219
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package views
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMarkdownSections(t *testing.T) {
|
||||
var buf bytes.Buffer
|
||||
src := "**Go for a run**: nice.\n**When:** now\n**The session:**\n- warm up\n- run\n**Route:** the loop"
|
||||
Markdown(src).Render(context.Background(), &buf)
|
||||
got := buf.String()
|
||||
if strings.Contains(got, "run\n<strong>Route:") || !strings.Contains(got, "</ul>\n<p><strong>Route:</strong>") {
|
||||
t.Errorf("Route folded into the list:\n%s", got)
|
||||
}
|
||||
if !strings.Contains(got, "<p><strong>Go for a run</strong>: nice.</p>") {
|
||||
t.Errorf("first line mangled:\n%s", got)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user