docsource

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package docsource renders guide examples from compiled consumer source.

Index

Constants

View Source
const TypeScriptInputs = "tests/fixtures/consumer/clientcontracts/typescript-inputs.json"

Variables

This section is empty.

Functions

func Check

func Check(documents []Document) error

func CheckGoInputs

func CheckGoInputs(root string, documents []Document, input io.Reader) error

CheckGoInputs consumes concatenated go list -json ./... results from the exact fixture modules and build environment used by make fixture-check. Test files count because that gate uses go test, not just go build. IgnoredGoFiles do not.

func CheckTypeScriptInputs

func CheckTypeScriptInputs(root string, documents []Document) error

CheckTypeScriptInputs uses the same file list the fresh-client strict compiler copies into its project. Frozen clients and unregistered testdata are not proof.

func ClosesFence

func ClosesFence(line, marker string) bool

ClosesFence distinguishes a safe longer delimiter from shorter content runs.

func FenceStart

func FenceStart(line string) (string, string)

FenceStart returns a fenced block delimiter and its language.

func RequiresCompiledSource added in v0.17.0

func RequiresCompiledSource(name string) bool

RequiresCompiledSource identifies guides whose executable examples must name compiled source.

Types

type Document

type Document struct {
	Path               string
	Original, Rendered []byte
	Inclusions         []Inclusion
	StaleLines         []int
	// AgentLines identifies navigation lines using the same section boundaries
	// as recipe coverage. Link targets are checked by checkdocs through docrefs.
	AgentLines []int
}

func Load

func Load(root string) ([]Document, error)

Load reads all guide directives. It validates ownership and section coverage, but leaves rendering comparison and publication to the caller.

type Inclusion

type Inclusion struct {
	Document       string
	Line           int
	Source, Region string
	First, Last    int
}

Jump to

Keyboard shortcuts

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