<commit_before>package form

import (
	"gnd.la/html"
	"io"
)

// Renderer is the interface implemented to help the form
// render its elements. Without a Renderer, the form won't
// render errors nor help messages. Each function is called
// at most once for each non-hidden field included in the form.
type Renderer interface {
	// BeginField is called before starting to write any field.
	BeginField(w io.Writer, field *Field) error
	// BeginLabel is called before writing the label. It might be
	// called multiple times for radio fields.
	BeginLabel(w io.Writer, field *Field, pos int) error
	// LabelAttributes is called just before writing the <label> for the field.
	LabelAttributes(field *Field, pos int) (html.Attrs, error)
	// EndLabel is called before writing the end of the label. It might be
	// called multiple times for radio fields.
	EndLabel(w io.Writer, field *Field, pos int) error
	// BeginInput is called just before writing the <input> or equivalent tag
	// or any addons. For radio fields BeginInput will be called multiple times,
	// one per option.
	BeginInput(w io.Writer, field *Field, pos int) error
	// FieldAttributes is called just before writing the field (input, textarea, etc...)
	FieldAttributes(field *Field, pos int) (html.Attrs, error)
	// EndInput is called just after writing the <input> or equivalent tag and
	// all the addons. For radio fields EndInput will be called multiple times,
	// one per option.
	EndInput(w io.Writer, field *Field, pos int) error<commit_msg>Fix doc<commit_after>package form

import (
	"gnd.la/html"
	"io"
)

// Renderer is the interface implemented to help the form
// render its elements. Without a Renderer, the form won't
// render errors nor help messages. Except when noted otherwise,
// each function is called at most once for each non-hidden field
// included in the form.
type Renderer interface {
	// BeginField is called before starting to write any field.
	BeginField(w io.Writer, field *Field) error
	// BeginLabel is called before writing the label. It might be
	// called multiple times for radio fields.
	BeginLabel(w io.Writer, field *Field, pos int) error
	// LabelAttributes is called just before writing the <label> for the field.
	LabelAttributes(field *Field, pos int) (html.Attrs, error)
	// EndLabel is called before writing the end of the label. It might be
	// called multiple times for radio fields.
	EndLabel(w io.Writer, field *Field, pos int) error
	// BeginInput is called just before writing the <input> or equivalent tag
	// or any addons. For radio fields BeginInput will be called multiple times,
	// one per option.
	BeginInput(w io.Writer, field *Field, pos int) error
	// FieldAttributes is called just before writing the field (input, textarea, etc...)
	FieldAttributes(field *Field, pos int) (html.Attrs, error)
	// EndInput is called just after writing the <input> or equivalent tag and
	// all the addons. For radio fields EndInput will be called multiple times,
	// one per option.
	EndInput(w io.Writer, field *Field, pos int) error
{'fraction_non_alphanumeric': 0.08108995403808274, 'fraction_numerical': 0.0, 'mean_word_length': 3.7984251968503937, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3899373', 'n_tokens_mistral': 835, 'n_tokens_neox': 832, 'n_words': 424}