django_bird.plugins.hookspecs

Module Contents

Functions

collect_component_assets

Collect all assets associated with a component.

get_template_directories

Return a list of all directories containing templates for a project.

pre_ready

Called before django-bird begins its internal setup.

ready

Called after django-bird application has completed its internal setup and is ready.

register_asset_types

Register a new type of asset.

Data

API

django_bird.plugins.hookspecs.hookspec

‘HookspecMarker(…)’

django_bird.plugins.hookspecs.collect_component_assets(template_path: pathlib.Path) collections.abc.Iterable[django_bird.staticfiles.Asset]

Collect all assets associated with a component.

This hook is called for each component template to gather its associated static assets. Implementations should scan for and return any CSS, JavaScript or other static files that belong to the component and return a list/set/other iterable of Asset objects.

django_bird.plugins.hookspecs.get_template_directories() list[pathlib.Path]

Return a list of all directories containing templates for a project.

This hook allows plugins to provide additional template directories beyond the default Django template directories. Implementations should return a list of Path objects pointing to directories that contain Django templates.

The template directories returned by this hook will be used by django-bird to discover components and their associated templates.

django_bird.plugins.hookspecs.pre_ready() None

Called before django-bird begins its internal setup.

This hook runs at the start of django-bird’s initialization, before any internal components are configured or discovered. Plugins can use this hook to perform early configuration of:

  • Django settings

  • Template directories

  • Template builtins

django_bird.plugins.hookspecs.ready() None

Called after django-bird application has completed its internal setup and is ready.

This hook is called during Django’s application ready phase, after django-bird’s own initialization is complete. Plugins can:

  • Access fully configured components

  • Register additional features that depend on django-bird being ready

  • Perform cleanup or post-initialization tasks

django_bird.plugins.hookspecs.register_asset_types(register_type: collections.abc.Callable[[django_bird.staticfiles.AssetType], None]) None

Register a new type of asset.

This hook allows plugins to register additional asset types beyond the default CSS and JS types. Each asset type defines how static assets should be rendered in HTML, what file extension it uses, and what django-bird asset templatetag it should be rendered with.