docsoptions

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package docsoptions extracts the libav option keys the documentation teaches, so they can be checked by shape without an engine (Check) and offered to a real driver where one is supplied (the gated test in pkg/afmpeg/native).

The why is afmpeg#11: the option names in docs/ are only wrong at runtime, so nothing that compiles or lints them would catch a bad one.

Index

Constants

This section is empty.

Variables

View Source
var Sources = []string{"README.md", "docs"}

Sources are the paths, relative to the module root, whose Markdown is extracted.

Functions

This section is empty.

Types

type Dict

type Dict int

Dict is the option dictionary a key is written into.

const (
	EncoderDict Dict = iota
	VideoDict
	AudioDict
	SubtitleDict
	MuxerDict
	DemuxerDict
)

The dictionaries a documented key can land in.

func (Dict) IsEncoder

func (d Dict) IsEncoder() bool

IsEncoder reports whether the dictionary reaches an encoder.

func (Dict) String

func (d Dict) String() string

type Key

type Key struct {
	Dict  Dict
	Name  string
	Value string
	Line  int
}

Key is one documented option.

type Site

type Site struct {
	File       string
	Line       int
	Kind       SiteKind
	Path       string
	Format     string
	VideoCodec string
	AudioCodec string
	Keys       []Key
}

Site is one documented input or output and the option keys written into it, with what the docs set alongside them.

func Extract

func Extract(fsys fs.FS) ([]Site, error)

Extract reads every Markdown file under Sources in fsys and returns the documented sites that carry at least one option key.

func ExtractFile

func ExtractFile(name, md string) []Site

ExtractFile returns the sites in one Markdown document. Fenced code blocks and inline code spans are each read as an independent fragment.

type SiteKind

type SiteKind int

SiteKind says what a Site's keys were written inside.

const (
	// Unscoped keys sit in a fragment with no enclosing input or output, such as
	// an inline code span in prose.
	Unscoped SiteKind = iota
	OutputSite
	InputSite
)

The places a documented key can be written.

type Violation

type Violation struct {
	File   string
	Key    Key
	Reason string
}

Violation is a documented key that cannot be right whatever engine runs it.

func Check

func Check(sites []Site) []Violation

Check applies the shape rules every documented key must pass: no command-line stream specifier, and no name that only the other kind of component has.

func (Violation) String

func (v Violation) String() string

Jump to

Keyboard shortcuts

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