Documentation
¶
Overview ¶
Package spec reads and fingerprints respex spec files.
Index ¶
- Constants
- func CleanSpecPath(p string) (string, error)
- func EncodeFiles(files []File) []byte
- func Hash(content []byte) string
- func HashFiles(files []File) string
- func HeadingText(line string, level int) string
- func MissingSections(content []byte) []string
- func Read(path string) ([]byte, error)
- type File
Constants ¶
const Skeleton = `` /* 237-byte string literal not displayed */
Skeleton is the spec file written by `respex init` without a description.
Variables ¶
This section is empty.
Functions ¶
func CleanSpecPath ¶ added in v0.1.6
CleanSpecPath validates and normalizes a config/proposal spec path. Paths are slash-separated in configuration regardless of platform. The returned path is relative, clean, and cannot escape the project root.
func EncodeFiles ¶ added in v0.1.6
EncodeFiles serializes a bundle for storage in spec_versions.content.
func HashFiles ¶ added in v0.1.6
HashFiles fingerprints a bundle over both paths and contents, so renames and reordering are detected alongside edits.
func HeadingText ¶ added in v0.1.23
HeadingText returns the normalized text of a Markdown heading at the given level, ignoring optional leading numbers such as `## 1. Intent`. It returns an empty string if the line is not a heading of the requested level.
func MissingSections ¶ added in v0.1.5
Types ¶
type File ¶ added in v0.1.6
File is one member of a spec bundle: a repository-relative slash path and its contents. The first file of a bundle is always the master spec.
func DecodeFiles ¶ added in v0.1.6
DecodeFiles interprets stored version content. The second return is false for legacy single-file rows (raw Markdown), true for encoded bundles.