Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

render_example_test.gno

2.06 Kb · 54 lines
 1package gallery
 2
 3func ExampleRender() {
 4	println(Render("?fmt=txt"))
 5	// Output:
 6	// ╭──────────────────────╮
 7	// │moul's gallery        │
 8	// │art on gno.land       │
 9	// ╰──────────────────────╯
10	//
11	// Art on gno.land, rendered rather than described. Nothing here is stored
12	// in this realm: every piece lives where its author put it.
13	//
14	//   Piece        Author        Where                                                    Shown
15	//   -----------  ------------  -------------------------------------------------------  -------------
16	//   gnoface      moul          r/moul/demo/gnoface/v0                                   rendered here
17	//   millipede    moul          r/moul/demo/millipede/v0                                 rendered here
18	//   sapin        moul          r/moul/sapin/v0                                          rendered here
19	//   settler25    the Settlers  r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft  linked
20	//   asciiart     moul          r/moul/x/daily/asciiart/v1                               linked
21	//   pixelcanvas  moul          r/moul/x/daily/pixelcanvas/v0                            linked
22	//
23	// 3 pieces rendered from source, 3 pieces linked.
24	//
25	// Open one at /r/moul/gallery/v0:piece/<slug>, with ?fmt=txt for this
26	// form.
27}
28
29func ExampleRender_piece() {
30	println(Render("piece/millipede?fmt=txt"))
31	// Output:
32	// millipede
33	// =========
34	//
35	//     ╚⊙ ⊙╝
36	//   ╚═(███)═╝
37	//  ╚═(███)═╝
38	// ╚═(███)═╝
39	//  ╚═(███)═╝
40	//   ╚═(███)═╝
41	//    ╚═(███)═╝
42	//     ╚═(███)═╝
43	//     ╚═(███)═╝
44	//
45	// A millipede of any length. The oldest piece here, and still the one that
46	// best explains why ASCII is the cheapest picture there is.
47	//   Author: moul
48	//   License: see the source realm
49	//   Source: r/moul/demo/millipede/v0
50	//   the source realm [1]
51	//
52	// Links:
53	//   [1] https://gno.land/r/moul/demo/millipede/v0
54}