-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simpler streaming ex, that works on vercel
- Loading branch information
Showing
17 changed files
with
319 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package registry | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/will-wow/typed-htmx-go/examples/web/activesearch" | ||
"github.com/will-wow/typed-htmx-go/examples/web/bulkupdate" | ||
"github.com/will-wow/typed-htmx-go/examples/web/classtools_ex" | ||
"github.com/will-wow/typed-htmx-go/examples/web/clicktoedit" | ||
"github.com/will-wow/typed-htmx-go/examples/web/progressbar" | ||
"github.com/will-wow/typed-htmx-go/examples/web/sse_ex" | ||
) | ||
|
||
type Example struct { | ||
Title string | ||
Desc string | ||
Slug string | ||
Handler func(bool) http.Handler | ||
} | ||
|
||
var Examples = []Example{ | ||
{ | ||
Title: "Click to Edit", | ||
Desc: "Demonstrates inline editing of a data object", | ||
Slug: "click-to-edit", | ||
Handler: clicktoedit.NewHandler, | ||
}, | ||
{ | ||
Title: "Bulk Update", | ||
Desc: "Demonstrates bulk updating of multiple rows of data", | ||
Slug: "bulk-update", | ||
Handler: bulkupdate.NewHandler, | ||
}, | ||
{ | ||
Title: "Active Search", | ||
Desc: "Demonstrates the active search box pattern", | ||
Slug: "active-search", | ||
Handler: activesearch.NewHandler, | ||
}, | ||
{ | ||
Title: "Progress Bar", | ||
Desc: "Demonstrates a job-runner like progress bar", | ||
Slug: "progress-bar", | ||
Handler: progressbar.NewHandler, | ||
}, | ||
{ | ||
Title: "Class Tools", | ||
Desc: "Demo of class-tools options", | ||
Slug: "class-tools", | ||
Handler: classtools_ex.NewHandler, | ||
}, | ||
{ | ||
Title: "Server-Sent Events", | ||
Desc: "Streaming responses with the SSE HTMX Extension", | ||
Slug: "sse", | ||
Handler: sse_ex.NewHandler, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,9 @@ func Wrapper(title string, children ...g.Node) g.Node { | |
Meta(Name("htmx-config"), hx.Config( | ||
hxconfig.New().IncludeIndicatorStyles(false), | ||
)), | ||
Script(Src("https://unpkg.com/[email protected]")), | ||
Script(Src("https://unpkg.com/[email protected]/dist/ext/class-tools.js")), | ||
Script(Src("https://unpkg.com/[email protected]")), | ||
Script(Src("https://unpkg.com/[email protected]/dist/ext/class-tools.js")), | ||
Script(Src("https://unpkg.com/[email protected]/dist/ext/sse.js")), | ||
Link(Rel("stylesheet"), Href("https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css")), | ||
Link(Rel("stylesheet"), Href("https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/default.min.css")), | ||
Link(Rel("stylesheet"), Href("/static/main.css")), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,8 @@ templ Wrapper(title string, className ...string) { | |
hxconfig.New().Timeout(time.Second), | ||
)... } | ||
/> | ||
<script src="https://unpkg.com/[email protected].10"></script> | ||
<script src="https://unpkg.com/[email protected].10/dist/ext/class-tools.js"></script> | ||
<script src="https://unpkg.com/[email protected].12"></script> | ||
<script src="https://unpkg.com/[email protected].12/dist/ext/class-tools.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/ext/sse.js"></script> | ||
<link | ||
rel="stylesheet" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.