docrefs

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package docrefs parses versioned guide references and explicit Markdown anchors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckReferences

func CheckReferences(guidesDir string, refs []Reference) error

CheckReferences reads pages only from the selected module's docs/guides. It never follows a guide symlink or fetches missing pages from the network.

Types

type Anchors

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

Anchors indexes only literal explicit IDs, never generated heading slugs.

func IndexAnchors

func IndexAnchors(name string, data []byte) (Anchors, error)

IndexAnchors rejects malformed and duplicate explicit anchors outside fences. Callers must handle its error before using the index for fragment validation.

func (Anchors) CheckFragment

func (a Anchors) CheckFragment(file string, line int, fragment string) error

CheckFragment validates a raw fragment without its leading #. Framework checkdocs can use this for guide navigation links as well as app references.

type Problem

type Problem struct {
	File    string
	Line    int
	Message string
}

Problem locates invalid documentation without requiring a source checkout.

func (Problem) Error

func (p Problem) Error() string

type Reference

type Reference struct {
	File   string
	Line   int
	Guide  string
	Anchor string
}

Reference names a page and, optionally, an explicit anchor in that page.

func Parse

func Parse(name string, data []byte) ([]Reference, error)

Parse reads complete Foundry guides: declarations outside Markdown fences. Each line is independent; malformed lines yield no partial references.

Jump to

Keyboard shortcuts

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