DirectiveContext
type DirectiveContext =
{
Ancestors: obj list
SiblingIndex: int
Nesting: int
Report: FaultSeverity * string -> unit
}| Assembly | Partas.Nacara.Plugins.Directives |
What a directive can find out about where it sits.
Markdig's block tree holds the nesting but not a parent's decoded arguments, so those are carried here instead. Lookup is by type, following Registry.extras: the type is the contract, and a directive that wants its parent asks for the parent's argument type rather than matching on a name.
Fields
Report: FaultSeverity * string -> unit
Report: FaultSeverity * string -> unitSays something went wrong, in whatever way the build wants it said.
Properties
Methods
member Error (message: string) : unit
member Error (message: string) : unitReport that the directive could not do what was asked of it.
This does not fail the build and cannot: nothing wires a diagnostic sink through to a Registry-scoped IMarkdownExtension, so there is nowhere for a fatal error to be raised to. What happens is that the message is written to stderr under an error: label, naming the directive it came from. What the page shows is whatever the render function went on to return.
member TryAncestor<'T> () : 'T option
member TryAncestor<'T> () : 'T optionThe nearest enclosing directive whose arguments are the given type.