edit

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package edit provides document edit elements.

Elements:

  • Ins: Inserted text
  • Del: Deleted text

Attributes:

  • [Cite]: URL explaining the change
  • [Datetime]: Date and time of the change

These elements are used to mark up additions and deletions to a document, commonly used for revision tracking or change highlighting.

Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element#demarcating_edits

Package edit provides HTML edit elements (ins, del).

Example (Revision)
package main

import (
	"github.com/protolambda/chord/core"
	"github.com/protolambda/chord/html/edit"
	"github.com/protolambda/chord/html/text"
)

func main() {
	core.Dump(text.P()(edit.Del()(text.Text("old")), text.Text(" "), edit.Ins()(text.Text("new"))))
}
Output:
<p><del>old</del> <ins>new</ins></p>

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Del

func Del(attrs ...attr.Node) elem.Scope

Del creates a del element.

Example
package main

import (
	"github.com/protolambda/chord/core"
	"github.com/protolambda/chord/html/edit"
	"github.com/protolambda/chord/html/text"
)

func main() {
	core.Dump(edit.Del()(text.Text("removed")))
}
Output:
<del>removed</del>

func Ins

func Ins(attrs ...attr.Node) elem.Scope

Ins creates an ins element.

Example
package main

import (
	"github.com/protolambda/chord/core"
	"github.com/protolambda/chord/html/edit"
	"github.com/protolambda/chord/html/text"
)

func main() {
	core.Dump(edit.Ins()(text.Text("new text")))
}
Output:
<ins>new text</ins>

Types

This section is empty.

Jump to

Keyboard shortcuts

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