go-help/templates/index.html
Snider 944cad006b feat(help): Phase 2 — HTTP server, rendering, static site generator, CLI ingestion
Add complete HTTP server and rendering layer for the help catalog:

- render.go: Markdown-to-HTML via goldmark (GFM, typographer, raw HTML)
- server.go: HTTP server with 6 routes (HTML index/topic/search + JSON API)
- templates.go: Embedded HTML templates with dark theme (bg #0d1117)
- templates/: base, index, topic, search, 404 page templates
- generate.go: Static site generator with client-side JS search
- ingest.go: CLI help text parser (Usage/Flags/Examples/Commands sections)

320 tests passing, 95.5% coverage, race-clean, vet-clean.

Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 08:50:10 +00:00

19 lines
589 B
HTML

{{define "title"}}Help Topics{{end}}
{{define "content"}}
<h1>Help Topics <span class="badge">{{len .Topics}} {{pluralise (len .Topics) "topic" "topics"}}</span></h1>
{{if .Groups}}
{{range .Groups}}
<h2><span class="tag">{{.Tag}}</span></h2>
{{range .Topics}}
<div class="card">
<h3><a href="/topics/{{.ID}}">{{.Title}}</a></h3>
{{if .Tags}}<div>{{range .Tags}}<span class="tag">{{.}}</span>{{end}}</div>{{end}}
{{if .Content}}<p>{{truncate .Content 120}}</p>{{end}}
</div>
{{end}}
{{end}}
{{else}}
<p style="color: var(--fg-muted);">No topics available.</p>
{{end}}
{{end}}