Skip to content

DirectiveContext

type DirectiveContext =
    {
        Name: string
        Argument: string option
        Attributes: Map<string,string>
        Content: string
        Page: Page
        Site: SiteInfo
        Report: Diagnostic -> unit
    }
AssemblyNacara.Plugin.Markdown

What a :::name directive of your own is given.

Fields

Name: string
Argument: string option

The text after the name on the opening line, quotes removed.

Attributes: Map<string,string>

From {key=value}, {.class} and {#id} on the opening line. Classes are under class, space-separated, and the id under id.

Content: string

The markdown between the opening and closing lines, rendered.

Page: Page

The page the directive is on.

Site: SiteInfo
Report: Diagnostic -> unit

Adds a diagnostic at the directive's opening line. Warn and Error call it.

Properties

member Body: ReactElement

Content as an element, with no element around it.

Methods

member Attribute (name: string) : string option
member Error (message: string, ?hint: string) : unit

Reports an error at the directive's opening line, with the code directive-<name>. The build fails, and the page is still rendered.

Parameter
messageWhat is wrong.
hintHow to fix it.
member Warn (message: string, ?hint: string) : unit

Reports a warning at the directive's opening line, with the code directive-<name>.

Parameter
messageWhat is wrong.
hintHow to fix it.