sections

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package sections extracts deterministic document sections for indexing and retrieval.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApproxTokenCount

func ApproxTokenCount(text string) int

ApproxTokenCount uses the existing project approximation.

func EnclosingSectionID

func EnclosingSectionID(sections []Section, line int) string

EnclosingSectionID returns the section id containing line, if any.

func StableID

func StableID(artifactID, revisionID, headingPath string, startLine, endLine int) string

StableID creates a deterministic section id within one artifact revision.

Types

type Section

type Section struct {
	ID                 string
	ArtifactID         string
	RevisionID         string
	SourcePath         string
	HeadingPath        string
	HeadingDepth       int
	StartLine          int
	EndLine            int
	Title              string
	Body               string
	Frontmatter        map[string]string
	Tasks              []string
	AcceptanceCriteria []string
	Links              []string
	TokenEstimate      int
	Kind               string
	Metadata           map[string]string
}

Section is a markdown section with stable line-range evidence.

func AssignStableIDs

func AssignStableIDs(sections []Section, artifactID, revisionID, sourcePath string) []Section

AssignStableIDs fills section ids and parent/source metadata.

func ExtractMarkdown

func ExtractMarkdown(body string) []Section

ExtractMarkdown returns heading-delimited markdown sections.

Jump to

Keyboard shortcuts

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