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:
- Finds the
register_template_hook("<slot>", func)line inhooks.pyand removes it. - If
--with-function, also removes the function definition block. - Updates
[tool.splent.contract.provides].hooksinpyproject.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
@versionsuffix). - The slot must be registered in
hooks.py.
See also
feature:hooks— list current hooksfeature:hook:add— add a hook- Template system