ui.gno

1.06 Kb ยท 48 lines
 1package ui
 2
 3import "gno.land/p/demo/ui"
 4
 5func Render(path string) string {
 6	// TODO: build this realm as a demo one with one page per feature.
 7
 8	// TODO: pagination
 9	// TODO: non-standard markdown
10	// TODO: error, warn
11	// TODO: header
12	// TODO: HTML
13	// TODO: toc
14	// TODO: forms
15	// TODO: comments
16
17	dom := ui.DOM{
18		Prefix: "r/demo/ui:",
19	}
20
21	dom.Title = "UI Demo"
22
23	dom.Header.Append(ui.Breadcrumb{
24		ui.Link{Text: "foo", Path: "foo"},
25		ui.Link{Text: "bar", Path: "foo/bar"},
26	})
27
28	dom.Body.Append(
29		ui.Paragraph("Simple UI demonstration."),
30		ui.BulletList{
31			ui.Text("a text"),
32			ui.Link{Text: "a relative link", Path: "foobar"},
33			ui.Text("another text"),
34			// ui.H1("a H1 text"),
35			ui.Bold("a bold text"),
36			ui.Italic("italic text"),
37			ui.Text("raw markdown with **bold** text in the middle."),
38			ui.Code("some inline code"),
39			ui.Link{Text: "a remote link", URL: "https://gno.land"},
40		},
41	)
42
43	dom.Footer.Append(ui.Text("I'm the footer."))
44	dom.Body.Append(ui.Text("another string."))
45	dom.Body.Append(ui.Paragraph("a paragraph."), ui.HR{})
46
47	return dom.String()
48}