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 ¶
- func Definitions(index *symbols.Index, sem *semantics.Model, scope *symbols.Scope) []*symbols.Symbol
- func Evaluate(qctx queryexec.Context, sym *symbols.Symbol, text view.SourceText) (*docir.Document, error)
- func Files(names []string, extension string) (map[string]string, error)
- func Names(index *symbols.Index, sem *semantics.Model) []string
- func OriginOf(err error) symbols.Origin
- func QueryOutcomeOf(err error) *queryexec.Outcome
- func SiblingPlans(index *symbols.Index, sem *semantics.Model, resolver *resolve.Resolver, ...) []*docplan.Plan
- type Fault
- type Form
- type NotDocumentError
- type Options
- type Rendered
- type UnknownFormError
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 ¶
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 ¶
Names lists the qualified names of every document definition the model's workspace documents declare, sorted.
func OriginOf ¶
OriginOf is the source declaration the pipeline names behind err, unlocated when it names none.
func QueryOutcomeOf ¶
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 )
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.
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 ¶
Rendered is one document's text in one form and the file a set rendered in that form writes it 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