renderdiff

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: Apache-2.0, MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package renderdiff holds components that use every part of the template language, for the test that compares RenderHTML with the document a mount builds.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	oneui.Base
	Title string `oneui:"param,required"`
	Level int    `oneui:"param"`
	Mark  string `oneui:"param"`
	Notes string `oneui:"state"`
}

Card is a child with a default and a named slot and a fallback.

func (*Card) Build

func (c *Card) Build(parent, before oneui.NodeID)

Build implements oneui.Component: it creates the nodes of Card.

func (*Card) NotifyLevelChanged

func (c *Card) NotifyLevelChanged()

NotifyLevelChanged updates the nodes bound to Level after it was changed in place.

func (*Card) NotifyMarkChanged

func (c *Card) NotifyMarkChanged()

NotifyMarkChanged updates the nodes bound to Mark after it was changed in place.

func (*Card) NotifyNotesChanged

func (c *Card) NotifyNotesChanged()

NotifyNotesChanged updates the nodes bound to Notes after it was changed in place.

func (*Card) NotifyTitleChanged

func (c *Card) NotifyTitleChanged()

NotifyTitleChanged updates the nodes bound to Title after it was changed in place.

func (*Card) RenderHTML

func (c *Card) RenderHTML(w io.Writer) error

RenderHTML writes the markup of Card for its current state to w, without creating nodes or change sets: first paint and server-side rendering. It is the primary way to render; the root function RenderHTML(w, c) of package oneui does the same for a Component held as an interface. See HTMLRenderer in that package for what the markup contains and when to mount instead. On error the output is incomplete and the error is the first one w returned. It must not run while a setter of the same component runs.

func (*Card) SetLevel

func (c *Card) SetLevel(v int)

SetLevel sets Level and updates the nodes bound to it when the value changed.

func (*Card) SetMark

func (c *Card) SetMark(v string)

SetMark sets Mark and updates the nodes bound to it when the value changed.

func (*Card) SetNotes

func (c *Card) SetNotes(v string)

SetNotes sets Notes and updates the nodes bound to it when the value changed.

func (*Card) SetTitle

func (c *Card) SetTitle(v string)

SetTitle sets Title and updates the nodes bound to it when the value changed.

func (*Card) Update

func (c *Card) Update(dirty uint64)

Update implements oneui.Component: it brings the nodes bound to the state in dirty up to date.

type Item

type Item struct {
	ID    int
	Title string
	Done  bool
	Tags  []string
}

Item is one row of Page's list.

type Page

type Page struct {
	oneui.Base
	Title string   `oneui:"state"`
	Count int      `oneui:"state"`
	Ratio float64  `oneui:"state"`
	Big   int64    `oneui:"state"`
	Open  bool     `oneui:"state"`
	On    bool     `oneui:"state"`
	Color string   `oneui:"state"`
	Extra string   `oneui:"state"`
	Items []Item   `oneui:"state"`
	Names []string `oneui:"state"`
}

Page uses classes, bound and optional attributes, inline style, two-way bindings, if chains, nested each blocks, a child with slots, void elements and SVG.

func (*Page) Build

func (c *Page) Build(parent, before oneui.NodeID)

Build implements oneui.Component: it creates the nodes of Page.

func (*Page) Level

func (p *Page) Level() int

Level is a computed value read like a field.

func (*Page) NotifyBigChanged

func (c *Page) NotifyBigChanged()

NotifyBigChanged updates the nodes bound to Big after it was changed in place.

func (*Page) NotifyColorChanged

func (c *Page) NotifyColorChanged()

NotifyColorChanged updates the nodes bound to Color after it was changed in place.

func (*Page) NotifyCountChanged

func (c *Page) NotifyCountChanged()

NotifyCountChanged updates the nodes bound to Count after it was changed in place.

func (*Page) NotifyExtraChanged

func (c *Page) NotifyExtraChanged()

NotifyExtraChanged updates the nodes bound to Extra after it was changed in place.

func (*Page) NotifyItemsChanged

func (c *Page) NotifyItemsChanged()

NotifyItemsChanged updates the nodes bound to Items after it was changed in place.

func (*Page) NotifyNamesChanged

func (c *Page) NotifyNamesChanged()

NotifyNamesChanged updates the nodes bound to Names after it was changed in place.

func (*Page) NotifyOnChanged

func (c *Page) NotifyOnChanged()

NotifyOnChanged updates the nodes bound to On after it was changed in place.

func (*Page) NotifyOpenChanged

func (c *Page) NotifyOpenChanged()

NotifyOpenChanged updates the nodes bound to Open after it was changed in place.

func (*Page) NotifyRatioChanged

func (c *Page) NotifyRatioChanged()

NotifyRatioChanged updates the nodes bound to Ratio after it was changed in place.

func (*Page) NotifyTitleChanged

func (c *Page) NotifyTitleChanged()

NotifyTitleChanged updates the nodes bound to Title after it was changed in place.

func (*Page) RenderHTML

func (c *Page) RenderHTML(w io.Writer) error

RenderHTML writes the markup of Page for its current state to w, without creating nodes or change sets: first paint and server-side rendering. It is the primary way to render; the root function RenderHTML(w, c) of package oneui does the same for a Component held as an interface. See HTMLRenderer in that package for what the markup contains and when to mount instead. On error the output is incomplete and the error is the first one w returned. It must not run while a setter of the same component runs.

func (*Page) SetBig

func (c *Page) SetBig(v int64)

SetBig sets Big and updates the nodes bound to it when the value changed.

func (*Page) SetColor

func (c *Page) SetColor(v string)

SetColor sets Color and updates the nodes bound to it when the value changed.

func (*Page) SetCount

func (c *Page) SetCount(v int)

SetCount sets Count and updates the nodes bound to it when the value changed.

func (*Page) SetExtra

func (c *Page) SetExtra(v string)

SetExtra sets Extra and updates the nodes bound to it when the value changed.

func (*Page) SetItems

func (c *Page) SetItems(v []Item)

SetItems sets Items and always updates the nodes bound to it, because values of its type cannot be compared. Use NotifyItemsChanged after changing it in place.

func (*Page) SetNames

func (c *Page) SetNames(v []string)

SetNames sets Names and always updates the nodes bound to it, because values of its type cannot be compared. Use NotifyNamesChanged after changing it in place.

func (*Page) SetOn

func (c *Page) SetOn(v bool)

SetOn sets On and updates the nodes bound to it when the value changed.

func (*Page) SetOpen

func (c *Page) SetOpen(v bool)

SetOpen sets Open and updates the nodes bound to it when the value changed.

func (*Page) SetRatio

func (c *Page) SetRatio(v float64)

SetRatio sets Ratio and updates the nodes bound to it when the value changed.

func (*Page) SetTitle

func (c *Page) SetTitle(v string)

SetTitle sets Title and updates the nodes bound to it when the value changed.

func (*Page) Update

func (c *Page) Update(dirty uint64)

Update implements oneui.Component: it brings the nodes bound to the state in dirty up to date.

Jump to

Keyboard shortcuts

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