PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/mason/md/v0

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v0
Namespace
mason / md
Files
2 (gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/mason/md/v0
gno
0.9

Files (2)

  • gnomod.tomltoml
  • md.gnogno
md.gnogno
1
package
md
2
3import (
4 "strings"
5)
6
7type MD struct {
8 elements []string
9}
10
11func New() *MD {
12 return &MD{elements: []string{}}
13}
14
15func (m *MD) H1(text string) {
16 m.elements = append(m.elements, "# "+text)
17}
18
19func (m *MD) H3(text string) {
20 m.elements = append(m.elements, "### "+text)
21}
22
23func (m *MD) P(text string) {
24 m.elements = append(m.elements, text)
25}
26
27func (m *MD) Code(text string) {
28 m.elements = append(m.elements, " ```\n"+text+"\n```\n")
29}
30
31func (m *MD) Im(path string, caption string) {
32 m.elements = append(m.elements, "!["+caption+"]("+path+" \""+caption+"\")")
33}
34
35func (m *MD) Bullet(point string) {
36 m.elements = append(m.elements, "- "+point)
37}
38
39func Link(text, url string, title ...string) string {
40 if len(title) > 0 && title[0] != "" {
41 return "[" + text + "](" + url + " \"" + title[0] + "\")"
42 }
43 return "[" + text + "](" + url + ")"
44}
45
46func (m *MD) Render() string {
47 return strings.Join(m.elements, "\n\n")
48}
49

Functions

not supported for pure packages by the node (vm/qfuncs)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.