okf

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package okf serializes providers.KBEntry values as OKF markdown files (YAML frontmatter + body). It is the single write-side counterpart of catalog.Load: the GitHub forge and `lore kb import` both render through it, so every entry RunLore writes parses back identically.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(e providers.KBEntry, m Meta) string

Render serializes a KBEntry as OKF markdown. The body is written verbatim — callers that render untrusted (LLM-authored) bodies sanitize BEFORE calling (the GitHub forge neutralizes image markdown); a human runbook being imported must survive byte-for-byte.

func Slugify

func Slugify(s string) string

Slugify lowercases s and collapses every non-[a-z0-9] run into one dash. (Moved verbatim from internal/forge/github.)

Types

type Meta

type Meta struct {
	Timestamp     string // OKF-recommended; RFC3339 or bare date
	Status        string // lifecycle: "", active, retired, draft
	LastValidated string // date a human last confirmed the entry works
}

Meta carries the file-level frontmatter that is not part of a drafted KBEntry: the forge stamps Timestamp at render time; import preserves the source document's own timestamp/status/last_validated instead.

Jump to

Keyboard shortcuts

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