-
Notifications
You must be signed in to change notification settings - Fork 0
docs: get-started guide + docs embed package #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,10 @@ | ||
| --- | ||
| "kit": minor | ||
| --- | ||
|
|
||
| docs: export the getting-started guide via the new `docs` package. A new | ||
| author-facing `docs/get-started.md` (terminal-first, hard-wrapped at <=76 | ||
| columns) covers the quickstart (`shellcade-kit new` / `check` / `play`), | ||
| publishing to the public games catalog, and linking GitHub over SSH. The | ||
| new `docs` package embeds it as `docs.GetStarted` so the shellcade arcade | ||
| can render it directly in its "Add your own game" screen. |
This file contains hidden or 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,17 @@ | ||
| // Package docs embeds the author-facing getting-started guide so the | ||
| // shellcade arcade can render it directly in its "Add your own game" | ||
| // screen — a glamour-rendered Markdown pane inside an 80x24 SSH TUI. | ||
| // | ||
| // Because of that 80x24 budget, get-started.md is authored terminal-first: | ||
| // prose is hard-wrapped at <=76 columns and avoids HTML, images, and wide | ||
| // tables. Keep it that way when editing — anything wider clips or wraps | ||
| // badly in the pager. | ||
| package docs | ||
|
|
||
| import _ "embed" | ||
|
|
||
| // GetStarted is the rendered-ready Markdown of the author getting-started | ||
| // guide (get-started.md), embedded at build time. | ||
| // | ||
| //go:embed get-started.md | ||
| var GetStarted string |
This file contains hidden or 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,80 @@ | ||
| # Get started with shellcade | ||
|
|
||
| A shellcade game is a small WebAssembly plugin that draws to a fixed | ||
| 80x24 terminal canvas. You write it in Go (or Rust) against this kit, | ||
| test it locally with no wasm and no network, compile it to wasm, and | ||
| submit the artifact — the arcade hosts it sandboxed and reachable over | ||
| SSH at shellcade.com. | ||
|
|
||
| ## Quickstart | ||
|
|
||
| Install the one author tool, `shellcade-kit` (scaffold, verify, play). | ||
| On macOS, use Homebrew: | ||
|
|
||
| brew install shellcade/tap/shellcade-kit | ||
|
|
||
| <details> | ||
| <summary>Manual download (Linux / Windows / no brew)</summary> | ||
|
|
||
| Grab a build for your platform from this repo's Releases: | ||
|
|
||
| https://github.com/shellcade/kit/releases | ||
|
|
||
| (macOS downloads may be quarantined: | ||
| `xattr -d com.apple.quarantine shellcade-kit` clears it. The brew cask | ||
| strips this for you.) | ||
|
|
||
| </details> | ||
|
|
||
| Scaffold a game and play it in your terminal — the inner loop is a plain | ||
| Go program (debugger, prints, sub-second builds), no wasm required: | ||
|
|
||
| shellcade-kit new mygame | ||
| cd mygame && go mod tidy && go run . | ||
|
|
||
| Edit `main.go`, run `go run .` again, and you are iterating. When you | ||
| want the real artifact, build the wasm and check it against the same | ||
| gate the arcade runs, then play that artifact on the production engine: | ||
|
|
||
| shellcade-kit check game.wasm | ||
| shellcade-kit play game.wasm | ||
|
|
||
| `check` passing locally is the arcade's acceptance bar — same code, same | ||
| verdict. Multiplayer testing is hot-seat: pass `--seats N` to join N | ||
| players to one room and Ctrl-T to switch the seat your keyboard drives. | ||
|
|
||
| Prefer Rust? `shellcade-kit new --rust mygame` scaffolds the same game | ||
| shape on the Rust SDK; the mental model carries over one for one. | ||
|
|
||
| ## Publish your game | ||
|
|
||
| Games live in the public catalog at github.com/shellcade/games. To ship: | ||
|
|
||
| 1. Build your wasm and confirm `shellcade-kit check game.wasm` is green. | ||
| 2. Open a pull request that adds your game to the catalog. | ||
| 3. When the PR is merged it cuts a release of your game. | ||
| 4. An operator reviews the release and takes it live in the arcade. | ||
|
|
||
| Every game in the catalog is conformance-green, so the check gate is the | ||
| bar both for your PR and for going live. Read a complete, published game | ||
| to learn the patterns before you submit. | ||
|
|
||
| ## Link your GitHub | ||
|
|
||
| Link your GitHub account so the games you publish are attributed to you | ||
| in the arcade. Connect over SSH: | ||
|
|
||
| ssh shellcade.com | ||
|
|
||
| Then open the User menu and choose Link GitHub, and follow the prompt. | ||
| Once linked, games you author show up under your name. | ||
|
|
||
| ## Where to go next | ||
|
|
||
| - GUIDE.md — the full authoring guide: the event-to-frame model, time | ||
| via OnWake, input and controls, leaderboards, durable per-player KV, | ||
| multiplayer rendering, and smoke scripts. | ||
| - ABI.md — the normative contract: the wasm ABI, host functions, and | ||
| the packed payload encodings the kit compiles against. | ||
| - github.com/shellcade/games — the public catalog of published games to | ||
| read and learn from. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should offer brew for macOS, and this as an alternative inside an expand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in dc9c7d5. The Quickstart now leads with the macOS brew command:
(the documented cask from the GoReleaser
homebrew_casksconfig — itspost-install hook strips quarantine, and brew downloads skip it anyway).
The manual Releases download — and the
xattrquarantine note, which isonly relevant to hand-downloaded binaries — now lives inside a
<details>expand titled "Manual download (Linux / Windows / no brew)". The
<details>/
</details>tag lines sit alone between blank lines, so GitHub collapsesthe block while glamour (the shellcade TUI renderer) drops the raw HTML tag
lines and still renders the inner markdown inline — terminal users in the
"Add your own game" screen lose nothing. All lines stay <=76 cols.