feature:hook:remove

Remove a template hook registration from a feature’s hooks.py.


Usage

splent feature:hook:remove <feature_ref> <slot> [--with-function] [-y]

Arguments

Argument Description
<feature_ref> Editable feature: splent_feature_notes or splent-io/splent_feature_notes
<slot> Hook slot name to remove, e.g. layout.sidebar

Options

Option Description
--with-function Also remove the callback function definition from hooks.py.
-y, --yes Skip the confirmation prompt.

Examples

Remove only the registration line, keep the function:

splent feature:hook:remove splent_feature_notes layout.sidebar

Remove the registration and delete the function body:

splent feature:hook:remove splent_feature_notes layout.sidebar --with-function -y

Description

This command:

  1. Finds the register_template_hook("<slot>", func) line in hooks.py and removes it.
  2. If --with-function, also removes the function definition block.
  3. Updates [tool.splent.contract.provides].hooks in pyproject.toml.

Without --with-function, the callback function remains in hooks.py — useful if you want to repurpose it or reattach it to a different slot later.


Requirements

  • The feature must be editable (no @version suffix).
  • The slot must be registered in hooks.py.

See also


Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es