feature:hooks

Introduction

feature:hooks lists the template hooks a feature registers. It reads the register_template_hook(slot, func) calls in the feature’s hooks.py.

splent feature:hooks splent_feature_notes
  Template hooks — splent_feature_notes
  ────────────────────────────────────────────────────────────
  Slot                                       Function
  ────────────────────────────────────────────────────────────
  layout.authenticated_sidebar               notes_sidebar

  Manage hooks with:  splent feature:hook:add splent_feature_notes <slot> <function>

Reading a released version

splent feature:hooks splent_feature_notes@v1.2.7

With a version, it reads that snapshot in .splent_cache/features/<namespace>/. Without one, it reads the editable copy at the workspace root, then an unversioned copy in the cache. The feature can also be splent-io/splent_feature_notes.


Getting JSON

splent feature:hooks splent_feature_notes --json

It prints an array of {"slot": ..., "function": ...} objects, for scripts.


Reference

Option Description
--json Print the hooks as a JSON array
Message When
hooks.py not found. The feature has no hooks.py
No hooks registered. hooks.py registers nothing
Feature not found at workspace root or cache: <name> No copy of the feature was found

Requirements

  • A selected product (SPLENT_APP).

See also


Back to top

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