Application

class esbonio.sphinx_agent.app.Esbonio(dbpath, app)[source]

Esbonio specific functionality.

add_directive(name, directive, argument_providers=None)[source]

Register a directive with esbonio.

Parameters:
add_role(name, role, target_providers=None)[source]

Register a role with esbonio.

Parameters:
  • name (str) – The name of the role, as the user would type in a document

  • role (Any) – The role’s implementation

  • target_providers (list[types.Role.TargetProvider] | None) – A list of target providers for the role

static create_directive_argument_provider(name, **kwargs)[source]

Create a new directive argument provider

Parameters:
  • name (str) – The name of the provider

  • kwargs – Additional arguments to pass to the provider instance

Returns:

The target provider

Return type:

types.Directive.ArgumentProvider

static create_role_target_provider(name, **kwargs)[source]

Create a new role target provider

Parameters:
  • name (str) – The name of the provider

  • kwargs – Additional arguments to pass to the provider instance

Returns:

The target provider

Return type:

types.Role.TargetProvider

property config_ast: Module | None

Return the AST for the user’s conf.py (if possible)

diagnostics: dict[types.Uri, set[types.Diagnostic]]

Recorded diagnostics.

class esbonio.sphinx_agent.app.Sphinx(*args, **kwargs)[source]

An extended sphinx application that integrates with esbonio.