Help us shape the future of Go! Take the 2026 Go Developer Survey

form

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package form interprets task lists in attached Markdown documents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Defaults

func Defaults(items []Item) map[string]Answer

func Fingerprint

func Fingerprint(items []Item, id string) (string, error)

Fingerprint excludes source positions but includes the complete ordered group.

func Satisfied

func Satisfied(item Item, answer Answer) bool

func Selected

func Selected(item Item, answer Answer) bool

Types

type Answer

type Answer struct {
	Value    any    `json:"value"`
	Human    bool   `json:"human"`
	Author   string `json:"author,omitempty"`
	Revision string `json:"review_revision,omitempty"`
	Round    int    `json:"round,omitempty"`
}

type Item

type Item struct {
	ID         string `json:"id"`
	Value      string `json:"value,omitempty"`
	Choice     bool   `json:"choice,omitempty"`
	Explicit   bool   `json:"explicit,omitempty"`
	Required   bool   `json:"required,omitempty"`
	Consent    bool   `json:"consent,omitempty"`
	Initial    bool   `json:"initial,omitempty"`
	Label      string `json:"label"`
	Definition string `json:"definition"`
	Line       int    `json:"line"`
	EndLine    int    `json:"end_line"`
	Offset     int    `json:"offset"`
	Metadata   []Span `json:"metadata,omitempty"`
}

func Parse

func Parse(source string) ([]Item, error)

Parse uses the Markdown AST so examples, escaped lists, and quotations are inert.

type Span

type Span struct {
	Start int `json:"start"`
	End   int `json:"end"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL