Documentation ¶
Overview ¶
Package koluszki implements Renderer to render github.com/maragudk/gomponents Go code based on html.Node. It also provides CLI and HTTP server for your convenience.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
Render renders given html.Node into provided writer. Use NewRenderer if you need more control over output.
func WithRenderSVG ¶
func WithRenderSVG(r *Renderer)
WithRenderSVG tells Renderer to fully render SVG elements with gomponents package.
You can mix this option with WithHTMLPackageElements or WithHTMLPackageAttributes just fine.
By default, Renderer will use g.Raw function call to render SVGs.
Types ¶
type Option ¶
type Option func(*Renderer)
Option modifies Renderer. You cannot define your own options.
func WithGomponentsAlias ¶
WithGomponentsAlias tells Renderer to use alias for every function call from gomponents package in rendered code.
func WithHTMLPackageAttributes ¶
WithHTMLPackageElements tells Renderer to use gomponents/html package in order to render standard HTML attributes. It uses default gomponent package as fallback.
In order to have proper go code rendered, you have to provide gomponentsAlias, but you can leave htmlAlias empty.
Empty htmlAlias will render function calls imported into namespace with "." import operator.
func WithHTMLPackageElements ¶
WithHTMLPackageElements tells Renderer to use gomponents/html package in order to render standard HTML elements. It uses default gomponent package as fallback.
In order to have proper go code rendered, you have to provide gomponentsAlias, but you can leave htmlAlias empty.
Empty htmlAlias will render function calls imported into namespace with "." import operator.
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer renders github.com/maragudk/gomponents go code.
Use NewRenderer to initialize Renderer. Using default value of Renderer can end up with panic.
func NewRenderer ¶
NewRenderer returns new Renderer. It is the only way to create new intance of Renderer.