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/jeronimoalbi/mdform/v0

Package
Open in gnoweb ↗

Overview

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

Files (5)

  • README.mdmarkdown
  • gnomod.tomltoml
  • mdform.gnogno
  • mdform_filetest.gnogno
  • mdform_test.gnogno
README.mdPreviewRaw
# Markdown Form Package

The package provides a very simplistic [Gno-Flavored Markdown form](/r/docs/markdown#forms) generator.

Forms can be created by sequentially calling form methods to create each one of the form fields.

Example usage:

```go
import "gno.land/p/jeronimoalbi/mdform/v0"

func Render(string) string {
    form := mdform.New()

    // Add a text input field
    form.Input(
        "name",
        "placeholder", "Name",
        "value", "John Doe",
    )

    // Add a select field with three possible values
    form.Select(
        "country",
        "United States",
        "description", "Select your country",
    )
    form.Select(
        "country",
        "Spain",
    )
    form.Select(
        "country",
        "Germany",
    )

    // Add a checkbox group with two possible values
    form.Checkbox(
        "interests",
        "music",
        "description", "What do you like to do?",
    )
    form.Checkbox(
        "interests",
        "tech",
        "checked", "true",
    )

    return form.String()
}
```

Form output:

```html
<gno-form exec="FunctionName">
    <gno-input name="name" placeholder="Name" value="John Doe" />
    <gno-select name="country" value="United States" description="Select your country" />
    <gno-select name="country" value="Spain" />
    <gno-select name="country" value="Germany" />
    <gno-input type="checkbox" name="interests" value="music" description="What do you like to do?" />
    <gno-input type="checkbox" name="interests" value="tech" checked="true" />
</gno-form>
```

Functions

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

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