1// Package cowsaydemo is a small gnoweb demo of the cowsay renderer provided by2// the [p/moul/x/daily/cowsay](/p/moul/x/daily/cowsay/v0) library: it makes the3// ASCII cow say whatever you put in the path.4//5// It contains no rendering logic of its own — the art comes entirely from6// `cowsay.Say`.7package cowsaydemo89import (10 "strings"1112 "gno.land/p/moul/x/daily/cowsay/v0"13)1415// Render displays the cow for gnoweb.16//17// Render("") -> default message ("Moo!")18// Render("/hello there") -> renders "hello there", word-wrapped19func Render(path string) string {20 msg := strings.TrimLeft(path, "/")21 art := cowsay.Say(msg)2223 var b strings.Builder24 b.WriteString("# cowsay\n\n")25 if strings.TrimSpace(msg) == "" {26 b.WriteString("_Tip: pass a message in the path, e.g._ `/Hello, gno.land!`\n\n")27 }28 b.WriteString("```\n")29 b.WriteString(art)30 b.WriteString("```\n")31 return b.String()32}33Render(path string) string
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.