-- install/view.wo — the VIEW for /install. Static copy: no fields, so -- the component has none. It is still a component, and still renders -- through the same interface as every other page. use html pub class InstallPage { fn render() -> Text { let head = `

Install writeonce

Two native binaries — woc, the compiler, and wovm, the runtime VM. Both depend only on the system C library. There is no package manager to install, no language runtime to install on the machines you deploy to, and no build toolchain beyond these two files.

`; let s1 = section("1. Get the toolchain", `

Download the release tarball and extract it into /usr/local. Run this as root, or through sudo:

`, code_block("rm -rf /usr/local/writeonce\ntar -C /usr/local -xzf writeonce-0.1.0-linux-amd64.tar.gz")); let s2 = section("2. Put it on your PATH", `

Add one line to your $HOME/.profile (or /etc/profile for every user on the box), then restart your shell:

`, code_block("export PATH=$PATH:/usr/local/writeonce/bin")); let s3 = section("3. Check it", `

Both should print the same version. woc finds wovm beside itself, so a tarball install needs no further configuration.

`, code_block("woc version # writeonce 0.1.0 linux/amd64\nwovm --version # wovm 0.1.0")); let s4 = section("4. Your first project", `

A project is a directory with a wo.toml manifest and one or more .wo files. Nothing else — no lockfile to create by hand, no scaffolding step.

`, code_block("mkdir hello && cd hello\n\ncat > wo.toml <<'EOF'\nname = \"hello\"\nversion = \"0.1.0\"\n\n[runtime]\nwo = \">= 0.1\"\nEOF\n\ncat > main.wo <<'EOF'\nfn main() -> Int {\n print(\"hello, writeonce\");\n return 0;\n}\nEOF")); let s5 = section("5. Build and run", `

woc <dir> emits ONE standalone binary at target/<name>. Copy that file to a server and run it — the VM is inside it, and so is the database.

`, code_block("woc .\n./target/hello # hello, writeonce")); let s6 = section("6. Add a dependency", `

Dependencies are git repositories pinned by revision. The [deps] KEY is the module name your code uses. woc writes a wo.lock with the exact revision, and a locked build works offline. See Packages for what is available.

`, code_block("[deps]\nhtml = { git = \"https://github.com/shoneyj/wo-html\", rev = \"v0.1.0\" }")); let note = el("div", "bg-white rounded-lg border shadow-sm p-6 mt-8", el("h2", "text-lg font-bold mb-2", "Where things go") .. `

The tarball installs to /usr/local/writeonce: bin/woc, bin/wovm, and a VERSION file. To point woc at a different VM, set $WO_RUNTIME or add a [build] runtime = "..." key to wo.toml. A manifest may also require a minimum toolchain with [runtime] wo = ">= 0.1"; woc refuses to build a project that needs a newer toolchain than itself.

`); return head .. s1 .. s2 .. s3 .. s4 .. s5 .. s6 .. note; } } -- One numbered step: heading, prose, and the commands to run. fn section(title: Text, prose: Text, code: Text) -> Text { return el("div", "mb-8", el("h2", "text-2xl font-bold mb-2", title) .. prose .. code); }