docset

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 17 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 docset renders one document of a model's set end to end — plan, siblings, the files a set writes, a backend's text — for the service, engine and workspace alike.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Definitions

func Definitions(index *symbols.Index, sem *semantics.Model, scope *symbols.Scope) []*symbols.Symbol

Definitions lists the document definitions declared in scope, outermost first.

func Evaluate

func Evaluate(qctx queryexec.Context, sym *symbols.Symbol, text view.SourceText) (*docir.Document, error)

Evaluate compiles sym's document definition and evaluates its queries in qctx, over the objects qctx holds: the document tree every form is written from.

func Files

func Files(names []string, extension string) (map[string]string, error)

Files plans the file a set rendered in the form of extension writes each named document to: its stem cut to fit, tagged where two would meet letter case aside; two of one name cannot be told apart.

func Names

func Names(index *symbols.Index, sem *semantics.Model) []string

Names lists the qualified names of every document definition the model's workspace documents declare, sorted.

func OriginOf

func OriginOf(err error) symbols.Origin

OriginOf is the source declaration the pipeline names behind err, unlocated when it names none.

func QueryOutcomeOf

func QueryOutcomeOf(err error) *queryexec.Outcome

QueryOutcomeOf is the outcome record of the query failure behind err, nil when no query failed.

func SiblingPlans

func SiblingPlans(index *symbols.Index, sem *semantics.Model, resolver *resolve.Resolver, entry *symbols.Symbol) []*docplan.Plan

SiblingPlans compiles every other document definition the workspace documents declare, skipping any that does not compile, so a single render emits the anchors siblings link to.

Types

type Fault

type Fault int

Fault is who a document failure is charged to: the status a transport reports the failure under.

const (
	// FaultInternal is the pipeline's own failure, or one it does not classify.
	FaultInternal Fault = iota
	// FaultArgument is the caller's: a form, name or binding the request got wrong.
	FaultArgument
	// FaultModel is a fault in the model's own document and query definitions.
	FaultModel
	// FaultBudget is a budget or the held-objects bound the evaluation exhausted.
	FaultBudget
)

func FaultOf

func FaultOf(err error) Fault

FaultOf classifies err: a wrong binding, form or non-document is the caller's, an exhausted budget a resource limit, a missing library or context the implementation's, the rest the model's.

type Form

type Form string

Form is the text a document definition is rendered as: what a RenderDocument request names in form, on every transport that serves one.

const (
	FormMarkdown Form = "markdown"
	FormHTML     Form = "html"
	FormAsciiDoc Form = "asciidoc"
)

func Forms

func Forms() []Form

Forms lists every form Render renders, in the order a refusal names them. PDF is not one: it drives converters only the sysml command runs.

type NotDocumentError

type NotDocumentError struct{ Name string }

NotDocumentError refuses an element that is not a document definition.

func (*NotDocumentError) Error

func (e *NotDocumentError) Error() string

type Options

type Options struct {
	// Form is the form the text is written in; empty renders Markdown.
	Form Form
	// WithoutGraphviz records that no Graphviz draws DOT for this render, so a
	// positioned diagram is written as Mermaid, the output stating so.
	WithoutGraphviz bool
}

Options is how Render writes a document.

type Rendered

type Rendered struct {
	Text     string
	FileName string
}

Rendered is one document's text in one form and the file a set rendered in that form writes it to.

func Render

func Render(qctx queryexec.Context, sym *symbols.Symbol, text view.SourceText, opts Options) (Rendered, error)

Render evaluates sym's document and writes it in opts.Form, linking the model's other documents by the files a set in that form writes them to.

type UnknownFormError

type UnknownFormError struct{ Form string }

UnknownFormError refuses a form Render does not render, naming the ones it does.

func (*UnknownFormError) Error

func (e *UnknownFormError) Error() string

Jump to

Keyboard shortcuts

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