docs: add interactive documentation system with Go+HTMX
- Add internal/docs package with markdown renderer (goldmark) - Create docs layout template with sidebar navigation - Implement hierarchical navigation auto-generated from docs folder - Add table of contents generator (extract ## headings) - Add syntax highlighting for code blocks (highlight.js) - Add mobile responsive design - Add /docs routes to main.go The documentation system features: - Dark theme matching app design - Collapsible sidebar sections (Getting Started, User Guide, Device Setup, API Reference, Contributing) - Table of contents for each page - Breadcrumb navigation - Full-text search (client-side JavaScript, API endpoint ready) - Syntax highlighting for code blocks - Mobile-friendly with hamburger menu All documentation is served from /docs route, no authentication required. Markdown files are rendered using goldmark with GFM extensions and syntax highlighting.
This commit is contained in:
@@ -123,3 +123,40 @@ type PotentialMatchData struct {
|
||||
MatchMethod string
|
||||
Confidence float64
|
||||
}
|
||||
|
||||
// Documentation types
|
||||
type Navigation struct {
|
||||
Sections []NavSection
|
||||
}
|
||||
|
||||
type NavSection struct {
|
||||
Title string
|
||||
Items []NavItem
|
||||
Collapsed bool
|
||||
}
|
||||
|
||||
type NavItem struct {
|
||||
Title string
|
||||
URL string
|
||||
Icon string
|
||||
}
|
||||
|
||||
type Document struct {
|
||||
Title string
|
||||
Content string
|
||||
TOC []TOCItem
|
||||
Breadcrumb []BreadcrumbItem
|
||||
Category string
|
||||
SourceFile string
|
||||
}
|
||||
|
||||
type TOCItem struct {
|
||||
Level int
|
||||
Title string
|
||||
Anchor string
|
||||
}
|
||||
|
||||
type BreadcrumbItem struct {
|
||||
Title string
|
||||
URL string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user