nodx

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 5 Imported by: 3

README

NodX for Go

Go Reference Go Report Card Release Version License

NodX is a modern and developer-friendly Go template engine for generating safe, clean, and maintainable HTML. Designed for maximum productivity and easy maintenance, it combines simplicity, type safety and robust formatting, making it the perfect fit for your Go-based web projects.

Key Features

  • Type Safety 🛡️: Fully typed APIs ensure you write error-free HTML, even at scale.
  • Robust Formatting 🧹: Works seamlessly with go fmt to keep your code clean and consistent.
  • Zero Dependencies 📦: Lightweight and fast, with no external dependencies.
  • DX in mind 🧠: If you can write HTML and Go, you can write NodX.
  • Security by Default 🔒: Automatically escapes unsafe text to prevent XSS vulnerabilities.

Quick Start

Install the library:

# Go 1.22 or later is required
go get github.com/nodxdev/nodxgo

Start building your HTML with intuitive, type-safe functions:

package main

import (
  "os"
  "github.com/nodxdev/nodxgo"
)

func main() {
  // you can fetch this from a database or some other source
  happiness := 100
  hideContainer := false

  myTemplate := nodx.Group(
    nodx.DocType(),
    nodx.Html(
      nodx.Head(
        nodx.TitleEl(nodx.Text("My NodX Page")),
      ),
      nodx.Body(
        nodx.Div(
          nodx.ClassMap{
            "container": true,
            "hidden":    hideContainer,
          },
          nodx.H1(
            nodx.Class("title"),
            nodx.Textf("Welcome to %s!", "NodX"),
          ),
          nodx.P(nodx.Text("This is a type-safe HTML generator for Go.")),
          nodx.If(happiness > 90, nodx.P(nodx.Textf("With NodX, you will be %d%% happy!", happiness))),
        ),
      ),
    ),
  )

  _ = myTemplate.Render(os.Stdout)
  // or
  // str, err := myTemplate.RenderString()
  // byt, err := myTemplate.RenderBytes()
}
Output:
<!DOCTYPE html>
<html>
  <head>
    <title>My NodX Page</title>
  </head>
  <body>
    <div class="container">
      <h1 class="title">Welcome to NodX!</h1>
      <p>This is a type-safe HTML generator for Go.</p>
      <p>With NodX, you will be 100% happy!</p>
    </div>
  </body>
</html>

Key Concepts

1. Elements made easy

Every HTML tag is a function! Just call the function with child elements, attributes, groups or text.

nodx.Div(
  nodx.Class("container"),
  nodx.H1(nodx.Text("Hello, NodX!")),
  nodx.P(nodx.Text("Build clean and safe HTML effortlessly.")),
)
2. Attributes with helpers

Attributes like class, src, and alt have their own functions for simplicity.

nodx.Img(
  nodx.Src("image.jpg"),
  nodx.Alt("A beautiful image"),
)
3. Dynamic class management

Use ClassMap to conditionally apply classes based on your logic.

nodx.Div(
  nodx.ClassMap{
    "visible": true,
    "hidden":  false,
  },
  nodx.Text("Conditional classes made simple!"),
)
4. Fully typed server rendered components

You can create your own components to avoid code duplication and keep your code clean.

func button(text string) nodx.Node {
  return nodx.Button(
    nodx.Class("btn"),
    nodx.Text(text),
  )
}

func main() {
  myTemplate := nodx.Div(
    button("Click me 1!"),
    button("Click me 2!"),
    button("Click me 3!"),
  )

  _ = myTemplate.Render(os.Stdout)

  /*
    Output:
    <div>
      <button class="btn">Click me 1!</button>
      <button class="btn">Click me 2!</button>
      <button class="btn">Click me 3!</button>
    </div>
  */
}
5. Advanced features

Please refer to the Full Documentation to read more about all the included features.

  • Custom components: You can create your own components to avoid code duplication and keep your code clean.
  • Conditional rendering: You can use the nodx.If and nodx.IfFunc function to conditionally render elements based on your logic.
  • Map: You can use the nodx.Map function to loop over a list of items and render them as a list of Nodes.
  • Custom elements and attributes: You can use nodx.El and nodx.Attr to create your own elements and attributes if they are not included in the library.
  • Component library: You can write your own component library and publish it for others to use.
  • Dynamic classes and styles: You can use the nodx.ClassMap and nodx.StyleMap to conditionally apply classes and styles based on your own logic.

Why Choose NodX?

  • Expressive and Clear Code: Great helpers (Div, H1, P, etc.) that mirror HTML semantics, making your Go code as readable as HTML.
  • Battle-Tested for Safety: Text is escaped automatically to protect your app from XSS vulnerabilities.
  • Lightweight and Efficient: With no dependencies, you can focus on building without bloat.
  • Perfect for Modern Go Developers: Designed with Go's simplicity and elegance in mind.

License

NodX is open-source and available under the MIT License. Feel free to use it in your personal or commercial projects.


Start building safe, elegant, and maintainable HTML templates in Go today with NodX!

Documentation

Overview

Package nodx is a modern and developer-friendly Go template engine for generating safe, clean, and maintainable HTML. Designed for maximum productivity and easy maintenance, it combines simplicity, type safety and robust formatting, making it the perfect fit for your Go-based web projects.

In NodX, everything is a node and anything that implements the Node interface can be rendered as HTML or used as a Node child.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeHTML

func EscapeHTML(input string) string

EscapeHTML escapes the input string to prevent XSS attacks.

Types

type ClassMap

type ClassMap map[string]bool

ClassMap represents a map of class names with conditional rendering. The keys are the class names, and the values are boolean expressions (conditions) that determine whether each class should be included in the final output.

Example:

isOdd := func(n int) bool { return n % 2 != 0 }
isEven := func(n int) bool { return n % 2 == 0 }

renderOdd := isOdd(3)   // true
renderEven := isEven(3) // false

cm := ClassMap{
	"odd-class":  renderOdd,      // Included
	"even-class": renderEven,     // Excluded
	"always-on":  true,           // Always included
}

This will render the class attribute as: class="odd-class always-on"

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	shouldHide := 3 > 2

	node := nodx.Div(
		nodx.ClassMap{
			"container": true,
			"other":     false,
			"hidden":    shouldHide,
		},
		nodx.Text("Hello, World!"),
	)

	fmt.Println(node)
}
Output:

<div class="container hidden">Hello, World!</div>

func (ClassMap) IsAttribute added in v0.2.0

func (cm ClassMap) IsAttribute() bool

func (ClassMap) IsElement added in v0.2.0

func (cm ClassMap) IsElement() bool

func (ClassMap) Render

func (cm ClassMap) Render(w io.Writer) error

func (ClassMap) RenderBytes

func (cm ClassMap) RenderBytes() ([]byte, error)

func (ClassMap) RenderString

func (cm ClassMap) RenderString() (string, error)

func (ClassMap) String added in v0.2.0

func (cm ClassMap) String() string

type Node

type Node interface {
	// Render writes the node HTML to the writer.
	Render(w io.Writer) error

	// RenderString returns the node HTML as a string.
	RenderString() (string, error)

	// RenderBytes returns the node HTML as a byte slice.
	RenderBytes() ([]byte, error)

	// IsElement indicates if the node should be rendered as an element.
	IsElement() bool

	// IsAttribute indicates if the node should be rendered as an attribute.
	IsAttribute() bool

	// String returns the node HTML as a string and implements the fmt.Stringer interface.
	//
	// This is only for convenience and debugging purposes and it ignores the
	// error return value.
	//
	// You should use RenderString() whenever possible.
	String() string
}

Node is the interface that wraps the basic Render methods used in the different NodX node types.

Anything that implements this interface can be used as a node.

func A

func A(children ...Node) Node

A defines a hyperlink.

func ExampleA() {
	node := nodx.A(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <a id="1">Hello World!</a>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.A(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<a id="1">Hello World!</a>

func Abbr

func Abbr(children ...Node) Node

Abbr defines an abbreviation or acronym.

func ExampleAbbr() {
	node := nodx.Abbr(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <abbr id="1">Hello World!</abbr>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Abbr(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<abbr id="1">Hello World!</abbr>

func Accept

func Accept(value string) Node

Accept specifies the types of files that the server accepts (only for input type='file').

func ExampleAccept() {
	node := nodx.Accept("value")
	fmt.Println(node)
	// Output: accept="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Accept("value")
	fmt.Println(node)
}
Output:

accept="value"

func AcceptCharset

func AcceptCharset(value string) Node

AcceptCharset specifies the character encodings to be used for form submission.

func ExampleAcceptCharset() {
	node := nodx.AcceptCharset("value")
	fmt.Println(node)
	// Output: accept-charset="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.AcceptCharset("value")
	fmt.Println(node)
}
Output:

accept-charset="value"

func Accesskey

func Accesskey(value string) Node

Accesskey specifies a shortcut key to activate/focus an element.

func ExampleAccesskey() {
	node := nodx.Accesskey("value")
	fmt.Println(node)
	// Output: accesskey="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Accesskey("value")
	fmt.Println(node)
}
Output:

accesskey="value"

func Action

func Action(value string) Node

Action specifies where to send the form-data when a form is submitted.

func ExampleAction() {
	node := nodx.Action("value")
	fmt.Println(node)
	// Output: action="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Action("value")
	fmt.Println(node)
}
Output:

action="value"

func Address

func Address(children ...Node) Node

Address defines contact information for the author/owner of a document.

func ExampleAddress() {
	node := nodx.Address(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <address id="1">Hello World!</address>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Address(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<address id="1">Hello World!</address>

func Align

func Align(value string) Node

Align specifies the alignment of the element's content.

func ExampleAlign() {
	node := nodx.Align("value")
	fmt.Println(node)
	// Output: align="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Align("value")
	fmt.Println(node)
}
Output:

align="value"

func Allow

func Allow(value string) Node

Allow specifies a feature policy for the iframe.

func ExampleAllow() {
	node := nodx.Allow("value")
	fmt.Println(node)
	// Output: allow="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Allow("value")
	fmt.Println(node)
}
Output:

allow="value"

func Alt

func Alt(value string) Node

Alt provides alternative text for an image if it cannot be displayed.

func ExampleAlt() {
	node := nodx.Alt("value")
	fmt.Println(node)
	// Output: alt="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Alt("value")
	fmt.Println(node)
}
Output:

alt="value"

func Applet

func Applet(children ...Node) Node

Applet defines an embedded applet (deprecated).

func ExampleApplet() {
	node := nodx.Applet(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <applet id="1">Hello World!</applet>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Applet(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<applet id="1">Hello World!</applet>

func Area

func Area(children ...Node) Node

Area defines an area inside an image-map.

func ExampleArea() {
	node := nodx.Area(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <area id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Area(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<area id="1">

func Aria

func Aria(key string, value string) Node

Aria defines accessibility semantics or aria properties.

func ExampleAria() {
	node := nodx.Aria("key", "value")
	fmt.Println(node)
	// Output: aria-key="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Aria("key", "value")
	fmt.Println(node)
}
Output:

aria-key="value"

func Article

func Article(children ...Node) Node

Article defines an article.

func ExampleArticle() {
	node := nodx.Article(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <article id="1">Hello World!</article>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Article(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<article id="1">Hello World!</article>

func Aside

func Aside(children ...Node) Node

Aside defines content aside from the page content.

func ExampleAside() {
	node := nodx.Aside(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <aside id="1">Hello World!</aside>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Aside(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<aside id="1">Hello World!</aside>

func Async

func Async(value string) Node

Async indicates that the script should be executed asynchronously.

func ExampleAsync() {
	node := nodx.Async("value")
	fmt.Println(node)
	// Output: async="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Async("value")
	fmt.Println(node)
}
Output:

async="value"

func Attr

func Attr(name string, value ...string) Node

Attr creates a new Node representing an HTML attribute with a name and value. The value is HTML-escaped to prevent XSS attacks.

If you don't provide a value, the attribute will be rendered without it.

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Div(
		nodx.Attr("my-custom-attr", "foo"),
	)

	fmt.Println(node)
}
Output:

<div my-custom-attr="foo"></div>

func Audio

func Audio(children ...Node) Node

Audio defines embedded sound content.

func ExampleAudio() {
	node := nodx.Audio(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <audio id="1">Hello World!</audio>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Audio(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<audio id="1">Hello World!</audio>

func Autocapitalize

func Autocapitalize(value string) Node

Autocapitalize controls how text input is automatically capitalized.

func ExampleAutocapitalize() {
	node := nodx.Autocapitalize("value")
	fmt.Println(node)
	// Output: autocapitalize="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Autocapitalize("value")
	fmt.Println(node)
}
Output:

autocapitalize="value"

func Autocomplete

func Autocomplete(value string) Node

Autocomplete specifies whether an input field should have autocomplete enabled.

func ExampleAutocomplete() {
	node := nodx.Autocomplete("value")
	fmt.Println(node)
	// Output: autocomplete="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Autocomplete("value")
	fmt.Println(node)
}
Output:

autocomplete="value"

func Autofocus

func Autofocus(value string) Node

Autofocus specifies that an input field should automatically get focus when the page loads.

func ExampleAutofocus() {
	node := nodx.Autofocus("value")
	fmt.Println(node)
	// Output: autofocus="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Autofocus("value")
	fmt.Println(node)
}
Output:

autofocus="value"

func Autoplay

func Autoplay(value string) Node

Autoplay specifies that the audio/video should start playing as soon as it is ready.

func ExampleAutoplay() {
	node := nodx.Autoplay("value")
	fmt.Println(node)
	// Output: autoplay="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Autoplay("value")
	fmt.Println(node)
}
Output:

autoplay="value"

func B

func B(children ...Node) Node

B defines bold text.

func ExampleB() {
	node := nodx.B(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <b id="1">Hello World!</b>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.B(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<b id="1">Hello World!</b>

func Background

func Background(value string) Node

Background specifies a background image for the element.

func ExampleBackground() {
	node := nodx.Background("value")
	fmt.Println(node)
	// Output: background="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Background("value")
	fmt.Println(node)
}
Output:

background="value"

func Base

func Base(children ...Node) Node

Base specifies the base URL for all relative URLs in a document.

func ExampleBase() {
	node := nodx.Base(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <base id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Base(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<base id="1">

func Basefont

func Basefont(children ...Node) Node

Basefont specifies a default color, size, and font for all text in a document (deprecated).

func ExampleBasefont() {
	node := nodx.Basefont(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <basefont id="1">Hello World!</basefont>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Basefont(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<basefont id="1">Hello World!</basefont>

func Bdi

func Bdi(children ...Node) Node

Bdi isolates a part of text that might be formatted in a different direction from other text.

func ExampleBdi() {
	node := nodx.Bdi(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <bdi id="1">Hello World!</bdi>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Bdi(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<bdi id="1">Hello World!</bdi>

func Bdo

func Bdo(children ...Node) Node

Bdo overrides the current text direction.

func ExampleBdo() {
	node := nodx.Bdo(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <bdo id="1">Hello World!</bdo>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Bdo(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<bdo id="1">Hello World!</bdo>

func Bgcolor

func Bgcolor(value string) Node

Bgcolor specifies the background color of an element.

func ExampleBgcolor() {
	node := nodx.Bgcolor("value")
	fmt.Println(node)
	// Output: bgcolor="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Bgcolor("value")
	fmt.Println(node)
}
Output:

bgcolor="value"

func Blockquote

func Blockquote(children ...Node) Node

Blockquote defines a section that is quoted from another source.

func ExampleBlockquote() {
	node := nodx.Blockquote(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <blockquote id="1">Hello World!</blockquote>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Blockquote(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<blockquote id="1">Hello World!</blockquote>

func Body

func Body(children ...Node) Node

Body defines the body of the document.

func ExampleBody() {
	node := nodx.Body(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <body id="1">Hello World!</body>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Body(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<body id="1">Hello World!</body>

func Border

func Border(value string) Node

Border specifies the border width.

func ExampleBorder() {
	node := nodx.Border("value")
	fmt.Println(node)
	// Output: border="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Border("value")
	fmt.Println(node)
}
Output:

border="value"

func Br

func Br(children ...Node) Node

Br inserts a single line break.

func ExampleBr() {
	node := nodx.Br(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <br id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Br(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<br id="1">

func Buffered

func Buffered(value string) Node

Buffered contains the time ranges that the media element has buffered.

func ExampleBuffered() {
	node := nodx.Buffered("value")
	fmt.Println(node)
	// Output: buffered="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Buffered("value")
	fmt.Println(node)
}
Output:

buffered="value"

func Button

func Button(children ...Node) Node

Button defines a clickable button.

func ExampleButton() {
	node := nodx.Button(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <button id="1">Hello World!</button>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Button(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<button id="1">Hello World!</button>

func Canvas

func Canvas(children ...Node) Node

Canvas used to draw graphics on the fly via scripting.

func ExampleCanvas() {
	node := nodx.Canvas(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <canvas id="1">Hello World!</canvas>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Canvas(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<canvas id="1">Hello World!</canvas>

func Caption

func Caption(children ...Node) Node

Caption defines a table caption.

func ExampleCaption() {
	node := nodx.Caption(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <caption id="1">Hello World!</caption>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Caption(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<caption id="1">Hello World!</caption>

func Capture

func Capture(value string) Node

Capture specifies that the camera should be used for input.

func ExampleCapture() {
	node := nodx.Capture("value")
	fmt.Println(node)
	// Output: capture="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Capture("value")
	fmt.Println(node)
}
Output:

capture="value"

func Center

func Center(children ...Node) Node

Center defines centered text (deprecated).

func ExampleCenter() {
	node := nodx.Center(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <center id="1">Hello World!</center>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Center(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<center id="1">Hello World!</center>

func Challenge

func Challenge(value string) Node

Challenge specifies that the value of the keygen element should be challenged when submitted.

func ExampleChallenge() {
	node := nodx.Challenge("value")
	fmt.Println(node)
	// Output: challenge="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Challenge("value")
	fmt.Println(node)
}
Output:

challenge="value"

func Charset

func Charset(value string) Node

Charset specifies the character encoding.

func ExampleCharset() {
	node := nodx.Charset("value")
	fmt.Println(node)
	// Output: charset="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Charset("value")
	fmt.Println(node)
}
Output:

charset="value"

func Checked

func Checked(value string) Node

Checked specifies that an input element should be pre-selected when the page loads.

func ExampleChecked() {
	node := nodx.Checked("value")
	fmt.Println(node)
	// Output: checked="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Checked("value")
	fmt.Println(node)
}
Output:

checked="value"

func CiteAttr

func CiteAttr(value string) Node

CiteAttr specifies a URL that explains the quote, or why a text was inserted/deleted.

func ExampleCiteAttr() {
	node := nodx.CiteAttr("value")
	fmt.Println(node)
	// Output: cite="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.CiteAttr("value")
	fmt.Println(node)
}
Output:

cite="value"

func CiteEl

func CiteEl(children ...Node) Node

CiteEl defines the title of a work.

func ExampleCiteEl() {
	node := nodx.CiteEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <cite id="1">Hello World!</cite>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.CiteEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<cite id="1">Hello World!</cite>

func Class

func Class(value string) Node

Class specifies one or more class names for an element.

func ExampleClass() {
	node := nodx.Class("value")
	fmt.Println(node)
	// Output: class="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Class("value")
	fmt.Println(node)
}
Output:

class="value"

func CodeAttr

func CodeAttr(value string) Node

CodeAttr specifies the URL of the applet's class file to be loaded and executed.

func ExampleCodeAttr() {
	node := nodx.CodeAttr("value")
	fmt.Println(node)
	// Output: code="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.CodeAttr("value")
	fmt.Println(node)
}
Output:

code="value"

func CodeEl

func CodeEl(children ...Node) Node

CodeEl defines a piece of computer code.

func ExampleCodeEl() {
	node := nodx.CodeEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <code id="1">Hello World!</code>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.CodeEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<code id="1">Hello World!</code>

func Codebase

func Codebase(value string) Node

Codebase specifies the base URL for an applet.

func ExampleCodebase() {
	node := nodx.Codebase("value")
	fmt.Println(node)
	// Output: codebase="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Codebase("value")
	fmt.Println(node)
}
Output:

codebase="value"

func Col

func Col(children ...Node) Node

Col specifies column properties for each column within a colgroup element.

func ExampleCol() {
	node := nodx.Col(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <col id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Col(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<col id="1">

func Colgroup

func Colgroup(children ...Node) Node

Colgroup specifies a group of one or more columns in a table for formatting.

func ExampleColgroup() {
	node := nodx.Colgroup(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <colgroup id="1">Hello World!</colgroup>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Colgroup(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<colgroup id="1">Hello World!</colgroup>

func Color

func Color(value string) Node

Color specifies the text color of an element.

func ExampleColor() {
	node := nodx.Color("value")
	fmt.Println(node)
	// Output: color="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Color("value")
	fmt.Println(node)
}
Output:

color="value"

func Cols

func Cols(value string) Node

Cols specifies the visible width of a text area.

func ExampleCols() {
	node := nodx.Cols("value")
	fmt.Println(node)
	// Output: cols="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Cols("value")
	fmt.Println(node)
}
Output:

cols="value"

func Colspan

func Colspan(value string) Node

Colspan specifies the number of columns a cell should span.

func ExampleColspan() {
	node := nodx.Colspan("value")
	fmt.Println(node)
	// Output: colspan="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Colspan("value")
	fmt.Println(node)
}
Output:

colspan="value"

func Content

func Content(value string) Node

Content gives the value associated with the http-equiv or name attribute.

func ExampleContent() {
	node := nodx.Content("value")
	fmt.Println(node)
	// Output: content="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Content("value")
	fmt.Println(node)
}
Output:

content="value"

func Contenteditable

func Contenteditable(value string) Node

Contenteditable specifies whether the content of an element is editable.

func ExampleContenteditable() {
	node := nodx.Contenteditable("value")
	fmt.Println(node)
	// Output: contenteditable="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Contenteditable("value")
	fmt.Println(node)
}
Output:

contenteditable="value"

func Contextmenu

func Contextmenu(value string) Node

Contextmenu specifies a context menu for an element.

func ExampleContextmenu() {
	node := nodx.Contextmenu("value")
	fmt.Println(node)
	// Output: contextmenu="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Contextmenu("value")
	fmt.Println(node)
}
Output:

contextmenu="value"

func Controls

func Controls(value string) Node

Controls specifies that audio/video controls should be displayed.

func ExampleControls() {
	node := nodx.Controls("value")
	fmt.Println(node)
	// Output: controls="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Controls("value")
	fmt.Println(node)
}
Output:

controls="value"

func Coords

func Coords(value string) Node

Coords specifies the coordinates of an area in an image-map.

func ExampleCoords() {
	node := nodx.Coords("value")
	fmt.Println(node)
	// Output: coords="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Coords("value")
	fmt.Println(node)
}
Output:

coords="value"

func Crossorigin

func Crossorigin(value string) Node

Crossorigin configures the CORS requests for the element's fetched data.

func ExampleCrossorigin() {
	node := nodx.Crossorigin("value")
	fmt.Println(node)
	// Output: crossorigin="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Crossorigin("value")
	fmt.Println(node)
}
Output:

crossorigin="value"

func Csp

func Csp(value string) Node

Csp allows specifying a Content Security Policy for the content in the iframe.

func ExampleCsp() {
	node := nodx.Csp("value")
	fmt.Println(node)
	// Output: csp="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Csp("value")
	fmt.Println(node)
}
Output:

csp="value"

func Data

func Data(key string, value string) Node

Data used to store custom data private to the page or application.

func ExampleData() {
	node := nodx.Data("key", "value")
	fmt.Println(node)
	// Output: data-key="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Data("key", "value")
	fmt.Println(node)
}
Output:

data-key="value"

func DataAttr

func DataAttr(value string) Node

DataAttr specifies the URL of the resource to be used by the object.

func ExampleDataAttr() {
	node := nodx.DataAttr("value")
	fmt.Println(node)
	// Output: data="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.DataAttr("value")
	fmt.Println(node)
}
Output:

data="value"

func DataEl

func DataEl(children ...Node) Node

DataEl links the given content with a machine-readable translation.

func ExampleDataEl() {
	node := nodx.DataEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <data id="1">Hello World!</data>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.DataEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<data id="1">Hello World!</data>

func Datalist

func Datalist(children ...Node) Node

Datalist specifies a list of pre-defined options for input controls.

func ExampleDatalist() {
	node := nodx.Datalist(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <datalist id="1">Hello World!</datalist>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Datalist(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<datalist id="1">Hello World!</datalist>

func Datetime

func Datetime(value string) Node

Datetime specifies the date and time.

func ExampleDatetime() {
	node := nodx.Datetime("value")
	fmt.Println(node)
	// Output: datetime="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Datetime("value")
	fmt.Println(node)
}
Output:

datetime="value"

func Dd

func Dd(children ...Node) Node

Dd defines a description/value of a term in a description list.

func ExampleDd() {
	node := nodx.Dd(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <dd id="1">Hello World!</dd>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Dd(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<dd id="1">Hello World!</dd>

func Decoding

func Decoding(value string) Node

Decoding indicates how the browser should load the image.

func ExampleDecoding() {
	node := nodx.Decoding("value")
	fmt.Println(node)
	// Output: decoding="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Decoding("value")
	fmt.Println(node)
}
Output:

decoding="value"

func Default

func Default(value string) Node

Default specifies the default track kind.

func ExampleDefault() {
	node := nodx.Default("value")
	fmt.Println(node)
	// Output: default="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Default("value")
	fmt.Println(node)
}
Output:

default="value"

func Defer

func Defer(value string) Node

Defer specifies that the script is executed when the page has finished parsing.

func ExampleDefer() {
	node := nodx.Defer("value")
	fmt.Println(node)
	// Output: defer="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Defer("value")
	fmt.Println(node)
}
Output:

defer="value"

func Del

func Del(children ...Node) Node

Del defines text that has been deleted from a document.

func ExampleDel() {
	node := nodx.Del(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <del id="1">Hello World!</del>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Del(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<del id="1">Hello World!</del>

func Details

func Details(children ...Node) Node

Details defines additional details that the user can view or hide.

func ExampleDetails() {
	node := nodx.Details(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <details id="1">Hello World!</details>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Details(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<details id="1">Hello World!</details>

func Dfn

func Dfn(children ...Node) Node

Dfn represents the defining instance of a term.

func ExampleDfn() {
	node := nodx.Dfn(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <dfn id="1">Hello World!</dfn>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Dfn(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<dfn id="1">Hello World!</dfn>

func Dialog

func Dialog(children ...Node) Node

Dialog defines a dialog box or window.

func ExampleDialog() {
	node := nodx.Dialog(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <dialog id="1">Hello World!</dialog>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Dialog(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<dialog id="1">Hello World!</dialog>

func DirAttr

func DirAttr(value string) Node

DirAttr specifies the text direction for the content.

func ExampleDirAttr() {
	node := nodx.DirAttr("value")
	fmt.Println(node)
	// Output: dir="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.DirAttr("value")
	fmt.Println(node)
}
Output:

dir="value"

func DirEl

func DirEl(children ...Node) Node

DirEl defines a directory list (deprecated).

func ExampleDirEl() {
	node := nodx.DirEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <dir id="1">Hello World!</dir>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.DirEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<dir id="1">Hello World!</dir>

func Dirname

func Dirname(value string) Node

Dirname enables the submission of the text directionality of an input field.

func ExampleDirname() {
	node := nodx.Dirname("value")
	fmt.Println(node)
	// Output: dirname="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Dirname("value")
	fmt.Println(node)
}
Output:

dirname="value"

func Disabled

func Disabled(value string) Node

Disabled specifies that an element should be disabled.

func ExampleDisabled() {
	node := nodx.Disabled("value")
	fmt.Println(node)
	// Output: disabled="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Disabled("value")
	fmt.Println(node)
}
Output:

disabled="value"

func Div

func Div(children ...Node) Node

Div defines a section or a division in a document.

func ExampleDiv() {
	node := nodx.Div(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <div id="1">Hello World!</div>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Div(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<div id="1">Hello World!</div>

func Dl

func Dl(children ...Node) Node

Dl defines a description list.

func ExampleDl() {
	node := nodx.Dl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <dl id="1">Hello World!</dl>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Dl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<dl id="1">Hello World!</dl>

func DocType

func DocType() Node

DocType Defines the document type.

This is a special element and should be used inside a nodx.Group.

Output: <!DOCTYPE html>

func Download

func Download(value string) Node

Download specifies that the target will be downloaded when a user clicks on the hyperlink.

func ExampleDownload() {
	node := nodx.Download("value")
	fmt.Println(node)
	// Output: download="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Download("value")
	fmt.Println(node)
}
Output:

download="value"

func Draggable

func Draggable(value string) Node

Draggable specifies whether an element is draggable or not.

func ExampleDraggable() {
	node := nodx.Draggable("value")
	fmt.Println(node)
	// Output: draggable="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Draggable("value")
	fmt.Println(node)
}
Output:

draggable="value"

func Dt

func Dt(children ...Node) Node

Dt defines a term/name in a description list.

func ExampleDt() {
	node := nodx.Dt(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <dt id="1">Hello World!</dt>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Dt(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<dt id="1">Hello World!</dt>

func El

func El(name string, children ...Node) Node

El creates a new Node representing an HTML element with the given name.

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.El("my-custom-element",
		nodx.Text("Hello, World!"),
	)

	fmt.Println(node)
}
Output:

<my-custom-element>Hello, World!</my-custom-element>

func ElVoid

func ElVoid(name string, children ...Node) Node

ElVoid creates a new Node representing an HTML void element with the given name. Void elements are self-closing, such as <img> or <input>.

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.ElVoid("my-custom-element",
		nodx.Class("container"),
	)

	fmt.Println(node)
}
Output:

<my-custom-element class="container">

func Em

func Em(children ...Node) Node

Em defines emphasized text.

func ExampleEm() {
	node := nodx.Em(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <em id="1">Hello World!</em>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Em(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<em id="1">Hello World!</em>

func Embed

func Embed(children ...Node) Node

Embed defines a container for an external application or interactive content.

func ExampleEmbed() {
	node := nodx.Embed(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <embed id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Embed(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<embed id="1">

func Enctype

func Enctype(value string) Node

Enctype specifies how the form-data should be encoded when submitting it to the server.

func ExampleEnctype() {
	node := nodx.Enctype("value")
	fmt.Println(node)
	// Output: enctype="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Enctype("value")
	fmt.Println(node)
}
Output:

enctype="value"

func Enterkeyhint

func Enterkeyhint(value string) Node

Enterkeyhint specifies what action label to present for the enter key on virtual keyboards.

func ExampleEnterkeyhint() {
	node := nodx.Enterkeyhint("value")
	fmt.Println(node)
	// Output: enterkeyhint="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Enterkeyhint("value")
	fmt.Println(node)
}
Output:

enterkeyhint="value"

func Eval added in v0.2.0

func Eval(fn func() Node) Node

Eval executes a provided function and integrates its resulting Node into the current node tree.

Use Eval to insert dynamic content, apply complex logic, or generate nodes on the fly.

Example:

node := nodx.Group(
	nodx.Div(
	  nodx.Class("container"),
	  nodx.Eval(func() nodx.Node {
	    if condition {
	      return nodx.Text("Condition is true")
	    }
	    return nodx.Text("Condition is false")
	  }),
	),
)
Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	condition := 3 > 2

	node := nodx.Div(
		nodx.Class("container"),
		nodx.Eval(func() nodx.Node {
			// You can add your own go code here
			if condition {
				return nodx.Text("Condition is true")
			}
			return nodx.Text("Condition is false")
		}),
	)

	fmt.Println(node)
}
Output:

<div class="container">Condition is true</div>

func Fieldset

func Fieldset(children ...Node) Node

Fieldset groups related elements in a form.

func ExampleFieldset() {
	node := nodx.Fieldset(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <fieldset id="1">Hello World!</fieldset>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Fieldset(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<fieldset id="1">Hello World!</fieldset>

func Figcaption

func Figcaption(children ...Node) Node

Figcaption defines a caption for a figure element.

func ExampleFigcaption() {
	node := nodx.Figcaption(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <figcaption id="1">Hello World!</figcaption>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Figcaption(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<figcaption id="1">Hello World!</figcaption>

func Figure

func Figure(children ...Node) Node

Figure specifies self-contained content.

func ExampleFigure() {
	node := nodx.Figure(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <figure id="1">Hello World!</figure>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Figure(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<figure id="1">Hello World!</figure>

func Font

func Font(children ...Node) Node

Font defines font, color, and size for text (deprecated).

func ExampleFont() {
	node := nodx.Font(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <font id="1">Hello World!</font>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Font(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<font id="1">Hello World!</font>
func Footer(children ...Node) Node

Footer defines a footer for a document or section.

func ExampleFooter() {
	node := nodx.Footer(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <footer id="1">Hello World!</footer>
}

func For

func For(value string) Node

For specifies which form element a label or output element is bound to.

func ExampleFor() {
	node := nodx.For("value")
	fmt.Println(node)
	// Output: for="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.For("value")
	fmt.Println(node)
}
Output:

for="value"

func FormAttr

func FormAttr(value string) Node

FormAttr specifies the form the element belongs to.

func ExampleFormAttr() {
	node := nodx.FormAttr("value")
	fmt.Println(node)
	// Output: form="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.FormAttr("value")
	fmt.Println(node)
}
Output:

form="value"

func FormEl

func FormEl(children ...Node) Node

FormEl defines an HTML form for user input.

func ExampleFormEl() {
	node := nodx.FormEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <form id="1">Hello World!</form>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.FormEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<form id="1">Hello World!</form>

func Formaction

func Formaction(value string) Node

Formaction specifies where to send the form-data when a form is submitted (for input and button elements).

func ExampleFormaction() {
	node := nodx.Formaction("value")
	fmt.Println(node)
	// Output: formaction="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Formaction("value")
	fmt.Println(node)
}
Output:

formaction="value"

func Formenctype

func Formenctype(value string) Node

Formenctype specifies how form-data should be encoded (for input and button elements).

func ExampleFormenctype() {
	node := nodx.Formenctype("value")
	fmt.Println(node)
	// Output: formenctype="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Formenctype("value")
	fmt.Println(node)
}
Output:

formenctype="value"

func Formmethod

func Formmethod(value string) Node

Formmethod defines the HTTP method for sending form-data (for input and button elements).

func ExampleFormmethod() {
	node := nodx.Formmethod("value")
	fmt.Println(node)
	// Output: formmethod="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Formmethod("value")
	fmt.Println(node)
}
Output:

formmethod="value"

func Formnovalidate

func Formnovalidate(value string) Node

Formnovalidate defines that form elements should not be validated when submitted.

func ExampleFormnovalidate() {
	node := nodx.Formnovalidate("value")
	fmt.Println(node)
	// Output: formnovalidate="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Formnovalidate("value")
	fmt.Println(node)
}
Output:

formnovalidate="value"

func Formtarget

func Formtarget(value string) Node

Formtarget specifies where to display the response after submitting the form.

func ExampleFormtarget() {
	node := nodx.Formtarget("value")
	fmt.Println(node)
	// Output: formtarget="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Formtarget("value")
	fmt.Println(node)
}
Output:

formtarget="value"

func Frame

func Frame(children ...Node) Node

Frame defines a window (a frame) in a frameset (deprecated).

func ExampleFrame() {
	node := nodx.Frame(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <frame id="1">Hello World!</frame>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Frame(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<frame id="1">Hello World!</frame>

func Frameset

func Frameset(children ...Node) Node

Frameset defines a set of frames (deprecated).

func ExampleFrameset() {
	node := nodx.Frameset(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <frameset id="1">Hello World!</frameset>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Frameset(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<frameset id="1">Hello World!</frameset>

func Group

func Group(nodes ...Node) Node

Group combines multiple nodes into a single node without wrapping them in any HTML tag.

When rendered directly, it will call Render on all the nodes in the group sequentially.

When used as a child of another node, it will be expanded so that the nodes in the group become children of the group's parent.

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Group(
		nodx.DocType(),
		nodx.Html(
			nodx.Head(
				nodx.TitleEl(nodx.Text("Hello, World!")),
			),
			nodx.Body(nodx.Text("Hello, World!")),
		),
	)

	fmt.Println(node)
}
Output:

<!DOCTYPE html><html><head><title>Hello, World!</title></head><body>Hello, World!</body></html>

func H1

func H1(children ...Node) Node

H1 defines HTML headings level 1.

func ExampleH1() {
	node := nodx.H1(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <h1 id="1">Hello World!</h1>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.H1(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<h1 id="1">Hello World!</h1>

func H2

func H2(children ...Node) Node

H2 defines HTML headings level 2.

func ExampleH2() {
	node := nodx.H2(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <h2 id="1">Hello World!</h2>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.H2(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<h2 id="1">Hello World!</h2>

func H3

func H3(children ...Node) Node

H3 defines HTML headings level 3.

func ExampleH3() {
	node := nodx.H3(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <h3 id="1">Hello World!</h3>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.H3(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<h3 id="1">Hello World!</h3>

func H4

func H4(children ...Node) Node

H4 defines HTML headings level 4.

func ExampleH4() {
	node := nodx.H4(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <h4 id="1">Hello World!</h4>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.H4(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<h4 id="1">Hello World!</h4>

func H5

func H5(children ...Node) Node

H5 defines HTML headings level 5.

func ExampleH5() {
	node := nodx.H5(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <h5 id="1">Hello World!</h5>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.H5(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<h5 id="1">Hello World!</h5>

func H6

func H6(children ...Node) Node

H6 defines HTML headings level 6.

func ExampleH6() {
	node := nodx.H6(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <h6 id="1">Hello World!</h6>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.H6(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<h6 id="1">Hello World!</h6>
func Head(children ...Node) Node

Head contains metadata/information for the document.

func ExampleHead() {
	node := nodx.Head(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <head id="1">Hello World!</head>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Head(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<head id="1">Hello World!</head>
func Header(children ...Node) Node

Header defines a header for a document or section.

func ExampleHeader() {
	node := nodx.Header(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <header id="1">Hello World!</header>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Header(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<header id="1">Hello World!</header>

func Headers

func Headers(value string) Node

Headers specifies one or more header cells a cell is related to.

func ExampleHeaders() {
	node := nodx.Headers("value")
	fmt.Println(node)
	// Output: headers="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Headers("value")
	fmt.Println(node)
}
Output:

headers="value"

func Height

func Height(value string) Node

Height specifies the height of the element.

func ExampleHeight() {
	node := nodx.Height("value")
	fmt.Println(node)
	// Output: height="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Height("value")
	fmt.Println(node)
}
Output:

height="value"

func Hidden

func Hidden(value string) Node

Hidden specifies that an element is not yet, or is no longer, relevant.

func ExampleHidden() {
	node := nodx.Hidden("value")
	fmt.Println(node)
	// Output: hidden="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Hidden("value")
	fmt.Println(node)
}
Output:

hidden="value"

func High

func High(value string) Node

High specifies the range that is considered to be a high value.

func ExampleHigh() {
	node := nodx.High("value")
	fmt.Println(node)
	// Output: high="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.High("value")
	fmt.Println(node)
}
Output:

high="value"

func Hr

func Hr(children ...Node) Node

Hr defines a thematic change in the content.

func ExampleHr() {
	node := nodx.Hr(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <hr id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Hr(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<hr id="1">

func Href

func Href(value string) Node

Href specifies the URL of the page the link goes to.

func ExampleHref() {
	node := nodx.Href("value")
	fmt.Println(node)
	// Output: href="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Href("value")
	fmt.Println(node)
}
Output:

href="value"

func Hreflang

func Hreflang(value string) Node

Hreflang specifies the language of the linked document.

func ExampleHreflang() {
	node := nodx.Hreflang("value")
	fmt.Println(node)
	// Output: hreflang="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Hreflang("value")
	fmt.Println(node)
}
Output:

hreflang="value"

func Html

func Html(children ...Node) Node

Html defines the root of an HTML document.

func ExampleHtml() {
	node := nodx.Html(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <html id="1">Hello World!</html>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Html(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<html id="1">Hello World!</html>

func HttpEquiv

func HttpEquiv(value string) Node

HttpEquiv provides an HTTP header for the information/value of the content attribute.

func ExampleHttpEquiv() {
	node := nodx.HttpEquiv("value")
	fmt.Println(node)
	// Output: http-equiv="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.HttpEquiv("value")
	fmt.Println(node)
}
Output:

http-equiv="value"

func I

func I(children ...Node) Node

I defines a part of text in an alternate voice or mood.

func ExampleI() {
	node := nodx.I(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <i id="1">Hello World!</i>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.I(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<i id="1">Hello World!</i>

func Icon

func Icon(value string) Node

Icon specifies an icon for the command.

func ExampleIcon() {
	node := nodx.Icon("value")
	fmt.Println(node)
	// Output: icon="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Icon("value")
	fmt.Println(node)
}
Output:

icon="value"

func Id

func Id(value string) Node

Id specifies a unique id for an element.

func ExampleId() {
	node := nodx.Id("value")
	fmt.Println(node)
	// Output: id="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Id("value")
	fmt.Println(node)
}
Output:

id="value"

func If

func If(condition bool, node Node) Node

If renders a Node based on the provided boolean condition. If the condition is true, the node is rendered; otherwise, it renders nothing.

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	condition := 3 > 2

	node := nodx.Div(
		nodx.Class("container"),
		nodx.If(condition, nodx.Text("Condition is true")),
	)

	fmt.Println(node)
}
Output:

<div class="container">Condition is true</div>

func IfFunc

func IfFunc(condition bool, function func() Node) Node

IfFunc executes and renders the result of a function based on the provided boolean condition. If the condition is true, the function is executed and rendered; otherwise, nothing is executed nor rendered.

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	condition := 3 > 2

	node := nodx.Div(
		nodx.Class("container"),
		nodx.IfFunc(condition, func() nodx.Node {
			// You can add your own go code here
			return nodx.Text("Condition is true")
		}),
	)

	fmt.Println(node)
}
Output:

<div class="container">Condition is true</div>

func Iframe

func Iframe(children ...Node) Node

Iframe defines an inline frame.

func ExampleIframe() {
	node := nodx.Iframe(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <iframe id="1">Hello World!</iframe>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Iframe(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<iframe id="1">Hello World!</iframe>

func Img

func Img(children ...Node) Node

Img defines an image.

func ExampleImg() {
	node := nodx.Img(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <img id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Img(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<img id="1">

func Importance

func Importance(value string) Node

Importance indicates the relative fetch priority for the resource.

func ExampleImportance() {
	node := nodx.Importance("value")
	fmt.Println(node)
	// Output: importance="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Importance("value")
	fmt.Println(node)
}
Output:

importance="value"

func Input

func Input(children ...Node) Node

Input defines an input control.

func ExampleInput() {
	node := nodx.Input(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <input id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Input(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<input id="1">

func Ins

func Ins(children ...Node) Node

Ins defines a text that has been inserted into a document.

func ExampleIns() {
	node := nodx.Ins(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <ins id="1">Hello World!</ins>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Ins(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<ins id="1">Hello World!</ins>

func Integrity

func Integrity(value string) Node

Integrity allows a browser to verify the fetched resource's integrity.

func ExampleIntegrity() {
	node := nodx.Integrity("value")
	fmt.Println(node)
	// Output: integrity="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Integrity("value")
	fmt.Println(node)
}
Output:

integrity="value"

func Ismap

func Ismap(value string) Node

Ismap specifies an image as a server-side image-map.

func ExampleIsmap() {
	node := nodx.Ismap("value")
	fmt.Println(node)
	// Output: ismap="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Ismap("value")
	fmt.Println(node)
}
Output:

ismap="value"

func Itemprop

func Itemprop(value string) Node

Itemprop defines a property of an item.

func ExampleItemprop() {
	node := nodx.Itemprop("value")
	fmt.Println(node)
	// Output: itemprop="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Itemprop("value")
	fmt.Println(node)
}
Output:

itemprop="value"

func Kbd

func Kbd(children ...Node) Node

Kbd defines keyboard input.

func ExampleKbd() {
	node := nodx.Kbd(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <kbd id="1">Hello World!</kbd>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Kbd(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<kbd id="1">Hello World!</kbd>

func Keytype

func Keytype(value string) Node

Keytype specifies the security algorithm of a key.

func ExampleKeytype() {
	node := nodx.Keytype("value")
	fmt.Println(node)
	// Output: keytype="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Keytype("value")
	fmt.Println(node)
}
Output:

keytype="value"

func Kind

func Kind(value string) Node

Kind specifies the kind of text track.

func ExampleKind() {
	node := nodx.Kind("value")
	fmt.Println(node)
	// Output: kind="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Kind("value")
	fmt.Println(node)
}
Output:

kind="value"

func LabelAttr

func LabelAttr(value string) Node

LabelAttr specifies the title of the text track.

func ExampleLabelAttr() {
	node := nodx.LabelAttr("value")
	fmt.Println(node)
	// Output: label="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.LabelAttr("value")
	fmt.Println(node)
}
Output:

label="value"

func LabelEl

func LabelEl(children ...Node) Node

LabelEl defines a label for an input element.

func ExampleLabelEl() {
	node := nodx.LabelEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <label id="1">Hello World!</label>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.LabelEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<label id="1">Hello World!</label>

func Lang

func Lang(value string) Node

Lang specifies the language of the element's content.

func ExampleLang() {
	node := nodx.Lang("value")
	fmt.Println(node)
	// Output: lang="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Lang("value")
	fmt.Println(node)
}
Output:

lang="value"

func Language

func Language(value string) Node

Language deprecated. Specifies the scripting language used for the script.

func ExampleLanguage() {
	node := nodx.Language("value")
	fmt.Println(node)
	// Output: language="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Language("value")
	fmt.Println(node)
}
Output:

language="value"

func Legend

func Legend(children ...Node) Node

Legend defines a caption for a fieldset element.

func ExampleLegend() {
	node := nodx.Legend(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <legend id="1">Hello World!</legend>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Legend(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<legend id="1">Hello World!</legend>

func Li

func Li(children ...Node) Node

Li defines a list item.

func ExampleLi() {
	node := nodx.Li(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <li id="1">Hello World!</li>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Li(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<li id="1">Hello World!</li>
func Link(children ...Node) Node

Link defines the relationship between a document and an external resource.

func ExampleLink() {
	node := nodx.Link(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <link id="1">
}

func List

func List(value string) Node

List refers to a datalist element that contains pre-defined options.

func ExampleList() {
	node := nodx.List("value")
	fmt.Println(node)
	// Output: list="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.List("value")
	fmt.Println(node)
}
Output:

list="value"

func Loading

func Loading(value string) Node

Loading indicates how the browser should load the image or iframe.

func ExampleLoading() {
	node := nodx.Loading("value")
	fmt.Println(node)
	// Output: loading="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Loading("value")
	fmt.Println(node)
}
Output:

loading="value"

func Loop

func Loop(value string) Node

Loop specifies that the audio/video will start over again, every time it is finished.

func ExampleLoop() {
	node := nodx.Loop("value")
	fmt.Println(node)
	// Output: loop="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Loop("value")
	fmt.Println(node)
}
Output:

loop="value"

func Low

func Low(value string) Node

Low specifies the range that is considered to be a low value.

func ExampleLow() {
	node := nodx.Low("value")
	fmt.Println(node)
	// Output: low="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Low("value")
	fmt.Println(node)
}
Output:

low="value"

func Main

func Main(children ...Node) Node

Main specifies the main content of a document.

func ExampleMain() {
	node := nodx.Main(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <main id="1">Hello World!</main>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Main(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<main id="1">Hello World!</main>

func Manifest

func Manifest(value string) Node

Manifest specifies the URL of the document's cache manifest.

func ExampleManifest() {
	node := nodx.Manifest("value")
	fmt.Println(node)
	// Output: manifest="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Manifest("value")
	fmt.Println(node)
}
Output:

manifest="value"

func Map

func Map[T any](slice []T, function func(T) Node) Node

Map transforms a slice of any type into a group of nodes by applying a function to each element. Returns a single Node that contains all the resulting nodes.

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	items := []string{"Item 1", "Item 2", "Item 3"}

	node := nodx.Ul(
		nodx.Map(items, func(item string) nodx.Node {
			return nodx.Li(nodx.Text(item))
		}),
	)

	fmt.Println(node)
}
Output:

<ul><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul>

func MapEl

func MapEl(children ...Node) Node

MapEl defines an image-map.

func ExampleMapEl() {
	node := nodx.MapEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <map id="1">Hello World!</map>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.MapEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<map id="1">Hello World!</map>

func Mark

func Mark(children ...Node) Node

Mark defines marked or highlighted text.

func ExampleMark() {
	node := nodx.Mark(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <mark id="1">Hello World!</mark>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Mark(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<mark id="1">Hello World!</mark>

func Max

func Max(value string) Node

Max specifies the maximum value.

func ExampleMax() {
	node := nodx.Max("value")
	fmt.Println(node)
	// Output: max="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Max("value")
	fmt.Println(node)
}
Output:

max="value"

func Maxlength

func Maxlength(value string) Node

Maxlength specifies the maximum number of characters allowed in an input field.

func ExampleMaxlength() {
	node := nodx.Maxlength("value")
	fmt.Println(node)
	// Output: maxlength="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Maxlength("value")
	fmt.Println(node)
}
Output:

maxlength="value"

func Media

func Media(value string) Node

Media specifies what media/device the linked document is optimized for.

func ExampleMedia() {
	node := nodx.Media("value")
	fmt.Println(node)
	// Output: media="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Media("value")
	fmt.Println(node)
}
Output:

media="value"

func Meta

func Meta(children ...Node) Node

Meta defines metadata about an HTML document.

func ExampleMeta() {
	node := nodx.Meta(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <meta id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Meta(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<meta id="1">

func Meter

func Meter(children ...Node) Node

Meter defines a scalar measurement within a known range.

func ExampleMeter() {
	node := nodx.Meter(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <meter id="1">Hello World!</meter>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Meter(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<meter id="1">Hello World!</meter>

func Method

func Method(value string) Node

Method specifies the HTTP method to use when sending form-data.

func ExampleMethod() {
	node := nodx.Method("value")
	fmt.Println(node)
	// Output: method="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Method("value")
	fmt.Println(node)
}
Output:

method="value"

func Min

func Min(value string) Node

Min specifies the minimum value.

func ExampleMin() {
	node := nodx.Min("value")
	fmt.Println(node)
	// Output: min="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Min("value")
	fmt.Println(node)
}
Output:

min="value"

func Minlength

func Minlength(value string) Node

Minlength specifies the minimum number of characters required in an input field.

func ExampleMinlength() {
	node := nodx.Minlength("value")
	fmt.Println(node)
	// Output: minlength="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Minlength("value")
	fmt.Println(node)
}
Output:

minlength="value"

func Multiple

func Multiple(value string) Node

Multiple specifies that a user can enter more than one value.

func ExampleMultiple() {
	node := nodx.Multiple("value")
	fmt.Println(node)
	// Output: multiple="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Multiple("value")
	fmt.Println(node)
}
Output:

multiple="value"

func Muted

func Muted(value string) Node

Muted specifies that the audio output should be muted.

func ExampleMuted() {
	node := nodx.Muted("value")
	fmt.Println(node)
	// Output: muted="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Muted("value")
	fmt.Println(node)
}
Output:

muted="value"

func Name

func Name(value string) Node

Name specifies the name of the element.

func ExampleName() {
	node := nodx.Name("value")
	fmt.Println(node)
	// Output: name="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Name("value")
	fmt.Println(node)
}
Output:

name="value"
func Nav(children ...Node) Node

Nav defines navigation links.

func ExampleNav() {
	node := nodx.Nav(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <nav id="1">Hello World!</nav>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Nav(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<nav id="1">Hello World!</nav>

func Noframes

func Noframes(children ...Node) Node

Noframes defines an alternate content for users that do not support frames (deprecated).

func ExampleNoframes() {
	node := nodx.Noframes(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <noframes id="1">Hello World!</noframes>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Noframes(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<noframes id="1">Hello World!</noframes>

func Nomodule

func Nomodule(value string) Node

Nomodule indicates that the script should not be executed in browsers that support module scripts.

func ExampleNomodule() {
	node := nodx.Nomodule("value")
	fmt.Println(node)
	// Output: nomodule="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Nomodule("value")
	fmt.Println(node)
}
Output:

nomodule="value"

func Nonce

func Nonce(value string) Node

Nonce a cryptographic nonce used in Content Security Policy.

func ExampleNonce() {
	node := nodx.Nonce("value")
	fmt.Println(node)
	// Output: nonce="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Nonce("value")
	fmt.Println(node)
}
Output:

nonce="value"

func Noscript

func Noscript(children ...Node) Node

Noscript defines an alternate content for users that do not support client-side scripts.

func ExampleNoscript() {
	node := nodx.Noscript(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <noscript id="1">Hello World!</noscript>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Noscript(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<noscript id="1">Hello World!</noscript>

func Novalidate

func Novalidate(value string) Node

Novalidate specifies that the form should not be validated when submitted.

func ExampleNovalidate() {
	node := nodx.Novalidate("value")
	fmt.Println(node)
	// Output: novalidate="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Novalidate("value")
	fmt.Println(node)
}
Output:

novalidate="value"

func Object

func Object(children ...Node) Node

Object defines an embedded object.

func ExampleObject() {
	node := nodx.Object(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <object id="1">Hello World!</object>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Object(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<object id="1">Hello World!</object>

func Ol

func Ol(children ...Node) Node

Ol defines an ordered list.

func ExampleOl() {
	node := nodx.Ol(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <ol id="1">Hello World!</ol>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Ol(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<ol id="1">Hello World!</ol>

func Open

func Open(value string) Node

Open specifies that the details should be visible to the user.

func ExampleOpen() {
	node := nodx.Open("value")
	fmt.Println(node)
	// Output: open="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Open("value")
	fmt.Println(node)
}
Output:

open="value"

func Optgroup

func Optgroup(children ...Node) Node

Optgroup defines a group of related options in a drop-down list.

func ExampleOptgroup() {
	node := nodx.Optgroup(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <optgroup id="1">Hello World!</optgroup>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Optgroup(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<optgroup id="1">Hello World!</optgroup>

func Optimum

func Optimum(value string) Node

Optimum specifies the optimal value of the gauge.

func ExampleOptimum() {
	node := nodx.Optimum("value")
	fmt.Println(node)
	// Output: optimum="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Optimum("value")
	fmt.Println(node)
}
Output:

optimum="value"

func Option

func Option(children ...Node) Node

Option defines an option in a drop-down list.

func ExampleOption() {
	node := nodx.Option(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <option id="1">Hello World!</option>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Option(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<option id="1">Hello World!</option>

func Output

func Output(children ...Node) Node

Output defines the result of a calculation.

func ExampleOutput() {
	node := nodx.Output(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <output id="1">Hello World!</output>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Output(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<output id="1">Hello World!</output>

func P

func P(children ...Node) Node

P defines a paragraph.

func ExampleP() {
	node := nodx.P(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <p id="1">Hello World!</p>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.P(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<p id="1">Hello World!</p>

func Param

func Param(children ...Node) Node

Param defines a parameter for an object.

func ExampleParam() {
	node := nodx.Param(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <param id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Param(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<param id="1">

func Pattern

func Pattern(value string) Node

Pattern specifies a regular expression that the input element's value is checked against.

func ExamplePattern() {
	node := nodx.Pattern("value")
	fmt.Println(node)
	// Output: pattern="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Pattern("value")
	fmt.Println(node)
}
Output:

pattern="value"

func Picture

func Picture(children ...Node) Node

Picture defines a container for multiple image resources.

func ExamplePicture() {
	node := nodx.Picture(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <picture id="1">Hello World!</picture>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Picture(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<picture id="1">Hello World!</picture>

func Ping

func Ping(value string) Node

Ping specifies a space-separated list of URLs to be notified if a user follows the hyperlink.

func ExamplePing() {
	node := nodx.Ping("value")
	fmt.Println(node)
	// Output: ping="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Ping("value")
	fmt.Println(node)
}
Output:

ping="value"

func Placeholder

func Placeholder(value string) Node

Placeholder specifies a short hint that describes the expected value of an input field.

func ExamplePlaceholder() {
	node := nodx.Placeholder("value")
	fmt.Println(node)
	// Output: placeholder="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Placeholder("value")
	fmt.Println(node)
}
Output:

placeholder="value"

func Playsinline

func Playsinline(value string) Node

Playsinline indicates that the video should play inline on mobile devices.

func ExamplePlaysinline() {
	node := nodx.Playsinline("value")
	fmt.Println(node)
	// Output: playsinline="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Playsinline("value")
	fmt.Println(node)
}
Output:

playsinline="value"

func Poster

func Poster(value string) Node

Poster specifies an image to be shown while the video is downloading or until the user hits the play button.

func ExamplePoster() {
	node := nodx.Poster("value")
	fmt.Println(node)
	// Output: poster="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Poster("value")
	fmt.Println(node)
}
Output:

poster="value"

func Pre

func Pre(children ...Node) Node

Pre defines preformatted text.

func ExamplePre() {
	node := nodx.Pre(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <pre id="1">Hello World!</pre>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Pre(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<pre id="1">Hello World!</pre>

func Preload

func Preload(value string) Node

Preload specifies if and how the author thinks the audio/video should be loaded when the page loads.

func ExamplePreload() {
	node := nodx.Preload("value")
	fmt.Println(node)
	// Output: preload="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Preload("value")
	fmt.Println(node)
}
Output:

preload="value"

func Progress

func Progress(children ...Node) Node

Progress represents the progress of a task.

func ExampleProgress() {
	node := nodx.Progress(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <progress id="1">Hello World!</progress>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Progress(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<progress id="1">Hello World!</progress>

func Q

func Q(children ...Node) Node

Q defines a short quotation.

func ExampleQ() {
	node := nodx.Q(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <q id="1">Hello World!</q>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Q(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<q id="1">Hello World!</q>

func Raw

func Raw(value string) Node

Raw creates a new Node representing a raw HTML text node. The value is not escaped, so the caller must ensure the content is safe. Useful for rendering raw HTML, like <script> or <style> tags.

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Div(
		nodx.Raw("<script>alert('Hello, World!')</script>"),
	)

	fmt.Println(node)
}
Output:

<div><script>alert('Hello, World!')</script></div>

func Rawf

func Rawf(format string, a ...any) Node

Rawf creates a new Node representing a raw HTML text node. The value is formatted with fmt.Sprintf and not escaped, so ensure its safety. Useful for rendering raw HTML, like <script> or <style> tags.

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Div(
		nodx.Rawf("<script>alert('Hello, %s!')</script>", "World"),
	)

	fmt.Println(node)
}
Output:

<div><script>alert('Hello, World!')</script></div>

func Rb

func Rb(children ...Node) Node

Rb used to delimit the base text component of a ruby annotation.

func ExampleRb() {
	node := nodx.Rb(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <rb id="1">Hello World!</rb>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Rb(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<rb id="1">Hello World!</rb>

func Readonly

func Readonly(value string) Node

Readonly specifies that the input field is read-only.

func ExampleReadonly() {
	node := nodx.Readonly("value")
	fmt.Println(node)
	// Output: readonly="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Readonly("value")
	fmt.Println(node)
}
Output:

readonly="value"

func Referrerpolicy

func Referrerpolicy(value string) Node

Referrerpolicy specifies which referrer information to send when fetching a resource.

func ExampleReferrerpolicy() {
	node := nodx.Referrerpolicy("value")
	fmt.Println(node)
	// Output: referrerpolicy="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Referrerpolicy("value")
	fmt.Println(node)
}
Output:

referrerpolicy="value"

func Rel

func Rel(value string) Node

Rel specifies the relationship between the current document and the linked document.

func ExampleRel() {
	node := nodx.Rel("value")
	fmt.Println(node)
	// Output: rel="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Rel("value")
	fmt.Println(node)
}
Output:

rel="value"

func Required

func Required(value string) Node

Required specifies that the input field must be filled out before submitting the form.

func ExampleRequired() {
	node := nodx.Required("value")
	fmt.Println(node)
	// Output: required="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Required("value")
	fmt.Println(node)
}
Output:

required="value"

func Reversed

func Reversed(value string) Node

Reversed specifies that the list order should be descending (9,8,7...).

func ExampleReversed() {
	node := nodx.Reversed("value")
	fmt.Println(node)
	// Output: reversed="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Reversed("value")
	fmt.Println(node)
}
Output:

reversed="value"

func Role

func Role(value string) Node

Role defines the role of an element for accessibility purposes.

func ExampleRole() {
	node := nodx.Role("value")
	fmt.Println(node)
	// Output: role="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Role("value")
	fmt.Println(node)
}
Output:

role="value"

func Rows

func Rows(value string) Node

Rows specifies the visible number of lines in a text area.

func ExampleRows() {
	node := nodx.Rows("value")
	fmt.Println(node)
	// Output: rows="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Rows("value")
	fmt.Println(node)
}
Output:

rows="value"

func Rowspan

func Rowspan(value string) Node

Rowspan specifies the number of rows a cell should span.

func ExampleRowspan() {
	node := nodx.Rowspan("value")
	fmt.Println(node)
	// Output: rowspan="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Rowspan("value")
	fmt.Println(node)
}
Output:

rowspan="value"

func Rp

func Rp(children ...Node) Node

Rp defines what to show in browsers that do not support ruby annotations.

func ExampleRp() {
	node := nodx.Rp(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <rp id="1">Hello World!</rp>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Rp(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<rp id="1">Hello World!</rp>

func Rt

func Rt(children ...Node) Node

Rt defines an explanation/pronunciation of characters (for East Asian typography).

func ExampleRt() {
	node := nodx.Rt(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <rt id="1">Hello World!</rt>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Rt(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<rt id="1">Hello World!</rt>

func Rtc

func Rtc(children ...Node) Node

Rtc defines a ruby text container for multiple rt elements.

func ExampleRtc() {
	node := nodx.Rtc(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <rtc id="1">Hello World!</rtc>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Rtc(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<rtc id="1">Hello World!</rtc>

func Ruby

func Ruby(children ...Node) Node

Ruby defines a ruby annotation.

func ExampleRuby() {
	node := nodx.Ruby(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <ruby id="1">Hello World!</ruby>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Ruby(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<ruby id="1">Hello World!</ruby>

func S

func S(children ...Node) Node

S defines text that is no longer correct.

func ExampleS() {
	node := nodx.S(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <s id="1">Hello World!</s>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.S(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<s id="1">Hello World!</s>

func Samp

func Samp(children ...Node) Node

Samp defines sample output from a computer program.

func ExampleSamp() {
	node := nodx.Samp(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <samp id="1">Hello World!</samp>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Samp(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<samp id="1">Hello World!</samp>

func Sandbox

func Sandbox(value string) Node

Sandbox enables an extra set of restrictions for the content in an iframe.

func ExampleSandbox() {
	node := nodx.Sandbox("value")
	fmt.Println(node)
	// Output: sandbox="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Sandbox("value")
	fmt.Println(node)
}
Output:

sandbox="value"

func Scope

func Scope(value string) Node

Scope specifies whether a header cell is a header for a column, row, or group of columns or rows.

func ExampleScope() {
	node := nodx.Scope("value")
	fmt.Println(node)
	// Output: scope="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Scope("value")
	fmt.Println(node)
}
Output:

scope="value"

func Scoped

func Scoped(value string) Node

Scoped specifies that the styles only apply to this element's parent and child elements.

func ExampleScoped() {
	node := nodx.Scoped("value")
	fmt.Println(node)
	// Output: scoped="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Scoped("value")
	fmt.Println(node)
}
Output:

scoped="value"

func Script

func Script(children ...Node) Node

Script defines a client-side script.

func ExampleScript() {
	node := nodx.Script(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <script id="1">Hello World!</script>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Script(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<script id="1">Hello World!</script>

func Section

func Section(children ...Node) Node

Section defines a section in a document.

func ExampleSection() {
	node := nodx.Section(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <section id="1">Hello World!</section>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Section(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<section id="1">Hello World!</section>

func Select

func Select(children ...Node) Node

Select defines a drop-down list.

func ExampleSelect() {
	node := nodx.Select(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <select id="1">Hello World!</select>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Select(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<select id="1">Hello World!</select>

func Selected

func Selected(value string) Node

Selected specifies that an option should be pre-selected when the page loads.

func ExampleSelected() {
	node := nodx.Selected("value")
	fmt.Println(node)
	// Output: selected="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Selected("value")
	fmt.Println(node)
}
Output:

selected="value"

func Shape

func Shape(value string) Node

Shape specifies the shape of an area in an image-map.

func ExampleShape() {
	node := nodx.Shape("value")
	fmt.Println(node)
	// Output: shape="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Shape("value")
	fmt.Println(node)
}
Output:

shape="value"

func Size

func Size(value string) Node

Size specifies the width, in characters, of an input field.

func ExampleSize() {
	node := nodx.Size("value")
	fmt.Println(node)
	// Output: size="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Size("value")
	fmt.Println(node)
}
Output:

size="value"

func Sizes

func Sizes(value string) Node

Sizes specifies the sizes of icons for visual media.

func ExampleSizes() {
	node := nodx.Sizes("value")
	fmt.Println(node)
	// Output: sizes="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Sizes("value")
	fmt.Println(node)
}
Output:

sizes="value"

func SlotAttr

func SlotAttr(value string) Node

SlotAttr assigns a slot in a shadow DOM shadow tree.

func ExampleSlotAttr() {
	node := nodx.SlotAttr("value")
	fmt.Println(node)
	// Output: slot="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.SlotAttr("value")
	fmt.Println(node)
}
Output:

slot="value"

func SlotEl

func SlotEl(children ...Node) Node

SlotEl defines a placeholder inside a web component.

func ExampleSlotEl() {
	node := nodx.SlotEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <slot id="1">Hello World!</slot>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.SlotEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<slot id="1">Hello World!</slot>

func Small

func Small(children ...Node) Node

Small defines smaller text.

func ExampleSmall() {
	node := nodx.Small(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <small id="1">Hello World!</small>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Small(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<small id="1">Hello World!</small>

func Source

func Source(children ...Node) Node

Source defines multiple media resources for media elements.

func ExampleSource() {
	node := nodx.Source(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <source id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Source(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<source id="1">

func SpanAttr

func SpanAttr(value string) Node

SpanAttr defines the number of columns to span for a col or colgroup element.

func ExampleSpanAttr() {
	node := nodx.SpanAttr("value")
	fmt.Println(node)
	// Output: span="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.SpanAttr("value")
	fmt.Println(node)
}
Output:

span="value"

func SpanEl

func SpanEl(children ...Node) Node

SpanEl defines a section in a document.

func ExampleSpanEl() {
	node := nodx.SpanEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <span id="1">Hello World!</span>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.SpanEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<span id="1">Hello World!</span>

func Spellcheck

func Spellcheck(value string) Node

Spellcheck specifies whether the element is to have its spelling and grammar checked or not.

func ExampleSpellcheck() {
	node := nodx.Spellcheck("value")
	fmt.Println(node)
	// Output: spellcheck="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Spellcheck("value")
	fmt.Println(node)
}
Output:

spellcheck="value"

func Src

func Src(value string) Node

Src specifies the URL of the media file.

func ExampleSrc() {
	node := nodx.Src("value")
	fmt.Println(node)
	// Output: src="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Src("value")
	fmt.Println(node)
}
Output:

src="value"

func Srcdoc

func Srcdoc(value string) Node

Srcdoc specifies the HTML content of the page to show in the iframe.

func ExampleSrcdoc() {
	node := nodx.Srcdoc("value")
	fmt.Println(node)
	// Output: srcdoc="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Srcdoc("value")
	fmt.Println(node)
}
Output:

srcdoc="value"

func Srclang

func Srclang(value string) Node

Srclang specifies the language of the track text data (required if kind='subtitles').

func ExampleSrclang() {
	node := nodx.Srclang("value")
	fmt.Println(node)
	// Output: srclang="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Srclang("value")
	fmt.Println(node)
}
Output:

srclang="value"

func Srcset

func Srcset(value string) Node

Srcset specifies the URL of the image to use in different situations.

func ExampleSrcset() {
	node := nodx.Srcset("value")
	fmt.Println(node)
	// Output: srcset="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Srcset("value")
	fmt.Println(node)
}
Output:

srcset="value"

func Start

func Start(value string) Node

Start specifies the start value of an ordered list.

func ExampleStart() {
	node := nodx.Start("value")
	fmt.Println(node)
	// Output: start="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Start("value")
	fmt.Println(node)
}
Output:

start="value"

func Step

func Step(value string) Node

Step specifies the legal number intervals for an input field.

func ExampleStep() {
	node := nodx.Step("value")
	fmt.Println(node)
	// Output: step="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Step("value")
	fmt.Println(node)
}
Output:

step="value"

func Strike

func Strike(children ...Node) Node

Strike defines strikethrough text (deprecated).

func ExampleStrike() {
	node := nodx.Strike(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <strike id="1">Hello World!</strike>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Strike(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<strike id="1">Hello World!</strike>

func Strong

func Strong(children ...Node) Node

Strong defines important text.

func ExampleStrong() {
	node := nodx.Strong(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <strong id="1">Hello World!</strong>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Strong(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<strong id="1">Hello World!</strong>

func StyleAttr

func StyleAttr(value string) Node

StyleAttr specifies an inline CSS style for an element.

func ExampleStyleAttr() {
	node := nodx.StyleAttr("value")
	fmt.Println(node)
	// Output: style="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.StyleAttr("value")
	fmt.Println(node)
}
Output:

style="value"

func StyleEl

func StyleEl(children ...Node) Node

StyleEl defines style information for a document.

func ExampleStyleEl() {
	node := nodx.StyleEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <style id="1">Hello World!</style>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.StyleEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<style id="1">Hello World!</style>

func Sub

func Sub(children ...Node) Node

Sub defines subscripted text.

func ExampleSub() {
	node := nodx.Sub(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <sub id="1">Hello World!</sub>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Sub(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<sub id="1">Hello World!</sub>

func SummaryAttr

func SummaryAttr(value string) Node

SummaryAttr specifies a summary of the content of a table (deprecated in HTML5).

func ExampleSummaryAttr() {
	node := nodx.SummaryAttr("value")
	fmt.Println(node)
	// Output: summary="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.SummaryAttr("value")
	fmt.Println(node)
}
Output:

summary="value"

func SummaryEl

func SummaryEl(children ...Node) Node

SummaryEl defines a visible heading for a details element.

func ExampleSummaryEl() {
	node := nodx.SummaryEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <summary id="1">Hello World!</summary>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.SummaryEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<summary id="1">Hello World!</summary>

func Sup

func Sup(children ...Node) Node

Sup defines superscripted text.

func ExampleSup() {
	node := nodx.Sup(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <sup id="1">Hello World!</sup>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Sup(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<sup id="1">Hello World!</sup>

func Svg

func Svg(children ...Node) Node

Svg defines a container for SVG graphics.

func ExampleSvg() {
	node := nodx.Svg(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <svg id="1">Hello World!</svg>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Svg(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<svg id="1">Hello World!</svg>

func Tabindex

func Tabindex(value string) Node

Tabindex specifies the tabbing order of an element.

func ExampleTabindex() {
	node := nodx.Tabindex("value")
	fmt.Println(node)
	// Output: tabindex="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Tabindex("value")
	fmt.Println(node)
}
Output:

tabindex="value"

func Table

func Table(children ...Node) Node

Table defines a table.

func ExampleTable() {
	node := nodx.Table(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <table id="1">Hello World!</table>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Table(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<table id="1">Hello World!</table>

func Target

func Target(value string) Node

Target specifies where to open the linked document.

func ExampleTarget() {
	node := nodx.Target("value")
	fmt.Println(node)
	// Output: target="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Target("value")
	fmt.Println(node)
}
Output:

target="value"

func Tbody

func Tbody(children ...Node) Node

Tbody groups the body content in a table.

func ExampleTbody() {
	node := nodx.Tbody(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <tbody id="1">Hello World!</tbody>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Tbody(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<tbody id="1">Hello World!</tbody>

func Td

func Td(children ...Node) Node

Td defines a cell in a table.

func ExampleTd() {
	node := nodx.Td(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <td id="1">Hello World!</td>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Td(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<td id="1">Hello World!</td>

func Template

func Template(children ...Node) Node

Template defines a template.

func ExampleTemplate() {
	node := nodx.Template(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <template id="1">Hello World!</template>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Template(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<template id="1">Hello World!</template>

func Text

func Text(value string) Node

Text creates a new Node representing an escaped HTML text node. The value is HTML-escaped to prevent XSS attacks.

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Div(
		nodx.Text("<script>alert('Hello, World!')</script>"),
	)

	fmt.Println(node)
}
Output:

<div>&lt;script&gt;alert(&#39;Hello, World!&#39;)&lt;/script&gt;</div>

func Textarea

func Textarea(children ...Node) Node

Textarea defines a multiline input control.

func ExampleTextarea() {
	node := nodx.Textarea(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <textarea id="1">Hello World!</textarea>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Textarea(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<textarea id="1">Hello World!</textarea>

func Textf

func Textf(format string, a ...any) Node

Textf creates a new Node representing an escaped HTML text node. The value is formatted with fmt.Sprintf and then HTML-escaped to prevent XSS attacks.

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Div(
		nodx.Textf("<script>alert('Hello, %s!')</script>", "World"),
	)

	fmt.Println(node)
}
Output:

<div>&lt;script&gt;alert(&#39;Hello, World!&#39;)&lt;/script&gt;</div>

func Tfoot

func Tfoot(children ...Node) Node

Tfoot groups the footer content in a table.

func ExampleTfoot() {
	node := nodx.Tfoot(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <tfoot id="1">Hello World!</tfoot>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Tfoot(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<tfoot id="1">Hello World!</tfoot>

func Th

func Th(children ...Node) Node

Th defines a header cell in a table.

func ExampleTh() {
	node := nodx.Th(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <th id="1">Hello World!</th>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Th(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<th id="1">Hello World!</th>

func Thead

func Thead(children ...Node) Node

Thead groups the header content in a table.

func ExampleThead() {
	node := nodx.Thead(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <thead id="1">Hello World!</thead>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Thead(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<thead id="1">Hello World!</thead>

func Time

func Time(children ...Node) Node

Time defines a specific time.

func ExampleTime() {
	node := nodx.Time(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <time id="1">Hello World!</time>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Time(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<time id="1">Hello World!</time>

func TitleAttr

func TitleAttr(value string) Node

TitleAttr specifies extra information about an element.

func ExampleTitleAttr() {
	node := nodx.TitleAttr("value")
	fmt.Println(node)
	// Output: title="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.TitleAttr("value")
	fmt.Println(node)
}
Output:

title="value"

func TitleEl

func TitleEl(children ...Node) Node

TitleEl defines a title for the document.

func ExampleTitleEl() {
	node := nodx.TitleEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <title id="1">Hello World!</title>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.TitleEl(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<title id="1">Hello World!</title>

func Tr

func Tr(children ...Node) Node

Tr defines a row in a table.

func ExampleTr() {
	node := nodx.Tr(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <tr id="1">Hello World!</tr>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Tr(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<tr id="1">Hello World!</tr>

func Track

func Track(children ...Node) Node

Track defines text tracks for media elements.

func ExampleTrack() {
	node := nodx.Track(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <track id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Track(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<track id="1">

func Translate

func Translate(value string) Node

Translate specifies whether the content of an element should be translated or not.

func ExampleTranslate() {
	node := nodx.Translate("value")
	fmt.Println(node)
	// Output: translate="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Translate("value")
	fmt.Println(node)
}
Output:

translate="value"

func Tt

func Tt(children ...Node) Node

Tt defines teletype text (deprecated).

func ExampleTt() {
	node := nodx.Tt(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <tt id="1">Hello World!</tt>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Tt(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<tt id="1">Hello World!</tt>

func Type

func Type(value string) Node

Type specifies the type of element.

func ExampleType() {
	node := nodx.Type("value")
	fmt.Println(node)
	// Output: type="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Type("value")
	fmt.Println(node)
}
Output:

type="value"

func U

func U(children ...Node) Node

U defines text that should be stylistically different from normal text.

func ExampleU() {
	node := nodx.U(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <u id="1">Hello World!</u>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.U(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<u id="1">Hello World!</u>

func Ul

func Ul(children ...Node) Node

Ul defines an unordered list.

func ExampleUl() {
	node := nodx.Ul(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <ul id="1">Hello World!</ul>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Ul(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<ul id="1">Hello World!</ul>

func Usemap

func Usemap(value string) Node

Usemap specifies an image as a client-side image-map.

func ExampleUsemap() {
	node := nodx.Usemap("value")
	fmt.Println(node)
	// Output: usemap="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Usemap("value")
	fmt.Println(node)
}
Output:

usemap="value"

func Value

func Value(value string) Node

Value specifies the value of the element.

func ExampleValue() {
	node := nodx.Value("value")
	fmt.Println(node)
	// Output: value="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Value("value")
	fmt.Println(node)
}
Output:

value="value"

func Var

func Var(children ...Node) Node

Var defines a variable.

func ExampleVar() {
	node := nodx.Var(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <var id="1">Hello World!</var>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Var(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<var id="1">Hello World!</var>

func Video

func Video(children ...Node) Node

Video defines embedded video content.

func ExampleVideo() {
	node := nodx.Video(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
	// Output: <video id="1">Hello World!</video>
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Video(
		nodx.Id("1"),
		nodx.Text("Hello World!"),
	)
	fmt.Println(node)
}
Output:

<video id="1">Hello World!</video>

func Wbr

func Wbr(children ...Node) Node

Wbr defines a possible line-break.

func ExampleWbr() {
	node := nodx.Wbr(
		nodx.Id( "1"),
	)
	fmt.Println(node)
	// Output: <wbr id="1">
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Wbr(
		nodx.Id("1"),
	)
	fmt.Println(node)
}
Output:

<wbr id="1">

func Width

func Width(value string) Node

Width specifies the width of the element.

func ExampleWidth() {
	node := nodx.Width("value")
	fmt.Println(node)
	// Output: width="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Width("value")
	fmt.Println(node)
}
Output:

width="value"

func Wrap

func Wrap(value string) Node

Wrap specifies how the text in a text area is to be wrapped when submitted in a form.

func ExampleWrap() {
	node := nodx.Wrap("value")
	fmt.Println(node)
	// Output: wrap="value"
}
Example
package main

import (
	"fmt"
	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	node := nodx.Wrap("value")
	fmt.Println(node)
}
Output:

wrap="value"

type StyleMap

type StyleMap map[string]bool

StyleMap represents a map of CSS style rules with conditional rendering. The keys are the complete CSS rules (e.g., "border: 1px solid black"), and the values are boolean conditions indicating whether each rule should be included in the final output.

Example:

sm := StyleMap{
	"border: 1px solid black": true,  // Included
	"padding: 10px":           false, // Excluded
	"margin: 5px":             true,  // Included
}

This will render the style attribute as: style="border: 1px solid black; margin: 5px"

Example
package main

import (
	"fmt"

	nodx "github.com/nodxdev/nodxgo"
)

func main() {
	shouldHide := 3 > 2

	node := nodx.Div(
		nodx.StyleMap{
			"color: red":             true,
			"border: 1px solid blue": false,
			"display: none":          shouldHide,
		},
		nodx.Text("Hello, World!"),
	)

	fmt.Println(node)
}
Output:

<div style="color: red; display: none">Hello, World!</div>

func (StyleMap) IsAttribute added in v0.2.0

func (sm StyleMap) IsAttribute() bool

func (StyleMap) IsElement added in v0.2.0

func (sm StyleMap) IsElement() bool

func (StyleMap) Render

func (sm StyleMap) Render(w io.Writer) error

func (StyleMap) RenderBytes

func (sm StyleMap) RenderBytes() ([]byte, error)

func (StyleMap) RenderString

func (sm StyleMap) RenderString() (string, error)

func (StyleMap) String added in v0.2.0

func (sm StyleMap) String() string

Directories

Path Synopsis
internal
assert
Package assert provides a set of functions to help with testing of this project.
Package assert provides a set of functions to help with testing of this project.

Jump to

Keyboard shortcuts

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