Update kjol website with C documentation
This commit is contained in:
@@ -21,27 +21,34 @@ import (
|
||||
"kjol/webui"
|
||||
|
||||
"kjolweb/app"
|
||||
"kjolweb/buildsteps"
|
||||
"kjolweb/build"
|
||||
"kjolweb/internal/handlers"
|
||||
)
|
||||
|
||||
func main() {
|
||||
addr := flag.String("addr", ":8085", "listen address")
|
||||
watch := flag.Bool("watch", true, "watch sources, rebuild wasm, hot-reload")
|
||||
buildOnly := flag.Bool("build", false, "run the full build once and exit (no server)")
|
||||
flag.Parse()
|
||||
|
||||
if *buildOnly {
|
||||
build.Cold()
|
||||
return
|
||||
}
|
||||
|
||||
log.Fatal(wasmdevserver.Serve(wasmdevserver.Config{
|
||||
Addr: *addr,
|
||||
Dir: "./wwwroot",
|
||||
Watch: *watch,
|
||||
WatchDirs: []string{
|
||||
"app", "wasm", "css", // this app's Go/WASM half
|
||||
"frontend", // its Solid half — a .tsx save rebuilds the JS bundle
|
||||
"app", "wasm", "css", // the Go/WASM app
|
||||
"frontend", // the Solid app — a .tsx save rebuilds the JS bundle
|
||||
"../../webui", "../../vdom", "../../wasmruntime", "../../rsc", // the wasm engine
|
||||
"../../lexer", // the code-block highlighter
|
||||
"../../jsruntime/uikit", "../../jsruntime/styles", // the Solid kit + the shared theme
|
||||
},
|
||||
Build: buildsteps.All,
|
||||
BuildCSS: buildsteps.Tailwind, // a .css save skips codegen+wasm and hot-swaps the stylesheet
|
||||
Build: build.All,
|
||||
BuildCSS: build.Tailwind, // a .css save skips codegen+wasm and hot-swaps the stylesheet
|
||||
Render: render,
|
||||
Document: document,
|
||||
Handle: routes,
|
||||
@@ -71,10 +78,10 @@ func routes(mux *http.ServeMux) {
|
||||
// document — the client router reads the URL and decides what to render, which is what
|
||||
// makes it a single-page app.
|
||||
//
|
||||
// It carries no server-rendered markup, and that is a real difference from the Go/WASM
|
||||
// half rather than an oversight: this section is a docs section behind a click, where a
|
||||
// blank first frame costs nothing. Where it WOULD cost something, the public-page path
|
||||
// (see internal/handlers) renders on the server instead — /js/ssr is that, and it is
|
||||
// It carries no server-rendered markup, and that is a real difference from Kjøl Wasm Web
|
||||
// rather than an oversight: this is a docs section behind a click, where a blank first
|
||||
// frame costs nothing. Where it WOULD cost something, the public-page path (see
|
||||
// internal/handlers) renders on the server instead — /js/ssr is that, and it is
|
||||
// registered above, so it never reaches this handler.
|
||||
func serveJSApp(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
@@ -83,7 +90,7 @@ func serveJSApp(w http.ResponseWriter, r *http.Request) {
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Kjol JS Web</title>
|
||||
<title>Kjøl JS Web</title>
|
||||
`+webui.ThemeBootScript+`
|
||||
<link rel="stylesheet" href="/bundle.min.css" />
|
||||
</head>
|
||||
@@ -130,7 +137,7 @@ func document(inner string) string {
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>kjol — a shared base layer</title>
|
||||
<title>kjøl — a shared base layer</title>
|
||||
` + webui.ThemeBootScript + `
|
||||
<link rel="stylesheet" href="/app.css" />
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user