pitfall

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package pitfall owns authored pitfall identity and source semantics.

Index

Constants

View Source
const SourceDir = ".awf/docs/pitfalls"

Variables

This section is empty.

Functions

func AllocateSlug

func AllocateSlug(title string, used map[string]bool) (string, error)

AllocateSlug chooses the first free deterministic ASCII slug.

func EqualTitle

func EqualTitle(a, b string) bool

EqualTitle applies Go simple Unicode folding after Unicode whitespace collapse.

func EscapeHeading

func EscapeHeading(title string) string

func EscapeLinkLabel

func EscapeLinkLabel(title string) string

func EscapeTableCell

func EscapeTableCell(s string) string

func EscapeTitle

func EscapeTitle(title string) string

func Serialize

func Serialize(e Entry) ([]byte, error)

Serialize emits the canonical V1 source form.

Types

type Corpus

type Corpus struct {
	// contains filtered or unexported fields
}

func Load

func Load(files []SourceFile) (Corpus, error)

Load parses and validates a complete injected direct-leaf source set.

func New

func New(entries []Entry) Corpus

func (Corpus) All

func (c Corpus) All() []Entry

func (Corpus) Len

func (c Corpus) Len() int

func (Corpus) Scaffold

func (c Corpus) Scaffold(rawTitle string) (Entry, []byte, error)

Scaffold derives one canonical authored source from the current corpus.

type Entry

type Entry struct {
	Slug, SourcePath, Title string
	Domains, Tags           []string
	Related                 []int
	Body                    string
	Source                  []byte
}

func Parse

func Parse(f SourceFile) (Entry, error)

type SourceFile

type SourceFile struct {
	Path    string
	Bytes   []byte
	Regular bool
}

Jump to

Keyboard shortcuts

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