docs: add API explorer template component and fix rendering
Phase 3 part 1: Add interactive API explorer - Create templates/api_explorer.templ with mock and real modes - Add EndpointInfo and APIExplorerData types to templates/types.go - Fix markdown rendering with UnsafeHTML.ToComponent() - Add templ import for Component support - API explorer supports: - Mock data mode for non-authenticated users - Real execution mode for logged-in users - Request/response display - cURL generation - Copy to clipboard
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package templates
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
|
||||
type User struct {
|
||||
ID string
|
||||
Username string
|
||||
@@ -163,3 +165,8 @@ type BreadcrumbItem struct {
|
||||
|
||||
// UnsafeHTML is used for rendering raw HTML (like rendered markdown)
|
||||
type UnsafeHTML string
|
||||
|
||||
// ToComponent converts UnsafeHTML to a templ Component
|
||||
func (u UnsafeHTML) ToComponent() templ.Component {
|
||||
return templ.Raw(string(u))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user