embedtag

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package embedtag reads the embed tags of a text: [[<kind>:<name>]] stands for something embedded in its place when the text is shown (a block, a View's list), and is left out of the text's excerpts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Replace

func Replace(s string, repl func(Tag) (string, bool)) string

Replace returns s with each tag replaced by what repl returns for it (ok=false - the tag stays as written).

func Strip

func Strip(s string) string

Strip - s without its tags: an excerpt shows the text, not them.

Types

type Tag

type Tag struct {
	Kind, Name string
}

Tag - one embed tag: what kind of thing it embeds and its name (a machine name or an ID).

func Parse

func Parse(s string) (Tag, bool)

Parse reads s, "<kind>:<name>" (a template's form, without the brackets) or a whole tag.

func (Tag) String

func (t Tag) String() string

String - the tag as written.

Jump to

Keyboard shortcuts

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